aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Fix a gcc 4.2 warning.Chris Lattner2006-11-151-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31751 91177308-0d34-0410-b5e6-96231b3b80d8
* implement InstCombine/shift-simplify.ll by transforming:Chris Lattner2006-11-141-3/+46
| | | | | | | | | (X >> Z) op (Y >> Z) -> (X op Y) >> Z for all shifts and all ops={and/or/xor}. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31729 91177308-0d34-0410-b5e6-96231b3b80d8
* implement InstCombine/and-compare.ll:test1. This compiles:Chris Lattner2006-11-141-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | typedef struct { unsigned prefix : 4; unsigned code : 4; unsigned unsigned_p : 4; } tree_common; int foo(tree_common *a, tree_common *b) { return a->code == b->code; } into: _foo: movl 4(%esp), %eax movl 8(%esp), %ecx movl (%eax), %eax xorl (%ecx), %eax # TRUNCATE movb %al, %al shrb $4, %al testb %al, %al sete %al movzbl %al, %eax ret instead of: _foo: movl 8(%esp), %eax movb (%eax), %al shrb $4, %al movl 4(%esp), %ecx movb (%ecx), %cl shrb $4, %cl cmpb %al, %cl sete %al movzbl %al, %eax ret saving one cycle by eliminating a shift. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31727 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix InstCombine/2006-11-10-ashr-miscompile.ll a miscompilation introducedChris Lattner2006-11-101-3/+3
| | | | | | | by the shr -> [al]shr patch. This was reduced from 176.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31653 91177308-0d34-0410-b5e6-96231b3b80d8
* second patch to fix PR992/993.Chris Lattner2006-11-091-4/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31610 91177308-0d34-0410-b5e6-96231b3b80d8
* Minimal patch to fix PR992/PR993Chris Lattner2006-11-091-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31608 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ShrinkDemandedConstant how to handle X+C. This implements:Chris Lattner2006-11-091-1/+100
| | | | | | | add.ll:test33, add.ll:test34, shift-sra.ll:test2 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31586 91177308-0d34-0410-b5e6-96231b3b80d8
* reenable factoring of GEP expressions, being more precise about theChris Lattner2006-11-081-5/+10
| | | | | | | case that it bad to do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31563 91177308-0d34-0410-b5e6-96231b3b80d8
* make this code more efficient by not creating a phi node we are just going toChris Lattner2006-11-081-36/+33
| | | | | | | delete in the first place. This also makes it simpler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31562 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant <cmath>.Jim Laskey2006-11-081-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31561 91177308-0d34-0410-b5e6-96231b3b80d8
* disable this factoring optzn for GEPs for now, this severely pessimizes someChris Lattner2006-11-081-1/+1
| | | | | | | loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31560 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-11-085-215/+194
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8
* scalarrepl should not split the two elements of the vsiidx array:Chris Lattner2006-11-071-3/+7
| | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31524 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak VC++ build.Jeff Cohen2006-11-052-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31464 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove commented line from earlier debugging.Nick Lewycky2006-11-051-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31460 91177308-0d34-0410-b5e6-96231b3b80d8
* The wrong parameter was being tested to deturmine i32 vs i64Andrew Lenharth2006-11-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31431 91177308-0d34-0410-b5e6-96231b3b80d8
* remove dead codeChris Lattner2006-11-031-13/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31398 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR786:Reid Spencer2006-11-0222-47/+22
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-11-023-119/+134
| | | | | | | Replace the REM instruction with UREM, SREM and FREM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31369 91177308-0d34-0410-b5e6-96231b3b80d8
* There can be more than one PHINode at the start of the block.Devang Patel2006-11-011-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31362 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle PHINode with only one incoming value.Devang Patel2006-11-011-5/+9
| | | | | | | This fixes http://llvm.org/bugs/show_bug.cgi?id=979 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31358 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll and McGill/chompChris Lattner2006-11-011-8/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31352 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor gep instructions through phi nodes.Chris Lattner2006-11-011-10/+39
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31346 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn a phi of many loads into a phi of the address and a single load of theChris Lattner2006-11-011-41/+30
| | | | | | | | result. This can significantly shrink code and exposes identities more aggressively. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31344 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in the previous patchChris Lattner2006-11-011-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31342 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold things like "phi [add (a,b), add(c,d)]" into two phi's and one add.Chris Lattner2006-11-011-3/+57
| | | | | | | This triggers thousands of times on multisource. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31341 91177308-0d34-0410-b5e6-96231b3b80d8
* generalize the fix for PR977 to also fixChris Lattner2006-10-311-28/+26
| | | | | | | Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31317 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR977 and Transforms/LCSSA/2006-10-31-UnreachableBlock.llChris Lattner2006-10-311-1/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31315 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SimplifyCFG/2006-10-29-InvokeCrash.ll, a crash compiling QT.Chris Lattner2006-10-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31284 91177308-0d34-0410-b5e6-96231b3b80d8
* add option to isCriticalEdgeChris Lattner2006-10-281-3/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31258 91177308-0d34-0410-b5e6-96231b3b80d8
* break edges more intelligentlyChris Lattner2006-10-281-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31257 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose a smarter way to break critical edges.Chris Lattner2006-10-281-5/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31256 91177308-0d34-0410-b5e6-96231b3b80d8
* SplitCriticalEdge checks to see if an edge is critical, don't check twiceChris Lattner2006-10-281-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31255 91177308-0d34-0410-b5e6-96231b3b80d8
* prepare for a change I'm about to makeChris Lattner2006-10-281-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31248 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code a bit by changing instances of:Reid Spencer2006-10-261-47/+27
| | | | | | | | | InsertNewInstBefore(new CastInst(Val, ValTy, Val->GetName()), I) into: InsertCastBefore(Val, ValTy, I) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31204 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-10-264-135/+256
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 2006-10-25-AddSetCC. A relational operator (like setlt) can neverNick Lewycky2006-10-261-27/+46
| | | | | | | produce an EQ property. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31193 91177308-0d34-0410-b5e6-96231b3b80d8
* Resurrect r1.25.Nick Lewycky2006-10-251-117/+154
| | | | | | | Fix and comment the "or", "and" and "xor" transformations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31189 91177308-0d34-0410-b5e6-96231b3b80d8
* hide symbols properlyChris Lattner2006-10-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31184 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.llChris Lattner2006-10-241-5/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31151 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert back to r1.21, which was the last revision of predsimplify thatChris Lattner2006-10-241-134/+109
| | | | | | | passes llvm-gcc bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31146 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle fallout from the recent branch-on-undef changes. This fixesChris Lattner2006-10-231-1/+24
| | | | | | | Prolangs-C/agrep and SCCP/2006-10-23-IPSCCP-Crash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31132 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the Backwards operation. Resolving now works at the time when aNick Lewycky2006-10-231-90/+102
| | | | | | | | property is added by running through the list of uses of the value and adding resolved properties to the property set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31126 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix similar missing optimization opportunity in XOR.Nick Lewycky2006-10-221-13/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31123 91177308-0d34-0410-b5e6-96231b3b80d8
* Whoops! Add missing NULL check.Nick Lewycky2006-10-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31121 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle "if ((x|y) != 0)" for ints like we do for bools. Fixes missedNick Lewycky2006-10-221-10/+13
| | | | | | | optimization opportunity pointed out by Chris Lattner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31118 91177308-0d34-0410-b5e6-96231b3b80d8
* AllocaInst can't return a null pointer. Fixes missed optimizationNick Lewycky2006-10-221-0/+6
| | | | | | | opportunity pointed out by Andrew Lewycky. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31115 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a workaround for PR962, disabling the more aggressive form of thisChris Lattner2006-10-221-0/+8
| | | | | | | transformation. This speeds up a C++ app 2.25x. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31113 91177308-0d34-0410-b5e6-96231b3b80d8
* 3 Changes:Chris Lattner2006-10-221-24/+35
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31106 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-extract should remove module-level asmChris Lattner2006-10-201-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31086 91177308-0d34-0410-b5e6-96231b3b80d8