Chris Lattner
884f49c47e
minor cleanups
...
llvm-svn: 35807
2007-04-09 06:10:06 +00:00
Reid Spencer
6bc0205a2a
For PR1146:
...
Move parameter attributes functionality to ParamAttrsList class.
llvm-svn: 35806
2007-04-09 06:07:52 +00:00
Chris Lattner
de148c7887
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
b940a717ac
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
13a530ec7f
implement CodeGen/X86/inline-asm-x-scalar.ll:test3
...
llvm-svn: 35802
2007-04-09 05:31:20 +00:00
Chris Lattner
c360f69afe
add some assertions
...
llvm-svn: 35800
2007-04-09 05:23:13 +00:00
Chris Lattner
e2d3bf8ecf
implement CodeGen/X86/inline-asm-x-scalar.ll
...
llvm-svn: 35799
2007-04-09 05:11:28 +00:00
Owen Anderson
e4c29f0b01
Move isReachableFromEntry out of line to avoid an unnecessary #include
...
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Chris Lattner
b3c4c64197
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
4ede44609e
Regenerate
...
llvm-svn: 35795
2007-04-09 01:56:05 +00:00
Reid Spencer
93d41cc941
Drop the implementation keyword.
...
llvm-svn: 35794
2007-04-09 01:55:42 +00:00
Chris Lattner
218d43af10
Fix PR1304 and Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll
...
llvm-svn: 35792
2007-04-09 01:37:55 +00:00
Chris Lattner
958d804293
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
b3d105a4f9
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
f9a432a613
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
1a746d3b8e
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
5f8b0c2acc
Fix PR1316
...
llvm-svn: 35783
2007-04-09 00:33:58 +00:00
Reid Spencer
aedaf87e5e
No functional change, this is just easier to read and debug.
...
llvm-svn: 35782
2007-04-08 23:58:41 +00:00
Chris Lattner
f9506a185b
Fix for CodeGen/X86/2007-04-08-InlineAsmCrash.ll and PR1314
...
llvm-svn: 35779
2007-04-08 22:23:26 +00:00
Owen Anderson
4b323657b9
Remove DomSet completely. This concludes work on PR1171.
...
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Reid Spencer
82c0c6353b
Make sure temporary data is not used past its life span.
...
llvm-svn: 35773
2007-04-08 20:10:14 +00:00
Chris Lattner
4ed32d0891
Fix a typo that broke SimplifyLibCalls/SPrintF.ll (pr1315)
...
llvm-svn: 35768
2007-04-08 18:11:26 +00:00
Chris Lattner
1a1b798eb5
reenable this xform, whoops :)
...
llvm-svn: 35765
2007-04-08 08:01:49 +00:00
Chris Lattner
1760b42378
Fix regression on Instcombine/apint-or2.ll
...
llvm-svn: 35763
2007-04-08 07:55:22 +00:00
Chris Lattner
d435e0bfd2
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
34464bdf2b
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
71592d1ef2
Remove DominatorSet usage from LoopSimplify. Patch from Owen Anderson.
...
llvm-svn: 35757
2007-04-08 01:04:30 +00:00
Nick Lewycky
26652f5681
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
16fe035aa4
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
5b3be230d4
Fix problems in the sprintf optimizer
...
llvm-svn: 35754
2007-04-07 21:17:51 +00:00
Chris Lattner
99a7ea0b00
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
d40c15afaa
Unbreak VC++ build.
...
llvm-svn: 35751
2007-04-07 20:47:27 +00:00
Chris Lattner
fcc6fe0a9c
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
fb17dbb809
Avoid a useless temporary constrution.
...
llvm-svn: 35747
2007-04-07 19:51:45 +00:00
Reid Spencer
845c291c87
Fix another PathWithStatus issue.
...
llvm-svn: 35744
2007-04-07 19:45:30 +00:00
Reid Spencer
875a2bc4db
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
14fb379888
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
7cf9d12f2e
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
c2cfa6111d
Eliminate unnecessary APInt construction.
...
llvm-svn: 35740
2007-04-07 17:48:27 +00:00
Zhou Sheng
7bcd47dbc1
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
21dfc2107a
Eliminate unnecessary zext/trunc stuffs.
...
llvm-svn: 35737
2007-04-07 17:12:38 +00:00
Nick Lewycky
e6cb3e2433
Add support for cast instructions.
...
llvm-svn: 35734
2007-04-07 15:48:32 +00:00
Nick Lewycky
ec51e934ef
Add signExtend to ConstantRange, to complement zeroExtend and truncate.
...
llvm-svn: 35733
2007-04-07 15:41:33 +00:00
Owen Anderson
85b0e20f2a
Completely purge DomSet. This is the (hopefully) final patch for PR1171.
...
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Owen Anderson
177b1a6aea
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
e2add101a4
BreakCriticalEdges does still preserve DominatorTree.
...
llvm-svn: 35729
2007-04-07 05:57:09 +00:00
Owen Anderson
eb184ee17b
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
c1bce783e8
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
41bf50021d
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
3e77af40ff
Support NE inequality in ValueRanges.
...
llvm-svn: 35724
2007-04-07 04:49:12 +00:00
Owen Anderson
5403a248af
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
54c7efee4d
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
7fbec59fb4
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
80cf96b3f8
Use TargetData to find the size of a type.
...
llvm-svn: 35718
2007-04-07 03:16:12 +00:00
Nick Lewycky
3ddf638983
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
562df7f986
Add loop rotation pass.
...
llvm-svn: 35714
2007-04-07 01:25:15 +00:00
Chris Lattner
dbf5d6cf68
fix a miscompilation in printf optimizer.
...
llvm-svn: 35713
2007-04-07 01:18:36 +00:00
Chris Lattner
9aa0d009c1
trunc to bool no longer compares against zero
...
llvm-svn: 35712
2007-04-07 01:03:46 +00:00
Chris Lattner
312c204869
cleanups for strlen optimizer
...
llvm-svn: 35711
2007-04-07 01:02:00 +00:00
Chris Lattner
5f27ea3613
Introduce a new ReplaceCallWith method, which simplifies a lot of code.
...
llvm-svn: 35710
2007-04-07 00:42:32 +00:00
Chris Lattner
fba13c72ef
fixes for strcpy optimizer
...
llvm-svn: 35709
2007-04-07 00:26:18 +00:00
Chris Lattner
02ae7ab94f
Fix bugs in strncmp.
...
llvm-svn: 35708
2007-04-07 00:06:57 +00:00
Chris Lattner
d8a16e67ab
fix 3 miscompilations and several compielr crashes in strcmp optimizer.
...
llvm-svn: 35707
2007-04-07 00:01:51 +00:00
Chris Lattner
c61ff0afc0
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
bfad67243a
clean up strcat optimizer, no functionality change.
...
llvm-svn: 35704
2007-04-06 22:59:33 +00:00
Chris Lattner
d03767c332
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
0160bf7114
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
03c84be56b
implement Transforms/InstCombine/malloc2.ll and PR1313
...
llvm-svn: 35700
2007-04-06 18:57:34 +00:00
Chris Lattner
b39a2df066
minor comment fix
...
llvm-svn: 35696
2007-04-06 17:47:14 +00:00
Reid Spencer
5d36a01dba
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
d33f94f2d2
remove the dead removeArgument method, rename Options to OptionsMap.
...
llvm-svn: 35690
2007-04-05 21:58:17 +00:00
Chris Lattner
19b9e90f9c
Fix Transforms/GlobalOpt/2007-04-05-Crash.ll
...
llvm-svn: 35689
2007-04-05 21:09:42 +00:00
Chris Lattner
997967979f
Use a worklist-driven algorithm instead of a recursive one.
...
llvm-svn: 35680
2007-04-05 01:27:02 +00:00
Reid Spencer
aad0b4536b
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
6eb55df794
Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
...
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Reid Spencer
a72beea861
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
e16f421e0e
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
fb15913194
Prevent transformConstExprCastCall from generating conversions that assert
...
elsewhere.
llvm-svn: 35668
2007-04-04 19:16:42 +00:00
Chris Lattner
ed593d6789
stringmap memory managed with malloc now
...
llvm-svn: 35666
2007-04-04 17:24:28 +00:00
Jeff Cohen
01d4afe6da
Fix 2007-04-04-BadFoldBitcastIntoMalloc.ll
...
llvm-svn: 35665
2007-04-04 16:58:57 +00:00
Evan Cheng
b7ec9433b3
Re-materialize all loads from fixed stack slots.
...
llvm-svn: 35660
2007-04-04 07:40:01 +00:00
Evan Cheng
48b94106d6
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
d8c3813f51
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
de998e6599
Fix comment.
...
llvm-svn: 35655
2007-04-04 06:42:45 +00:00
Reid Spencer
87ede33a19
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
6df393cf38
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
e825ec8a72
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
8a4ca643dd
use calloc instead of new/memset, it is more efficient
...
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
dbf6a79a71
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
44488cb676
Implement inline asm modifier P.
...
llvm-svn: 35640
2007-04-04 00:13:29 +00:00
Evan Cheng
d5956e4409
Typo.
...
llvm-svn: 35639
2007-04-04 00:06:07 +00:00
Bill Wendling
a4aa65bc38
Adding more MMX instructions.
...
llvm-svn: 35638
2007-04-03 23:48:32 +00:00
Chris Lattner
78271f0596
make a new missing features section
...
llvm-svn: 35637
2007-04-03 23:41:34 +00:00
Evan Cheng
2cd9df6983
Remove unused constant pool entries.
...
llvm-svn: 35635
2007-04-03 23:39:48 +00:00
Bill Wendling
ff2c460267
Updated
...
llvm-svn: 35634
2007-04-03 23:37:20 +00:00
Chris Lattner
974e931689
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
59994ede6b
greatly reduce hte default size of stringmap.
...
llvm-svn: 35632
2007-04-03 22:15:38 +00:00
Evan Cheng
db15aa24f9
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
bfe18d29f9
reinstate the previous two patches, with a bugfix :)
...
ldecod now passes.
llvm-svn: 35626
2007-04-03 17:43:25 +00:00
Nicolas Geoffray
681a87d9e8
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