Devang Patel
8eb8eeada9
Insert new pre-header before new header. Original pre-header may
...
happen to be an entry, in such case, it is not a good idea to
insert new block before entry.
Also fix typo in assertion check.
llvm-svn: 35833
2007-04-09 21:40:43 +00:00
Chris Lattner
09d78fc3cf
Fix a bug where calling materializeModule could corrupt the module, reading
...
multiple copies of the function into the Function*.
llvm-svn: 35831
2007-04-09 20:28:40 +00:00
Devang Patel
854197884b
Preserve canonical loop form.
...
llvm-svn: 35829
2007-04-09 20:19:46 +00:00
Jeff Cohen
4397363c16
When the number of elements is zero, don't malloc 32GB on 64-bit systems.
...
Fixes unexpected failures on FreeBSD/amd64 of:
CFrontend/2005-09-24-BitFieldCrash.c:
CFrontend/2007-02-04-EmptyStruct.c:
CFrontend/2007-03-26-ZeroWidthBitfield.c:
CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll:
llvm-svn: 35828
2007-04-09 19:26:30 +00:00
Reid Spencer
8436cdfda2
Don't link against System or Support library. These things will already
...
be in the opt tool.
llvm-svn: 35827
2007-04-09 19:17:47 +00:00
Devang Patel
b9af5747a5
Do not create new pre-header. Reuse original pre-header.
...
llvm-svn: 35825
2007-04-09 19:04:21 +00:00
Reid Spencer
ce38beb6a4
For PR1146:
...
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
leaks. This will change when ParamAttrsList is uniquified but needs to
be correct until then.
llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer
8684923644
Remove a memory leak, until ParamAttrsList is uniqued.
...
llvm-svn: 35823
2007-04-09 17:20:18 +00:00
Devang Patel
03d7ae3a74
Simpler for() loops.
...
llvm-svn: 35822
2007-04-09 17:09:13 +00:00
Devang Patel
d6ba41e02d
Fix future bug. Of course, Chris spotted this.
...
Handle Argument or Undef as an incoming PHI value.
llvm-svn: 35821
2007-04-09 16:41:46 +00:00
Devang Patel
b28a391a8d
More cosmetic changes.
...
llvm-svn: 35820
2007-04-09 16:21:29 +00:00
Devang Patel
88bc2c6f82
Only cosmetic changes. Zero functionality Change.
...
llvm-svn: 35819
2007-04-09 16:11:48 +00:00
Reid Spencer
019c8869ed
For PR1146:
...
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp
llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Jeff Cohen
0475f3b4e9
Unbreak VC++ build.
...
llvm-svn: 35817
2007-04-09 14:32:59 +00:00
Anton Korobeynikov
506eaf7915
Next stage into switch lowering refactoring
...
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small (<machine word
length) cases with few destinations. Good testcase will follow.
llvm-svn: 35816
2007-04-09 12:31:58 +00:00
Chris Lattner
d112a031ea
Convert ImmediateDominators::DFSPass from being recursive to being iterative.
...
llvm-svn: 35815
2007-04-09 06:44:42 +00:00
Reid Spencer
71b79e3d99
For PR1146:
...
Adapt handling of parameter attributes to use the new ParamAttrsList class.
llvm-svn: 35814
2007-04-09 06:17:21 +00:00
Reid Spencer
f51a7050dd
Regenerate
...
llvm-svn: 35813
2007-04-09 06:16:21 +00:00
Reid Spencer
52796e819f
For PR1146:
...
Use ParamAttrsList for writing parameter attributes. Since they are sparse
now, we also write them sparsely (saves a few bytes). Unfortunately, this
is a bytecode file format change.
llvm-svn: 35811
2007-04-09 06:14:31 +00:00
Reid Spencer
e76289b8ea
For PR1146:
...
Simplify construction of FunctionType to use default arguments.
llvm-svn: 35810
2007-04-09 06:12:07 +00:00
Reid Spencer
26d9ff65a3
For PR1146:
...
Parameter attributes can now be defaulted for intrinsics.
llvm-svn: 35809
2007-04-09 06:11:23 +00:00
Reid Spencer
1517de317a
For PR1146:
...
Adjust writing of parameter attributes to use ParamAttrList class.
llvm-svn: 35808
2007-04-09 06:10:42 +00:00
Chris Lattner
0a5677d912
minor cleanups
...
llvm-svn: 35807
2007-04-09 06:10:06 +00:00
Reid Spencer
238633f17e
For PR1146:
...
Move parameter attributes functionality to ParamAttrsList class.
llvm-svn: 35806
2007-04-09 06:07:52 +00:00
Chris Lattner
7451e4d6a1
move a bunch of register constraints from being handled by
...
getRegClassForInlineAsmConstraint to being handled by
getRegForInlineAsmConstraint. This allows us to let the llvm register allocator
allocate, which gives us better code. For example, X86/2007-01-29-InlineAsm-ir.ll
used to compile to:
_run_init_process:
subl $4, %esp
movl %ebx, (%esp)
xorl %ebx, %ebx
movl $11, %eax
movl %ebx, %ecx
movl %ebx, %edx
# InlineAsm Start
push %ebx ; movl %ebx,%ebx ; int $0x80 ; pop %ebx
# InlineAsm End
Now we get:
_run_init_process:
xorl %ecx, %ecx
movl $11, %eax
movl %ecx, %edx
# InlineAsm Start
push %ebx ; movl %ecx,%ebx ; int $0x80 ; pop %ebx
# InlineAsm End
llvm-svn: 35804
2007-04-09 05:49:22 +00:00
Chris Lattner
2b6b4eb471
implement support for CodeGen/X86/inline-asm-x-scalar.ll:test3 - i32/i64 values
...
used with x constraints.
llvm-svn: 35803
2007-04-09 05:31:48 +00:00
Chris Lattner
7b2decfa0a
implement CodeGen/X86/inline-asm-x-scalar.ll:test3
...
llvm-svn: 35802
2007-04-09 05:31:20 +00:00
Chris Lattner
18d6718e78
add some assertions
...
llvm-svn: 35800
2007-04-09 05:23:13 +00:00
Chris Lattner
590ed5e5b7
implement CodeGen/X86/inline-asm-x-scalar.ll
...
llvm-svn: 35799
2007-04-09 05:11:28 +00:00
Owen Anderson
6978893a8f
Move isReachableFromEntry out of line to avoid an unnecessary #include
...
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Chris Lattner
a2e2e5640a
Fix a bug that caused alignment information to occasionally get stripped off
...
of an allocation instruction when writing to bytecode.
llvm-svn: 35796
2007-04-09 03:37:36 +00:00
Reid Spencer
7ae03fc5fb
Regenerate
...
llvm-svn: 35795
2007-04-09 01:56:05 +00:00
Reid Spencer
bef90fe7a7
Drop the implementation keyword.
...
llvm-svn: 35794
2007-04-09 01:55:42 +00:00
Chris Lattner
a87c9f6114
Fix PR1304 and Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll
...
llvm-svn: 35792
2007-04-09 01:37:55 +00:00
Chris Lattner
f73d215023
Fix a bug introduced with my previous patch, where it didn't correctly handle
...
instructions which replace themselves when FI's are rewritten (common on ppc).
This fixes CodeGen/PowerPC/2006-10-17-ppc64-alloca.ll
llvm-svn: 35789
2007-04-09 01:19:33 +00:00
Chris Lattner
4ca9cbb170
Eliminate useless insertelement instructions. This implements
...
Transforms/InstCombine/vec_insertelt.ll and fixes PR1286.
We now compile the code from that bug into:
_foo:
movl 4(%esp), %eax
movdqa (%eax), %xmm0
movl 8(%esp), %ecx
psllw (%ecx), %xmm0
movdqa %xmm0, (%eax)
ret
instead of:
_foo:
subl $4, %esp
movl %ebp, (%esp)
movl %esp, %ebp
movl 12(%ebp), %eax
movdqa (%eax), %xmm0
#IMPLICIT_DEF %eax
pinsrw $2, %eax, %xmm0
xorl %ecx, %ecx
pinsrw $3, %ecx, %xmm0
pinsrw $4, %eax, %xmm0
pinsrw $5, %ecx, %xmm0
pinsrw $6, %eax, %xmm0
pinsrw $7, %ecx, %xmm0
movl 8(%ebp), %eax
movdqa (%eax), %xmm1
psllw %xmm0, %xmm1
movdqa %xmm1, (%eax)
movl %ebp, %esp
popl %ebp
ret
woo :)
llvm-svn: 35788
2007-04-09 01:11:16 +00:00
Owen Anderson
ae39ca037a
Cleanup some from my DomSet-removal changes. Add a new
...
isReachableFromEntry
test to ETForest to factor a common test out of code.
llvm-svn: 35786
2007-04-09 00:52:49 +00:00
Chris Lattner
0df5357436
Fix CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll and PR1308:
...
some instructions can have multiple frame indices in them. If this happens,
rewrite all of them.
llvm-svn: 35785
2007-04-09 00:46:10 +00:00
Chris Lattner
b49917da92
Fix PR1316
...
llvm-svn: 35783
2007-04-09 00:33:58 +00:00
Reid Spencer
8b73a719cf
No functional change, this is just easier to read and debug.
...
llvm-svn: 35782
2007-04-08 23:58:41 +00:00
Chris Lattner
e55ecfb870
Fix for CodeGen/X86/2007-04-08-InlineAsmCrash.ll and PR1314
...
llvm-svn: 35779
2007-04-08 22:23:26 +00:00
Owen Anderson
fe507270ac
Remove DomSet completely. This concludes work on PR1171.
...
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Reid Spencer
8ee9a827e7
Make sure temporary data is not used past its life span.
...
llvm-svn: 35773
2007-04-08 20:10:14 +00:00
Chris Lattner
aa8ad10c2f
Fix a typo that broke SimplifyLibCalls/SPrintF.ll (pr1315)
...
llvm-svn: 35768
2007-04-08 18:11:26 +00:00
Chris Lattner
c8d3788f71
reenable this xform, whoops :)
...
llvm-svn: 35765
2007-04-08 08:01:49 +00:00
Chris Lattner
7621a031d8
Fix regression on Instcombine/apint-or2.ll
...
llvm-svn: 35763
2007-04-08 07:55:22 +00:00
Chris Lattner
1150df9cc4
Generalize the code that handles (A&B)|(A&C) to work where B/C are not constants.
...
Add a new xform to simplify (A&B)|(~A&C). THis implements InstCombine/or2.ll:test1
llvm-svn: 35760
2007-04-08 07:47:01 +00:00
Chris Lattner
5717981e5d
implement a fixme: move optimizations for fwrite out of fputs into a new
...
fwrite optimizer.
llvm-svn: 35758
2007-04-08 07:00:35 +00:00
Nick Lewycky
e6c64466c7
Remove DominatorSet usage from LoopSimplify. Patch from Owen Anderson.
...
llvm-svn: 35757
2007-04-08 01:04:30 +00:00
Nick Lewycky
73ffedb592
Don't crash when encountering a BasicBlock that hasn't been registered yet.
...
llvm-svn: 35756
2007-04-08 01:02:12 +00:00
Chris Lattner
182a945fb5
Significantly simplify the clients of GetConstantStringInfo, by having it
...
just return the string itself.
llvm-svn: 35755
2007-04-07 21:58:02 +00:00
Chris Lattner
08c0b8b3c8
Fix problems in the sprintf optimizer
...
llvm-svn: 35754
2007-04-07 21:17:51 +00:00
Chris Lattner
bed184cbcf
Change CastToCStr to take a pointer instead of a reference.
...
Fix some miscompilations in fprintf optimizer.
llvm-svn: 35753
2007-04-07 21:04:50 +00:00
Jeff Cohen
79582366e5
Unbreak VC++ build.
...
llvm-svn: 35751
2007-04-07 20:47:27 +00:00
Chris Lattner
898d698d9f
Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86
...
and Prolangs-C/cdecl
llvm-svn: 35749
2007-04-07 20:19:08 +00:00
Reid Spencer
2d6db76bda
Avoid a useless temporary constrution.
...
llvm-svn: 35747
2007-04-07 19:51:45 +00:00
Reid Spencer
95b43e986d
Fix another PathWithStatus issue.
...
llvm-svn: 35744
2007-04-07 19:45:30 +00:00
Reid Spencer
21b76a9b99
For PR1291:
...
Change uses of sys::Path class to sys::PathWithStatus in those places where
the file status information is needed.
llvm-svn: 35743
2007-04-07 18:53:16 +00:00
Reid Spencer
ceeb918dd1
For PR1291:
...
Implement the PathWithStatus class and its use throughout lib/System.
llvm-svn: 35742
2007-04-07 18:52:17 +00:00
Owen Anderson
f7ebea1b9f
Add DomSet back, and revert the changes to LoopSimplify. Apparently the
...
ETForest updating mechanisms don't work as I thought they did. These changes
will be reapplied once the issue is worked out.
llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Zhou Sheng
2852d99a48
Eliminate unnecessary APInt construction.
...
llvm-svn: 35740
2007-04-07 17:48:27 +00:00
Zhou Sheng
c0297896aa
Make APInt variables do the computation stuffs instead of
...
ConstantExpr::getXX if possible.
llvm-svn: 35738
2007-04-07 17:40:57 +00:00
Zhou Sheng
1459c73481
Eliminate unnecessary zext/trunc stuffs.
...
llvm-svn: 35737
2007-04-07 17:12:38 +00:00
Nick Lewycky
d4f51a8ae3
Add support for cast instructions.
...
llvm-svn: 35734
2007-04-07 15:48:32 +00:00
Nick Lewycky
b89804f246
Add signExtend to ConstantRange, to complement zeroExtend and truncate.
...
llvm-svn: 35733
2007-04-07 15:41:33 +00:00
Owen Anderson
8763ba1b88
Completely purge DomSet. This is the (hopefully) final patch for PR1171.
...
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Owen Anderson
706e97049d
Completely purge DomSet from LoopSimplify. This is part of the
...
continuing work on PR1171.
llvm-svn: 35730
2007-04-07 06:56:47 +00:00
Owen Anderson
d03a646f06
BreakCriticalEdges does still preserve DominatorTree.
...
llvm-svn: 35729
2007-04-07 05:57:09 +00:00
Owen Anderson
b39d9ca902
Expunge DomSet from BreakCriticalEdges. This is part of the continuing
...
work for PR 1171.
llvm-svn: 35728
2007-04-07 05:49:29 +00:00
Chris Lattner
0e1c1d4ae3
Fix a bug in my earlier commit which exposed positional options backwards.
...
This fixes llvm-ar.
llvm-svn: 35727
2007-04-07 05:38:53 +00:00
Owen Anderson
f095bf3ac4
Expunge DomSet from CodeExtractor. This is part of the continuing work
...
on PR1171.
llvm-svn: 35726
2007-04-07 05:31:27 +00:00
Nick Lewycky
93f541057b
Support NE inequality in ValueRanges.
...
llvm-svn: 35724
2007-04-07 04:49:12 +00:00
Owen Anderson
1a290bbddf
Expunge DomSet from LoadValueNumbering. This is part of the continuing
...
work on PR1171.
llvm-svn: 35723
2007-04-07 04:43:07 +00:00
Owen Anderson
910419596e
Expunge a bunch of uses of DomSet from LoopSimplify. Many more remain.
...
This is the beginning of work for PR1171.
llvm-svn: 35720
2007-04-07 04:37:14 +00:00
Nick Lewycky
3bb6de85d1
Cleanup. Refactor out the applying of value ranges to its own method.
...
llvm-svn: 35719
2007-04-07 03:36:51 +00:00
Nick Lewycky
12d44abe0f
Use TargetData to find the size of a type.
...
llvm-svn: 35718
2007-04-07 03:16:12 +00:00
Nick Lewycky
eeb01b41ef
Strengthen icmp snuggling by doing 'compare-or-equal-to' to 'compare'
...
first and then range testing second.
llvm-svn: 35715
2007-04-07 02:30:14 +00:00
Devang Patel
f42389ffe5
Add loop rotation pass.
...
llvm-svn: 35714
2007-04-07 01:25:15 +00:00
Chris Lattner
0f1509511e
fix a miscompilation in printf optimizer.
...
llvm-svn: 35713
2007-04-07 01:18:36 +00:00
Chris Lattner
6a36d636e9
trunc to bool no longer compares against zero
...
llvm-svn: 35712
2007-04-07 01:03:46 +00:00
Chris Lattner
e8829aa9dd
cleanups for strlen optimizer
...
llvm-svn: 35711
2007-04-07 01:02:00 +00:00
Chris Lattner
485b6415b1
Introduce a new ReplaceCallWith method, which simplifies a lot of code.
...
llvm-svn: 35710
2007-04-07 00:42:32 +00:00
Chris Lattner
6a6c1f1c30
fixes for strcpy optimizer
...
llvm-svn: 35709
2007-04-07 00:26:18 +00:00
Chris Lattner
f9ee647e86
Fix bugs in strncmp.
...
llvm-svn: 35708
2007-04-07 00:06:57 +00:00
Chris Lattner
c9ccc30212
fix 3 miscompilations and several compielr crashes in strcmp optimizer.
...
llvm-svn: 35707
2007-04-07 00:01:51 +00:00
Chris Lattner
39f0bb9670
Fix several nasty bugs in the strchr optimizer, this fixes
...
SimplifyLibCalls/2007-04-06-strchr-miscompile.ll and PR1307
llvm-svn: 35706
2007-04-06 23:38:55 +00:00
Chris Lattner
56b7fc7768
clean up strcat optimizer, no functionality change.
...
llvm-svn: 35704
2007-04-06 22:59:33 +00:00
Chris Lattner
9b2b8abd20
rename getConstantStringLength -> GetConstantStringInfo. Make it return
...
the start index of the array as well as the length. No functionality change.
llvm-svn: 35703
2007-04-06 22:54:17 +00:00
Chris Lattner
5247f60d20
rearchitect the registration mechanism used by the command line option stuff.
...
This dramatically reduce the amount of memory allocated by the commandline stuff
at static init time, changing it to build local data structures when ParseCommandLineOptions
is called. In a dummy empty program that links some llvm libraries, this reduces
the number of malloc'd bytes from 4864 to 3360 on entry to main. Most of that
memory is now allocated by non-commandline related stuff.
llvm-svn: 35701
2007-04-06 21:06:55 +00:00
Chris Lattner
3dbe65f80a
implement Transforms/InstCombine/malloc2.ll and PR1313
...
llvm-svn: 35700
2007-04-06 18:57:34 +00:00
Chris Lattner
1c741e95d3
minor comment fix
...
llvm-svn: 35696
2007-04-06 17:47:14 +00:00
Reid Spencer
8d529a18f4
For PR1209:
...
Implement Type class's ContainedTys without using a std::vector.
llvm-svn: 35693
2007-04-06 02:02:20 +00:00
Chris Lattner
2031b02faf
remove the dead removeArgument method, rename Options to OptionsMap.
...
llvm-svn: 35690
2007-04-05 21:58:17 +00:00
Chris Lattner
1a9a760318
Fix Transforms/GlobalOpt/2007-04-05-Crash.ll
...
llvm-svn: 35689
2007-04-05 21:09:42 +00:00
Chris Lattner
108083edff
Use a worklist-driven algorithm instead of a recursive one.
...
llvm-svn: 35680
2007-04-05 01:27:02 +00:00
Reid Spencer
85460acfbf
Change the bit_part_select (non)implementation from "return 0" to abort.
...
llvm-svn: 35679
2007-04-05 01:20:18 +00:00
Reid Spencer
cce90f55ed
Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
...
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Reid Spencer
e9f516384d
Squelch a warning about mismatch between sign of constant and sign of return
...
type.
llvm-svn: 35674
2007-04-04 22:07:24 +00:00
Anton Korobeynikov
915e61736b
Properly emit range comparisons for switch cases, where neighbour cases
...
go to the same destination. Now we're producing really good code for
switch-lower-feature.ll testcase
llvm-svn: 35672
2007-04-04 21:14:49 +00:00
Dale Johannesen
7c2001d014
Prevent transformConstExprCastCall from generating conversions that assert
...
elsewhere.
llvm-svn: 35668
2007-04-04 19:16:42 +00:00
Chris Lattner
c770a0273d
stringmap memory managed with malloc now
...
llvm-svn: 35666
2007-04-04 17:24:28 +00:00
Jeff Cohen
5a1c750f31
Fix 2007-04-04-BadFoldBitcastIntoMalloc.ll
...
llvm-svn: 35665
2007-04-04 16:58:57 +00:00
Evan Cheng
8be98c1572
Re-materialize all loads from fixed stack slots.
...
llvm-svn: 35660
2007-04-04 07:40:01 +00:00
Evan Cheng
2bf2aadd9a
Trivially re-materializable instructions have spill weights that are half of what it would be otherwise.
...
llvm-svn: 35658
2007-04-04 07:04:55 +00:00
Reid Spencer
d1b53f538d
For PR1302:
...
Use local variable names that match the function parameter name that it
is passed to so the code is more clear, to wit: is_bytecode -> is_native
llvm-svn: 35656
2007-04-04 06:44:18 +00:00
Duncan Sands
f01a47c93c
Fix comment.
...
llvm-svn: 35655
2007-04-04 06:42:45 +00:00
Reid Spencer
a2c415526c
For PR1302:
...
Implement file tests for both LinkInLibrary and LinkInFile to determine if
the file is native. Don't generate warnings if the file is native.
llvm-svn: 35653
2007-04-04 06:33:17 +00:00
Reid Spencer
e9d794e7b5
For PR1302:
...
Adjust useage of sys::Path::FileType for new enumerator names.
llvm-svn: 35651
2007-04-04 06:31:04 +00:00
Reid Spencer
4ef4c46c35
For PR1302:
...
Implement recognition of COFF, ELF and Mach-O object/shared lib files.
llvm-svn: 35650
2007-04-04 06:30:26 +00:00
Chris Lattner
adf83a3513
use calloc instead of new/memset, it is more efficient
...
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
2376346a8e
Extend StringMap to support being initialized as completely empty. When
...
initialized this way, they do not do a malloc to allocate their buckets.
llvm-svn: 35642
2007-04-04 00:29:37 +00:00
Evan Cheng
1e150dedd1
Implement inline asm modifier P.
...
llvm-svn: 35640
2007-04-04 00:13:29 +00:00
Evan Cheng
bd31f41daa
Typo.
...
llvm-svn: 35639
2007-04-04 00:06:07 +00:00
Bill Wendling
ac5b650a54
Adding more MMX instructions.
...
llvm-svn: 35638
2007-04-03 23:48:32 +00:00
Chris Lattner
f79fb5cad0
make a new missing features section
...
llvm-svn: 35637
2007-04-03 23:41:34 +00:00
Evan Cheng
3c68d4e8ba
Remove unused constant pool entries.
...
llvm-svn: 35635
2007-04-03 23:39:48 +00:00
Bill Wendling
2640b4a4ab
Updated
...
llvm-svn: 35634
2007-04-03 23:37:20 +00:00
Chris Lattner
e5bbb3cb1a
Fix a bug I introduced with my patch yesterday which broke Qt (I converted
...
some constant exprs to apints).
Thanks to Anton for tracking down a small testcase that triggered this!
llvm-svn: 35633
2007-04-03 23:29:39 +00:00
Chris Lattner
64df4ba422
greatly reduce hte default size of stringmap.
...
llvm-svn: 35632
2007-04-03 22:15:38 +00:00
Evan Cheng
39d8b4db92
Fixed a bug that causes codegen of noop like add r0, r0, #0 .
...
llvm-svn: 35627
2007-04-03 21:31:21 +00:00
Chris Lattner
a74deafb13
reinstate the previous two patches, with a bugfix :)
...
ldecod now passes.
llvm-svn: 35626
2007-04-03 17:43:25 +00:00
Nicolas Geoffray
23710a7da3
Starting implementation of the ELF32 ABI specification of varargs handling.
...
LowerVASTART emits the right code if the subtarget is ELF32, the other intrinsics
(VAARG, VACOPY and VAEND) are not yet implemented.
llvm-svn: 35625
2007-04-03 13:59:52 +00:00
Nicolas Geoffray
b3e99a18ee
The PPC64 ELF ABI is "intended to use the same structure layout and calling convention rules
...
as the 64-bit PowerOpen ABI" (Reference http://www.linux-foundation.org/spec/ELF/ppc64/ ).
Change all ELF tests to ELF32.
llvm-svn: 35624
2007-04-03 12:35:28 +00:00
Nicolas Geoffray
ab559f6e3c
Addition to the previous commit for getCalleeSavedRegClasses:
...
"The ELF ABI specifies F1-F8 registers as argument registers for double, not
F1-F10. This affects only ELF, not MachO."
llvm-svn: 35623
2007-04-03 10:57:49 +00:00
Nicolas Geoffray
fbfc451ba9
The ELF ABI specifies F1-F8 registers as argument registers for double, not
...
F1-F10. This affects only ELF, not MachO.
llvm-svn: 35622
2007-04-03 10:27:07 +00:00
Evan Cheng
7511fa280d
Reverting back to 1.723. The last two commits broke JM (and possibily others) on ARM.
...
llvm-svn: 35620
2007-04-03 08:11:50 +00:00
Evan Cheng
e8315fe3f5
Inverted logic.
...
llvm-svn: 35619
2007-04-03 06:44:25 +00:00
Evan Cheng
06a7041ff9
Bad bad bug. findRegisterUseOperand() returns -1 if a use if not found.
...
llvm-svn: 35618
2007-04-03 06:43:29 +00:00
Bill Wendling
652c7b2d73
Changed to new MMX_ recipes.
...
llvm-svn: 35617
2007-04-03 06:18:31 +00:00
Bill Wendling
e7b2a864f2
Add FEMMS and ADDQ. Renamed MMX recipes to prepend the MMX_ to them.
...
llvm-svn: 35616
2007-04-03 06:00:37 +00:00
Chris Lattner
81e0707552
split some code out into a helper function
...
llvm-svn: 35615
2007-04-03 05:11:24 +00:00
Chris Lattner
64c764cebc
Split a whole ton of code out of visitICmpInst into visitICmpInstWithInstAndIntCst.
...
llvm-svn: 35614
2007-04-03 04:46:52 +00:00
Chris Lattner
8b2ec5f506
Fix PR1253 and xor2.ll:test[01]
...
llvm-svn: 35612
2007-04-03 01:47:41 +00:00
Chris Lattner
f742e2fe70
Arm supports negative strides as well, add them. This lets us compile:
...
CodeGen/ARM/arm-negative-stride.ll to:
LBB1_2: @bb
str r1, [r3, -r0, lsl #2 ]
add r0, r0, #1
cmp r0, r2
bne LBB1_2 @bb
llvm-svn: 35609
2007-04-03 00:13:57 +00:00
Chris Lattner
f3197a7d53
allow -1 strides to reuse "1" strides.
...
llvm-svn: 35607
2007-04-02 22:51:58 +00:00
Scott Michel
16627a542f
1. Insert custom lowering hooks for ISD::ROTR and ISD::ROTL.
...
2. Help DAGCombiner recognize zero/sign/any-extended versions of ROTR and ROTL
patterns. This was motivated by the X86/rotate.ll testcase, which should now
generate code for other platforms (and soon-to-come platforms.) Rewrote code
slightly to make it easier to read.
llvm-svn: 35605
2007-04-02 21:36:32 +00:00
Dale Johannesen
d13786dd82
fix off by 1 error in displacement computation
...
llvm-svn: 35602
2007-04-02 20:31:06 +00:00
Chris Lattner
8e168a4f36
fix the CodeGen/ARM/2007-03-13-InstrSched.ll regression: allow IV's with scales
...
to be folded into non-store instructions.
llvm-svn: 35601
2007-04-02 18:51:18 +00:00
Evan Cheng
476fb6a5c9
Ugh. Copy coalescer does not update register numbers.
...
llvm-svn: 35600
2007-04-02 18:49:18 +00:00
Chris Lattner
6223e83f6d
add support for the 'w' inline asm register class.
...
llvm-svn: 35598
2007-04-02 17:24:08 +00:00
Zhou Sheng
9bc8ab100d
1. Make use of APInt operation instead of using ConstantExpr::getXXX.
...
2. Use cheaper APInt methods.
llvm-svn: 35594
2007-04-02 13:45:30 +00:00
Zhou Sheng
56cda95658
Use uint32_t for bitwidth instead of unsigned.
...
llvm-svn: 35593
2007-04-02 08:20:41 +00:00
Chris Lattner
28e0e4e11e
Pass the type of the store access, not the type of the store, into the
...
target hook. This allows us to codegen a loop as:
LBB1_1: @cond_next
mov r2, #0
str r2, [r0, +r3, lsl #2 ]
add r3, r3, #1
cmn r3, #1
bne LBB1_1 @cond_next
instead of:
LBB1_1: @cond_next
mov r2, #0
str r2, [r0], #+4
add r3, r3, #1
cmn r3, #1
bne LBB1_1 @cond_next
This looks the same, but has one fewer induction variable (and therefore,
one fewer register) live in the loop.
llvm-svn: 35592
2007-04-02 06:34:44 +00:00
Chris Lattner
3e21eb7fd7
Fix a bug which caused us to never be able to use signed comparisons for
...
equality comparisons of a constant. This allows us to codegen the 'sintzero'
loop in PR1288 as:
LBB1_1: ;cond_next
li r4, 0
addi r2, r2, 1
stw r4, 0(r3)
addi r3, r3, 4
cmpwi cr0, r2, -1
bne cr0, LBB1_1 ;cond_next
instead of:
LBB1_1: ;cond_next
addi r2, r2, 1
li r4, 0
xoris r5, r2, 65535
stw r4, 0(r3)
addi r3, r3, 4
cmplwi cr0, r5, 65535
bne cr0, LBB1_1 ;cond_next
This implements CodeGen/PowerPC/compare-simm.ll, and also cuts 74
instructions out of kc++.
llvm-svn: 35590
2007-04-02 05:59:42 +00:00
Chris Lattner
9d5aacee92
Wrap long line
...
llvm-svn: 35588
2007-04-02 05:48:58 +00:00
Chris Lattner
50490d54f2
use more obvious function name.
...
llvm-svn: 35587
2007-04-02 05:42:22 +00:00
Chris Lattner
a3e0bb4ebb
Treat xor of signbit like an add.
...
llvm-svn: 35586
2007-04-02 05:41:38 +00:00
Chris Lattner
b24acc7bee
simplify (x+c)^signbit as (x+c+signbit), pointed out by PR1288. This implements
...
test/Transforms/InstCombine/xor.ll:test28
llvm-svn: 35584
2007-04-02 05:36:22 +00:00
Chris Lattner
b7b75145f1
reduce use of std::set
...
llvm-svn: 35576
2007-04-02 01:44:59 +00:00
Chris Lattner
c3748562bd
Various passes before isel split edges and do other CFG-restructuring changes.
...
isel has its own particular features that it wants in the CFG, in order to
reduce the number of times a constant is computed, etc. Make sure that we
clean up the CFG before doing any other things for isel. Doing so can
dramatically reduce the number of split edges and reduce the number of
places that constants get computed. For example, this shrinks
CodeGen/Generic/phi-immediate-factoring.ll from 44 to 37 instructions on X86,
and from 21 to 17 MBB's in the output. This is primarily a code size win,
not a performance win.
This implements CodeGen/Generic/phi-immediate-factoring.ll and PR1296.
llvm-svn: 35575
2007-04-02 01:35:34 +00:00