summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
* typo + pastoAndrew Trick2011-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140769 91177308-0d34-0410-b5e6-96231b3b80d8
* LSR: rewrite inner loops only.Andrew Trick2011-09-29
| | | | | | | | | Rewriting the entire loop nest now requires -enable-lsr-nested. See PR11035 for some performance data. A few unit tests specifically test nested LSR, and are now under a flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140762 91177308-0d34-0410-b5e6-96231b3b80d8
* indvars should hoist [sz]ext because licm is not rerun.Andrew Trick2011-09-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140670 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-27
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140634 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the landing pad basic block with the correct function. Also merge theBill Wendling2011-09-27
| | | | | | | | split landingpad instructions into a PHI node. PR11016 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140592 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable LSR retry by default.Andrew Trick2011-09-27
| | | | | | | | Disabling aggressive LSR saves compilation time, and with the new indvars behavior usually improves performance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140590 91177308-0d34-0410-b5e6-96231b3b80d8
* LSR, one of the new Cost::isLoser() checks did not get merged in the ↵Andrew Trick2011-09-26
| | | | | | previous checkin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140583 91177308-0d34-0410-b5e6-96231b3b80d8
* LSR cost metric minor fix and verification.Andrew Trick2011-09-26
| | | | | | | | | The minor bug heuristic was noticed by inspection. I added the isLoser/isValid helpers because they will become more important with subsequent checkins. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140580 91177308-0d34-0410-b5e6-96231b3b80d8
* LSR minor bug fix in RateRegister.Andrew Trick2011-09-23
| | | | | | | | No test case. Noticed by inspection and I doubt it ever affects the outcome of the overall heuristic, let alone final codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140431 91177308-0d34-0410-b5e6-96231b3b80d8
* PR10987: add a missed safety check to isSafePHIToSpeculate in scalarrepl.Eli Friedman2011-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140327 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure IPSCCP never marks a tracked call as overdefined in ↵Eli Friedman2011-09-20
| | | | | | | | | | SCCPSolver::ResolvedUndefsIn. If we do, we can end up in a situation where a function is resolved to return a constant, but the caller is marked overdefined, which confuses the code later. <rdar://problem/9956541> (again). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140210 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax this condition.Bill Wendling2011-09-20
| | | | | | | | Some passes require breaking critical edges before they're called. Don't segfault because of that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140196 91177308-0d34-0410-b5e6-96231b3b80d8
* Place the check for an exit landing pad where it will be run on both code ↵Bill Wendling2011-09-20
| | | | | | paths through the if-then-else. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140195 91177308-0d34-0410-b5e6-96231b3b80d8
* Omit extracting a loop if one of the exits is a landing pad.Bill Wendling2011-09-20
| | | | | | | | | | The landing pad must accompany the invoke when it's extracted. However, if it does, then the loop isn't properly extracted. I.e., the resulting extraction has a loop in it. The extracted function is then extracted, etc. resulting in an infinite loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140193 91177308-0d34-0410-b5e6-96231b3b80d8
* Check the terminator, not the basic block.Bill Wendling2011-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140176 91177308-0d34-0410-b5e6-96231b3b80d8
* When extracting a basic block that ends in an 'invoke' instruction, we need toBill Wendling2011-09-20
| | | | | | | | | | | extract its associated landing pad block as well. However, that landing pad block may have more than one predecessor. So split the landing pad block so that individual landing pads have only one predecessor. This type of transformation may produce a false positive with bugpoint. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140173 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ArrayRef instead of an explicit 'const std::vector &'.Bill Wendling2011-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140172 91177308-0d34-0410-b5e6-96231b3b80d8
* If simple ownership works then friendship is not required.Devang Patel2011-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140169 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ArrayRef instead of 'const std::vector' to pass around the list of basic ↵Bill Wendling2011-09-20
| | | | | | blocks to extract. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140168 91177308-0d34-0410-b5e6-96231b3b80d8
* Update GCOVLines to provide interfaces to write line table and calculate ↵Devang Patel2011-09-20
| | | | | | complete length. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140167 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comments.Bill Wendling2011-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140164 91177308-0d34-0410-b5e6-96231b3b80d8
* Update comment.Devang Patel2011-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140156 91177308-0d34-0410-b5e6-96231b3b80d8
* Use StringRef instead of std::string.Devang Patel2011-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140154 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate unnecessary copy of FileName from GCOVLines. Devang Patel2011-09-20
| | | | | | | GCOVLines is always accessed through a StringMap where the key is FileName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140151 91177308-0d34-0410-b5e6-96231b3b80d8
* There is no need to write a local utility routine to find subprogram info if ↵Devang Patel2011-09-20
| | | | | | the utility routine is already available in DebugInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140145 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r140083 and r140084 until buildbots can be fixed.Bill Wendling2011-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140094 91177308-0d34-0410-b5e6-96231b3b80d8
* If we are extracting a basic block that ends in an invoke call, we must alsoBill Wendling2011-09-19
| | | | | | | | | | | extract the landing pad block. Otherwise, there will be a situation where the invoke's unwind edge lands on a non-landing pad. We also forbid the user from extracting the landing pad block by itself. Again, this is not a valid transformation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140083 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an infinite loop where a transform in InstCombiner::visitAnd claims a ↵Eli Friedman2011-09-19
| | | | | | | | | | construct is changed when it is not. (See included testcase.) Patch by Xiaoyi Guo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140072 91177308-0d34-0410-b5e6-96231b3b80d8
* [indvars] Fix PR10946: SCEV cannot handle Vector IVs.Andrew Trick2011-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140026 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r139759. Disable IV rewriting by default. See PR10916.Andrew Trick2011-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139842 91177308-0d34-0410-b5e6-96231b3b80d8
* Make demanded-elt simplification for shufflevector slightly stronger. ↵Eli Friedman2011-09-15
| | | | | | Spotted by inspection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139768 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't mark objc_retainBlock as nounwind. It calls user copy constructorsDan Gohman2011-09-14
| | | | | | | which could theoretically throw. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139710 91177308-0d34-0410-b5e6-96231b3b80d8
* objc_retainBlock is not NoModRef because it can update forwarding pointersDan Gohman2011-09-14
| | | | | | | in memory relevant to the optimizer. rdar://10050579. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139708 91177308-0d34-0410-b5e6-96231b3b80d8
* [indvars] Revert r139579 until 401.bzip -arch i386 miscompilation is fixed. ↵Andrew Trick2011-09-13
| | | | | | PR10920. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139583 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable IV rewriting by default. See PR10916.Andrew Trick2011-09-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139579 91177308-0d34-0410-b5e6-96231b3b80d8
* [indvars] Fix bugs in floating point IV range checks noticed by inspection.Andrew Trick2011-09-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139574 91177308-0d34-0410-b5e6-96231b3b80d8
* Add comment to clarify the behavior of a helper in DSE.Eli Friedman2011-09-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139571 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct grammar.Eli Friedman2011-09-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139565 91177308-0d34-0410-b5e6-96231b3b80d8
* Change a bunch of isVolatile() checks to check for atomic load/store as well.Eli Friedman2011-09-12
| | | | | | | | | | No tests; these changes aren't really interesting in the sense that the logic is the same for volatile and atomic. I believe this completes all of the changes necessary for the optimizer to handle loads and stores correctly. I'm going to try and come up with some additional testing, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139533 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename -disable-iv-rewrite to -enable-iv-rewrite=false in preparation for ↵Andrew Trick2011-09-12
| | | | | | default change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139517 91177308-0d34-0410-b5e6-96231b3b80d8
* [disable-iv-rewrite] Allow WidenIV to handle NSW/NUW operationsAndrew Trick2011-09-10
| | | | | | | | | | | | | better. Don't immediately give up when an add operation can't be trivially sign/zero-extended within a loop. If it has NSW/NUW flags, generate a new expression with sign extended (non-recurrent) operand. As before, if SCEV says that all sign extends are loop invariant, then we can widen the operation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139453 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment formatting.Andrew Trick2011-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139375 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -verify-indvars for imperfect SCEV trip count verification after indvars.Andrew Trick2011-09-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139169 91177308-0d34-0410-b5e6-96231b3b80d8
* Use IRBuilder.Devang Patel2011-09-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139156 91177308-0d34-0410-b5e6-96231b3b80d8
* Try again at r138809 (make DSE more aggressive in removing dead stores at ↵Owen Anderson2011-09-06
| | | | | | the end of a function), now with less deleting stores before memcpy's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139150 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the init.trampoline intrinsic, which currently combines GCC'sDuncan Sands2011-09-06
| | | | | | | | | | | | | | | | | | | | | init.trampoline and adjust.trampoline intrinsics, into two intrinsics like in GCC. While having one combined intrinsic is tempting, it is not natural because typically the trampoline initialization needs to be done in one function, and the result of adjust trampoline is needed in a different (nested) function. To get around this llvm-gcc hacks the nested function lowering code to insert an additional parent variable holding the adjust.trampoline result that can be accessed from the child function. Dragonegg doesn't have the luxury of tweaking GCC code, so it stored the result of adjust.trampoline in the memory GCC set aside for the trampoline itself (this is always available in the child function), and set up some new memory (using an alloca) to hold the trampoline. Unfortunately this breaks Go which allocates trampoline memory on the heap and wants to use it even after the parent has exited (!). Rather than doing even more hacks to get Go working, it seemed best to just use two intrinsics like in GCC. Patch mostly by Sanjoy Das. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139140 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete trivial landing pads that just continue unwinding the caughtDuncan Sands2011-09-05
| | | | | | | exception. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139117 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Duncan's patch to delete the instructions in reverse order (minus the ↵Bill Wendling2011-09-04
| | | | | | landingpad and terminator). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139090 91177308-0d34-0410-b5e6-96231b3b80d8
* Update comments to reflect reality.Bill Wendling2011-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139023 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable SCEV-based unrolling by default.Andrew Trick2011-09-02
| | | | | | | | | | | | | | | | | | | | | This changes loop unrolling to use the same mechanism for trip count computation as indvars. This is a stronger check that tends to unroll more loops. A very common side-effect is that many single iteration loops will be removed sooner. The real goal was simply to remove dependence on canonical IVs. x86 is break even. ARM performance changes to expect (+ is good): External/SPEC/CFP2000/183.equake/183.equake +13% SingleSource/Benchmarks/Dhrystone/fldry +21% MultiSource/Applications/spiff/spiff +3% SingleSource/Benchmarks/Stanford/Puzzle -14% The Puzzle regression is actually an improvement in loop optimization that defeats GVN: rdar://problem/10065079. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139009 91177308-0d34-0410-b5e6-96231b3b80d8