Chris Lattner
6e2c15c158
Teach ShrinkDemandedConstant how to handle X+C. This implements:
...
add.ll:test33, add.ll:test34, shift-sra.ll:test2
llvm-svn: 31586
2006-11-09 05:12:27 +00:00
Chris Lattner
4f218d56f5
reenable factoring of GEP expressions, being more precise about the
...
case that it bad to do.
llvm-svn: 31563
2006-11-08 19:42:28 +00:00
Chris Lattner
cd62f11227
make this code more efficient by not creating a phi node we are just going to
...
delete in the first place. This also makes it simpler.
llvm-svn: 31562
2006-11-08 19:29:23 +00:00
Jim Laskey
61feeb90f9
Remove redundant <cmath>.
...
llvm-svn: 31561
2006-11-08 19:16:44 +00:00
Chris Lattner
a3acfca920
disable this factoring optzn for GEPs for now, this severely pessimizes some
...
loops.
llvm-svn: 31560
2006-11-08 18:49:31 +00:00
Reid Spencer
fdff938a7e
For PR950:
...
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.
llvm-svn: 31542
2006-11-08 06:47:33 +00:00
Chris Lattner
4967f6ddea
scalarrepl should not split the two elements of the vsiidx array:
...
int func(vFloat v0, vFloat v1) {
int ii;
vSInt32 vsiidx[2];
vsiidx[0] = _mm_cvttps_epi32(v0);
vsiidx[1] = _mm_cvttps_epi32(v1);
ii = ((int *) vsiidx)[4];
return ii;
}
This fixes Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll
llvm-svn: 31524
2006-11-07 22:42:47 +00:00
Jeff Cohen
7d6f3db3e2
Unbreak VC++ build.
...
llvm-svn: 31464
2006-11-05 19:31:28 +00:00
Nick Lewycky
67bad5adbc
Remove commented line from earlier debugging.
...
llvm-svn: 31460
2006-11-05 14:19:40 +00:00
Andrew Lenharth
0ebb0b03e6
The wrong parameter was being tested to deturmine i32 vs i64
...
llvm-svn: 31431
2006-11-03 22:45:50 +00:00
Chris Lattner
62e2cad6b8
remove dead code
...
llvm-svn: 31398
2006-11-03 01:34:58 +00:00
Reid Spencer
de46e48420
For PR786:
...
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.
llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Reid Spencer
7eb55b395f
For PR950:
...
Replace the REM instruction with UREM, SREM and FREM.
llvm-svn: 31369
2006-11-02 01:53:59 +00:00
Devang Patel
2cb4f83b38
There can be more than one PHINode at the start of the block.
...
llvm-svn: 31362
2006-11-01 23:04:45 +00:00
Devang Patel
44519a8feb
Handle PHINode with only one incoming value.
...
This fixes http://llvm.org/bugs/show_bug.cgi?id=979
llvm-svn: 31358
2006-11-01 22:26:43 +00:00
Chris Lattner
5a0bd61c64
Fix GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll and McGill/chomp
...
llvm-svn: 31352
2006-11-01 18:03:33 +00:00
Chris Lattner
eebea43b48
Factor gep instructions through phi nodes.
...
llvm-svn: 31346
2006-11-01 07:43:41 +00:00
Chris Lattner
14f82c7dcd
Turn a phi of many loads into a phi of the address and a single load of the
...
result. This can significantly shrink code and exposes identities more
aggressively.
llvm-svn: 31344
2006-11-01 07:13:54 +00:00
Chris Lattner
dc826fc068
Fix a bug in the previous patch
...
llvm-svn: 31342
2006-11-01 04:55:47 +00:00
Chris Lattner
cadac0c5c3
Fold things like "phi [add (a,b), add(c,d)]" into two phi's and one add.
...
This triggers thousands of times on multisource.
llvm-svn: 31341
2006-11-01 04:51:18 +00:00
Chris Lattner
984d6e1669
generalize the fix for PR977 to also fix
...
Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll
llvm-svn: 31317
2006-10-31 18:56:48 +00:00
Chris Lattner
eb68f080ef
Fix PR977 and Transforms/LCSSA/2006-10-31-UnreachableBlock.ll
...
llvm-svn: 31315
2006-10-31 17:52:18 +00:00
Chris Lattner
fc519cd2d1
Fix SimplifyCFG/2006-10-29-InvokeCrash.ll, a crash compiling QT.
...
llvm-svn: 31284
2006-10-29 21:21:20 +00:00
Chris Lattner
3e763f5708
add option to isCriticalEdge
...
llvm-svn: 31258
2006-10-28 06:58:17 +00:00
Chris Lattner
a6eb7e0803
break edges more intelligently
...
llvm-svn: 31257
2006-10-28 06:45:33 +00:00
Chris Lattner
80ea207bfa
Expose a smarter way to break critical edges.
...
llvm-svn: 31256
2006-10-28 06:44:56 +00:00
Chris Lattner
400ac04e64
SplitCriticalEdge checks to see if an edge is critical, don't check twice
...
llvm-svn: 31255
2006-10-28 06:38:14 +00:00
Chris Lattner
5191c65485
prepare for a change I'm about to make
...
llvm-svn: 31248
2006-10-28 00:59:20 +00:00
Reid Spencer
00c482b7a2
Simplify code a bit by changing instances of:
...
InsertNewInstBefore(new CastInst(Val, ValTy, Val->GetName()), I)
into:
InsertCastBefore(Val, ValTy, I)
llvm-svn: 31204
2006-10-26 19:19:06 +00:00
Reid Spencer
7e80b0b31e
For PR950:
...
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.
llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Nick Lewycky
5b979ae531
Fix 2006-10-25-AddSetCC. A relational operator (like setlt) can never
...
produce an EQ property.
llvm-svn: 31193
2006-10-26 02:35:18 +00:00
Nick Lewycky
9d17c82a26
Resurrect r1.25.
...
Fix and comment the "or", "and" and "xor" transformations.
llvm-svn: 31189
2006-10-25 23:48:24 +00:00
Chris Lattner
53f53db919
hide symbols properly
...
llvm-svn: 31184
2006-10-25 21:14:31 +00:00
Chris Lattner
ebb1ad4382
Fix Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll
...
llvm-svn: 31151
2006-10-24 06:26:32 +00:00
Chris Lattner
dc7b9beb20
Revert back to r1.21, which was the last revision of predsimplify that
...
passes llvm-gcc bootstrap.
llvm-svn: 31146
2006-10-24 00:36:21 +00:00
Chris Lattner
fe7b6ef346
Handle fallout from the recent branch-on-undef changes. This fixes
...
Prolangs-C/agrep and SCCP/2006-10-23-IPSCCP-Crash.ll
llvm-svn: 31132
2006-10-23 18:57:02 +00:00
Nick Lewycky
53b4158448
Remove the Backwards operation. Resolving now works at the time when a
...
property is added by running through the list of uses of the value and
adding resolved properties to the property set.
llvm-svn: 31126
2006-10-23 01:56:02 +00:00
Nick Lewycky
6f5c30fcec
Fix similar missing optimization opportunity in XOR.
...
llvm-svn: 31123
2006-10-22 22:22:58 +00:00
Nick Lewycky
af2b0571d0
Whoops! Add missing NULL check.
...
llvm-svn: 31121
2006-10-22 21:38:24 +00:00
Nick Lewycky
2c734f3fc1
Handle "if ((x|y) != 0)" for ints like we do for bools. Fixes missed
...
optimization opportunity pointed out by Chris Lattner.
llvm-svn: 31118
2006-10-22 21:36:41 +00:00
Nick Lewycky
f345008339
AllocaInst can't return a null pointer. Fixes missed optimization
...
opportunity pointed out by Andrew Lewycky.
llvm-svn: 31115
2006-10-22 19:53:27 +00:00
Chris Lattner
250eff20da
Add a workaround for PR962, disabling the more aggressive form of this
...
transformation. This speeds up a C++ app 2.25x.
llvm-svn: 31113
2006-10-22 18:42:26 +00:00
Chris Lattner
af17096dcf
3 Changes:
...
1. Better document what is going on here.
2. Only hack on one branch per iteration, making the results less conservative.
3. Handle the problematic case by marking edges executable instead of by
playing with value lattice states. This is far less pessimistic, and fixes
SCCP/ipsccp-gvar.ll.
llvm-svn: 31106
2006-10-22 05:59:17 +00:00
Chris Lattner
af1222c1a7
llvm-extract should remove module-level asm
...
llvm-svn: 31086
2006-10-20 21:35:41 +00:00
Chris Lattner
319c86fd38
Fix an ugly problem in SCCP. This fixes Benchmarks/Misc-C++/mandel-text.cpp
...
llvm-svn: 31073
2006-10-20 20:19:08 +00:00
Chris Lattner
5dee3b2526
Fix miscompilation of MallocBench/espresso which code review pointed out
...
but apparently didn't make it into the final patch.
llvm-svn: 31070
2006-10-20 18:20:21 +00:00
Reid Spencer
e0fc4dfc22
For PR950:
...
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.
llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Devang Patel
5d417e35bc
While creating mask, use 1ULL instead of 1.
...
llvm-svn: 31062
2006-10-20 01:16:56 +00:00
Chris Lattner
b8b11599dd
Fix SimplifyCFG/2006-10-19-UncondDiv.ll by disabling a bad xform.
...
llvm-svn: 31061
2006-10-20 00:42:07 +00:00
Devang Patel
5d6df959e3
It is OK to remove extra cast if operation is EQ/NE even though source
...
and destination sign may not match but other conditions are met.
llvm-svn: 31056
2006-10-19 20:59:13 +00:00