summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Reinstate this optimization, but without the miscompile. Thanks to Bill forNick Lewycky2008-08-061-0/+15
| | | | | | tracking down that this was breaking llvm-gcc bootstrap on Linux. llvm-svn: 54394
* Pass the computed iteration count value to RewriteLoopExitValuesDan Gohman2008-08-051-4/+4
| | | | | | instead of having it call getIterationCount again. llvm-svn: 54380
* Revert r53282. This was causing a miscompile on Linux. Also, the transformationBill Wendling2008-08-051-16/+0
| | | | | | looks bogus. Please see PR2629 for details on why this is breaking things. llvm-svn: 54372
* Fix comment typos.Duncan Sands2008-08-011-1/+1
| | | | llvm-svn: 54266
* Add vector shifts to the IR, patch by Eli Friedman.Nate Begeman2008-07-291-1/+2
| | | | | | CodeGen & Clang work coming next. llvm-svn: 54161
* Add -unroll-allow-partial command line option that enabled the loop unroller toMatthijs Kooijman2008-07-291-4/+26
| | | | | | | | partially unroll a loop when fully unrolling would not fit under the threshold. Patch by Mikael Lepistö. llvm-svn: 54160
* Don't remove volatile loads. Thanks to Duncan for noticing this one.Owen Anderson2008-07-281-1/+1
| | | | llvm-svn: 54144
* Add support for eliminating stores that store the same value that was just ↵Owen Anderson2008-07-281-2/+35
| | | | | | | | loaded. This fixes PR2599. llvm-svn: 54133
* Rename SDOperand to SDValue.Dan Gohman2008-07-271-1/+1
| | | | llvm-svn: 54128
* Put the LICM of constant GlobalVariables, introduced in r53945, under aDan Gohman2008-07-241-1/+11
| | | | | | | command-line option, and disable it by default. It introduced performance regressions because CodeGen is currently not able to remat such loads. llvm-svn: 53997
* "Allow LICM to sink or lift loads from constant memory. Also add a testChris Lattner2008-07-231-0/+5
| | | | | | | | | | | case for this. This allows instructions like loads from global variables declared to be constant to be moved out of loops." Patch by Stefanus Du Toit! llvm-svn: 53945
* Enable first-class aggregates support.Dan Gohman2008-07-234-87/+7
| | | | | | | | | | | | Remove the GetResultInst instruction. It is still accepted in LLVM assembly and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove support for return instructions with multiple values. These are auto-upgraded to use InsertValueInst instructions. The IRBuilder still accepts multiple-value returns, and auto-upgrades them to InsertValueInst instructions. llvm-svn: 53941
* Fix a bug in LSR's dead-PHI cleanup. If a PHI has a def-use chain thatDan Gohman2008-07-211-0/+5
| | | | | | | | | leads into a cycle involving a different PHI, LSR got stuck running around that cycle looking for the original PHI. To avoid this, keep track of visited PHIs and stop searching if we see one more than once. This fixes PR2570. llvm-svn: 53879
* Supress a gcc-4.3 warning.Duncan Sands2008-07-181-1/+1
| | | | llvm-svn: 53771
* Make PRE actually handle critical edges (by splitting them). Confirmed that ↵Owen Anderson2008-07-181-3/+6
| | | | | | bootstrap passes with this change. llvm-svn: 53762
* Enable PRE. My last batch of changes fixed the miscompile.Owen Anderson2008-07-171-1/+1
| | | | llvm-svn: 53730
* Fix PR2553Chris Lattner2008-07-171-1/+2
| | | | llvm-svn: 53715
* Factor MergeBlockIntoPredecessor out into BasicBlockUtils.Owen Anderson2008-07-171-51/+4
| | | | llvm-svn: 53705
* There's no need to iterate block merging and PRE. In fact, iterating the latterOwen Anderson2008-07-161-14/+12
| | | | | | could cause problems for memdep when it breaks critical edges. llvm-svn: 53691
* Redo InstCombiner::visitExtractValueInst. Instead of using the (complicate)Matthijs Kooijman2008-07-161-5/+80
| | | | | | | FindInsertedValue, it now performs a number of simple transformations that should result in the same effect when applied iteratively. llvm-svn: 53673
* Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store.Evan Cheng2008-07-161-1/+0
| | | | llvm-svn: 53666
* Revert this, as it seems to still be broken.Owen Anderson2008-07-151-1/+1
| | | | llvm-svn: 53627
* Enable local PRE by default.Owen Anderson2008-07-151-1/+1
| | | | llvm-svn: 53616
* Have GVN do a pre-pass over the CFG that folds away unconditional branches ↵Owen Anderson2008-07-151-2/+63
| | | | | | where possible. This allows local PRE to be more aggressive. llvm-svn: 53615
* Fix uninitialized use of the Changed variable.Dan Gohman2008-07-141-0/+2
| | | | llvm-svn: 53564
* Fix PR2506 by being a bit more careful about reverse fact propagation whenChris Lattner2008-07-141-64/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | disproving a condition. This actually compiles the existing testcase (udiv_select_to_select_shift) to: define i64 @test(i64 %X, i1 %Cond) { entry: %divisor1.t = lshr i64 %X, 3 ; <i64> [#uses=1] %quotient2 = lshr i64 %X, 3 ; <i64> [#uses=1] %sum = add i64 %divisor1.t, %quotient2 ; <i64> [#uses=1] ret i64 %sum } instead of: define i64 @test(i64 %X, i1 %Cond) { entry: %quotient1.v = select i1 %Cond, i64 3, i64 4 ; <i64> [#uses=1] %quotient1 = lshr i64 %X, %quotient1.v ; <i64> [#uses=1] %quotient2 = lshr i64 %X, 3 ; <i64> [#uses=1] %sum = add i64 %quotient1, %quotient2 ; <i64> [#uses=1] ret i64 %sum } llvm-svn: 53534
* Enhance analysis of srem.Nick Lewycky2008-07-121-15/+3
| | | | | | | Remove dead code analyzing urem. 'urem' of power-of-2 is canonicalized to an 'and' instruction. llvm-svn: 53506
* Don't call lookupNumber more than we have to.Owen Anderson2008-07-111-5/+8
| | | | llvm-svn: 53470
* Document 'mask' in this calculation.Nick Lewycky2008-07-111-0/+1
| | | | llvm-svn: 53454
* Remove misleading constant from comment.Nick Lewycky2008-07-111-1/+1
| | | | llvm-svn: 53452
* Add another optimization from PR2330. Also catch some missing cases that areNick Lewycky2008-07-111-0/+39
| | | | | | similar. llvm-svn: 53451
* a missed optimization that Eli spottedChris Lattner2008-07-111-1/+1
| | | | llvm-svn: 53449
* another bug in the same line.Chris Lattner2008-07-111-1/+1
| | | | llvm-svn: 53448
* fix a bug spotted by Eli's eagle eyesChris Lattner2008-07-111-2/+2
| | | | llvm-svn: 53447
* simplify and merge a bunch of code. Instead of comparing againstChris Lattner2008-07-111-81/+52
| | | | | | | | the min/max values for an integer type, compare against the min/max values we can prove contain the input. This might be a tighter bound, so this is general goodness. llvm-svn: 53446
* fold away (x <= cst) earlier, allowing us to not have to Chris Lattner2008-07-111-103/+68
| | | | | | handle them in some code. llvm-svn: 53445
* Fix folding of icmp's of i1 where the comparison is signed. The codeChris Lattner2008-07-111-10/+22
| | | | | | | was using the algorithm for folding unsigned comparisons which is completely wrong. This has been broken since the signless types change. llvm-svn: 53444
* Fix a bogus optimization: folding (slt (zext i1 A to i32), 1) -> (slt i1 A, ↵Chris Lattner2008-07-111-16/+15
| | | | | | | | | | | true) This cause a regression in InstCombine/JavaCompare, which was doing the right thing on accident. To handle the missed case, generalize the comparisons based on masked bits a little bit to handle comparisons against the max value. For example, we can now xform (slt i32 (and X, 4), 4) -> (setne i32 (and X, 4), 4) llvm-svn: 53443
* Fix overzealous optimization. Thanks to Duncan Sands for pointing out my error!Nick Lewycky2008-07-101-4/+9
| | | | llvm-svn: 53393
* Simplify, suggested by Chris Lattner.Nick Lewycky2008-07-091-1/+1
| | | | llvm-svn: 53283
* Fold (a < 8) && (b < 8) into (a|b) < 8 for unsigned less or greater than.Nick Lewycky2008-07-091-0/+16
| | | | llvm-svn: 53282
* Fold ((1 << a) & 1) to (a == 0).Nick Lewycky2008-07-091-0/+12
| | | | llvm-svn: 53276
* Reduce x - y to -y when we know the 'x' part will get masked off anyways.Nick Lewycky2008-07-091-1/+12
| | | | llvm-svn: 53271
* If loop induction variable's start value is less then its exit value then do ↵Devang Patel2008-07-091-0/+13
| | | | | | not split the loop. llvm-svn: 53265
* Fix PR2496, a really nasty bug which involved sinking volatile loads Chris Lattner2008-07-081-3/+11
| | | | | | | | | into phis. This is actually the same bug as PR2262 / 2008-04-29-VolatileLoadDontMerge.ll, but I missed checking the first predecessor for multiple successors. Testcase here: InstCombine/2008-07-08-VolatileLoadMerge.ll llvm-svn: 53240
* Fix two serious LSR bugs.Evan Cheng2008-07-071-37/+37
| | | | | | | 1. LSR runOnLoop is always returning false regardless if any transformation is made. 2. AddUsersIfInteresting can create new instructions that are added to DeadInsts. But there is a later early exit which prevents them from being freed. llvm-svn: 53193
* Make DenseMap's insert return a pair, to more closely resemble std::map.Dan Gohman2008-07-071-1/+1
| | | | llvm-svn: 53177
* Fix missed optimization opportunity when analyzing cast of mul and select.Nick Lewycky2008-07-051-9/+14
| | | | llvm-svn: 53151
* Use information already present in the ValueTable to fast-fail when we know ↵Owen Anderson2008-07-031-2/+11
| | | | | | there won't be a value number match. This speeds up GVN on a case where there are very few redundancies by ~25%. llvm-svn: 53108
* Do not try to update dominator info while manipulating CFG. This code does ↵Devang Patel2008-07-031-281/+19
| | | | | | | | not handle all cases and keeps invalid dom info around some cases, which misleads other passes down stream. Right now, dom info is recaluclated in the end if the loop is switched. llvm-svn: 53106
OpenPOWER on IntegriCloud