aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Also revert 108422, it's causing some test failures.Eric Christopher2010-07-161-19/+0
| | | | | | | Working on testcases for Owen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108494 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't merge uses when they are targetting fixup sites withDan Gohman2010-07-151-1/+20
| | | | | | | | | | | | | | different widths. In a use with a narrower fixup, formulae may be wider than the fixup, in which case the high bits aren't necessarily meaningful, so it isn't safe to reuse them for uses with wider fixups. This fixes PR7618, though the testcase is too large for a reasonable regression test, since it heavily dependes on hitting LSR's heuristics in a certain way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108455 91177308-0d34-0410-b5e6-96231b3b80d8
* Use dbgs() instead of errs() in a DEBUG.Dan Gohman2010-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108453 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r108429 to fix the clang self-host.Owen Anderson2010-07-152-19/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108436 91177308-0d34-0410-b5e6-96231b3b80d8
* Per Chris' suggestion, get rid of the select canonicalization and just addOwen Anderson2010-07-152-28/+19
| | | | | | | | | the corresponding or-icmp-and pattern. This has the added benefit of doing the matching earlier, and thus being less susceptible to being confused by earlier transforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108429 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded check, and correct style.Owen Anderson2010-07-151-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108427 91177308-0d34-0410-b5e6-96231b3b80d8
* Watch out for a constant offset cancelling out a base register, formingDan Gohman2010-07-151-2/+9
| | | | | | | | a zero. This situation arrises in Fortran code with induction variables that start at 1 instead of 0. This fixes PR7651. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108424 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r108378, with bugfixes, testcase, and improved comment formatting.Owen Anderson2010-07-152-0/+47
| | | | | | | This now passes LIT, nighty test, and llvm-gcc bootstrap on my machine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108422 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a full sentence.Nick Lewycky2010-07-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108418 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable aliases on all platforms.Nick Lewycky2010-07-151-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108417 91177308-0d34-0410-b5e6-96231b3b80d8
* make various clients of ReplaceAndSimplifyAllUses tolerate Chris Lattner2010-07-151-2/+3
| | | | | | | | | it *changing* the things it replaces, not just causing them to drop to null. There is no functionality change yet, but this is required for a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108414 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r108378; may be causing bootstrap failures.Eli Friedman2010-07-152-43/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108389 91177308-0d34-0410-b5e6-96231b3b80d8
* Add instcombine transforms to optimize tests of multiple bits of the same ↵Owen Anderson2010-07-142-0/+43
| | | | | | value into a single larger comparison. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108378 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend SimplifyCFG's common-destination folding heuristic to allow a singleOwen Anderson2010-07-141-5/+67
| | | | | | | | | | | "bonus" instruction to be speculatively executed. Add a heuristic to ensure we're not tripping up out-of-order execution by checking that this bonus instruction only uses values that were already guaranteed to be available. This allows us to eliminate the short circuit in (x&1)&&(x&2). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108351 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r108320, I see the failures now...Chris Lattner2010-07-141-8/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108322 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply benjamin's instcombine patch, I don't see anything wrong with it and ↵Chris Lattner2010-07-141-0/+8
| | | | | | can't repro any problems with a manual self-host. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108320 91177308-0d34-0410-b5e6-96231b3b80d8
* Grammar.Eric Christopher2010-07-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108252 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle the case of a tail recursion in which the tail call is followedDuncan Sands2010-07-131-13/+35
| | | | | | | | | | by a return that returns a constant, while elsewhere in the function another return instruction returns a different constant. This is a special case of accumulator recursion, so just generalize the existing logic a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108241 91177308-0d34-0410-b5e6-96231b3b80d8
* Nope, still breaks the release selfhost bots :(Benjamin Kramer2010-07-121-8/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108153 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply the "or" half of r108136, which seems to be less problematic.Benjamin Kramer2010-07-121-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108152 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-121-6/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108150 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r108141 again, sigh.Benjamin Kramer2010-07-121-17/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108148 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-121-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108147 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-121-6/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108146 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-121-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108145 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-121-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108144 91177308-0d34-0410-b5e6-96231b3b80d8
* cache results of operator*Gabor Greif2010-07-121-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108143 91177308-0d34-0410-b5e6-96231b3b80d8
* cache results of operator*Gabor Greif2010-07-121-21/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108142 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply 108136 with an ugly pasto fixed.Benjamin Kramer2010-07-121-0/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108141 91177308-0d34-0410-b5e6-96231b3b80d8
* Move optimization to avoid redundant matching.Benjamin Kramer2010-07-121-13/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108140 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r108136 until I figure out why it broke selfhost.Benjamin Kramer2010-07-121-17/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108139 91177308-0d34-0410-b5e6-96231b3b80d8
* cache dereferenced iteratorsGabor Greif2010-07-121-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108138 91177308-0d34-0410-b5e6-96231b3b80d8
* recommit r108131 (hich has been backed out in r108135) with a fixGabor Greif2010-07-121-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108137 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine: fold (x & y) | (~x & z) and (x & y) ^ (~x & z) into ((y ^ z) & ↵Benjamin Kramer2010-07-121-0/+17
| | | | | | | | | | | | | | | | | | x) ^ z which is one instruction shorter. (PR6773) before: %and = and i32 %y, %x %neg = xor i32 %x, -1 %and4 = and i32 %z, %neg %xor = xor i32 %and4, %and after: %xor1 = xor i32 %z, %y %and2 = and i32 %xor1, %x %xor = xor i32 %and2, %z git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108136 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r108131 (of TailDuplication.cpp) for now, it causes a buildbot failureGabor Greif2010-07-121-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108135 91177308-0d34-0410-b5e6-96231b3b80d8
* cache dereferenced iteratorsGabor Greif2010-07-121-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108134 91177308-0d34-0410-b5e6-96231b3b80d8
* cache dereferenced iteratorsGabor Greif2010-07-121-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108133 91177308-0d34-0410-b5e6-96231b3b80d8
* cache dereferenced iteratorsGabor Greif2010-07-121-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108132 91177308-0d34-0410-b5e6-96231b3b80d8
* cache dereferenced iteratorsGabor Greif2010-07-122-7/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108131 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert some tab stops into spaces.Duncan Sands2010-07-123-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
* make the prototypes for CreateMalloc and CreateFree more consistent. PatchChris Lattner2010-07-121-2/+2
| | | | | | | by Hans Vandierendonck from PR7605 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108116 91177308-0d34-0410-b5e6-96231b3b80d8
* if jump threading is able to infer interesting values on bothChris Lattner2010-07-121-2/+13
| | | | | | | | | the LHS and RHS of an and/or instruction, don't multiply add known predecessor values. This fixes the crash on testcase from PR7498 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108114 91177308-0d34-0410-b5e6-96231b3b80d8
* The accumulator tail recursion transform claims to work for any associativeDuncan Sands2010-07-101-14/+14
| | | | | | | | | | | | | | | | | operation, but the way it's implemented requires the operation to also be commutative. So add a check for commutativity (and tweak the corresponding comments). This makes no difference in practice since every associative LLVM instruction is also commutative! Here's an example to show the need for commutativity: the accum_recursion.ll testcase calculates the factorial function. Before the transformation the result of a call is ((((1*1)*2)*3)...)*x while afterwards it is (((1*x)*(x-1))...*2)*1 which clearly requires both associativity and commutativity of * to be equal to the original. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108056 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-091-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107990 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-091-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107984 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-091-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107983 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-091-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107981 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-091-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107976 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-091-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107975 91177308-0d34-0410-b5e6-96231b3b80d8
* cache result of operator*Gabor Greif2010-07-091-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107974 91177308-0d34-0410-b5e6-96231b3b80d8