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
03c84be56b
implement Transforms/InstCombine/malloc2.ll and PR1313
...
llvm-svn: 35700
2007-04-06 18:57:34 +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
Dale Johannesen
fb15913194
Prevent transformConstExprCastCall from generating conversions that assert
...
elsewhere.
llvm-svn: 35668
2007-04-04 19:16:42 +00:00
Jeff Cohen
01d4afe6da
Fix 2007-04-04-BadFoldBitcastIntoMalloc.ll
...
llvm-svn: 35665
2007-04-04 16:58:57 +00:00
Duncan Sands
de998e6599
Fix comment.
...
llvm-svn: 35655
2007-04-04 06:42:45 +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
bfe18d29f9
reinstate the previous two patches, with a bugfix :)
...
ldecod now passes.
llvm-svn: 35626
2007-04-03 17:43:25 +00:00
Evan Cheng
e30cfe8e9e
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
Chris Lattner
4302c8bcdb
split some code out into a helper function
...
llvm-svn: 35615
2007-04-03 05:11:24 +00:00
Chris Lattner
23d58bde29
Split a whole ton of code out of visitICmpInst into visitICmpInstWithInstAndIntCst.
...
llvm-svn: 35614
2007-04-03 04:46:52 +00:00
Chris Lattner
9b66a372c8
Fix PR1253 and xor2.ll:test[01]
...
llvm-svn: 35612
2007-04-03 01:47:41 +00:00
Chris Lattner
3df2382275
allow -1 strides to reuse "1" strides.
...
llvm-svn: 35607
2007-04-02 22:51:58 +00:00
Zhou Sheng
98c161c290
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
47311533a7
Use uint32_t for bitwidth instead of unsigned.
...
llvm-svn: 35593
2007-04-02 08:20:41 +00:00
Chris Lattner
d7c96e25e4
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
aaf29d3b5e
Wrap long line
...
llvm-svn: 35588
2007-04-02 05:48:58 +00:00
Chris Lattner
7208dd1001
use more obvious function name.
...
llvm-svn: 35587
2007-04-02 05:42:22 +00:00
Chris Lattner
35ece02bea
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
d59b6b3d90
reduce use of std::set
...
llvm-svn: 35576
2007-04-02 01:44:59 +00:00
Chris Lattner
2f94a80322
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
Chris Lattner
ac77daac29
print the type of an inserted IV in -debug mode.
...
llvm-svn: 35563
2007-04-01 22:21:39 +00:00
Chris Lattner
a66a97908c
simplify this code, make it work for ap ints
...
llvm-svn: 35561
2007-04-01 20:57:36 +00:00
Zhou Sheng
8b2b6b9e36
Avoid unnecessary APInt construction.
...
llvm-svn: 35555
2007-04-01 17:13:37 +00:00
Reid Spencer
88fb617695
For PR1297:
...
Support overloaded intrinsics bswap, ctpop, cttz, ctlz.
llvm-svn: 35547
2007-04-01 07:35:23 +00:00
Chris Lattner
aa4b06bdae
Fix InstCombine/2007-03-31-InfiniteLoop.ll
...
llvm-svn: 35536
2007-04-01 05:36:37 +00:00
Chris Lattner
579b1c63d5
Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.
...
llvm-svn: 35528
2007-03-31 04:06:36 +00:00
Zhou Sheng
967239685a
Delete dead code.
...
llvm-svn: 35525
2007-03-31 02:50:26 +00:00
Zhou Sheng
ebf4c32f0b
Use APInt operators to calculate the carry bits, remove this loop.
...
llvm-svn: 35524
2007-03-31 02:38:39 +00:00
Zhou Sheng
67bcf1cfb6
Make sure the use of ConstantInt::getZExtValue() for shift amount safe.
...
llvm-svn: 35510
2007-03-30 17:20:39 +00:00
Zhou Sheng
d667b5db0c
1. Make sure the use of ConstantInt::getZExtValue() for getting shift
...
amount is safe.
2. Use new method on ConstantInt instead of (? :) operator.
3. Use new method uge() on ConstantInt to simplify codes.
llvm-svn: 35505
2007-03-30 09:29:48 +00:00
Zhou Sheng
382723d8b4
Use APInt operation instead of ConstantExpr::getXX.
...
llvm-svn: 35503
2007-03-30 05:45:18 +00:00
Zhou Sheng
ac2b833c7a
1. Make more use of APInt::getHighBitsSet/getLowBitsSet.
...
2. Let APInt variable do the binary operation stuff instead of using
ConstantExpr::getXXX.
llvm-svn: 35450
2007-03-29 08:15:12 +00:00
Zhou Sheng
684c2133f2
Clean up some codes in InstCombiner::SimplifyDemandedBits().
...
llvm-svn: 35446
2007-03-29 04:45:55 +00:00
Zhou Sheng
067efd7806
Clean up codes in InstCombiner::SimplifyDemandedBits():
...
1. Line out nested call of APInt::zext/trunc.
2. Make more use of APInt::getHighBitsSet/getLowBitsSet.
3. Use APInt[] operator instead of expression like "APIntVal & SignBit".
llvm-svn: 35444
2007-03-29 02:26:30 +00:00
Zhou Sheng
74db84591c
1. Make the APInt variable do the binary operation stuff if possible
...
instead of using ConstantExpr::getXX.
2. Use constant reference to APInt if possible instead of expensive
APInt copy.
llvm-svn: 35443
2007-03-29 01:57:21 +00:00
Zhou Sheng
a098617383
Avoid unnecessary APInt construction.
...
llvm-svn: 35431
2007-03-28 17:38:21 +00:00
Zhou Sheng
8fecc8c3a0
1. Make more use of getLowBitsSet/getHighBitsSet.
...
2. Use APInt[] instead of "X & SignBit".
3. Clean up some codes.
4. Make the expression like "ShiftAmt = ShiftAmtC->getZExtValue()" safe.
llvm-svn: 35424
2007-03-28 15:02:20 +00:00