summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopStrengthReduce
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove triple from this test, it makes it fail when X86 TTI is missing.Benjamin Kramer2013-01-161-4/+1
| | | | | | Without a triple opt falls back to NoTTI which comes closer to LSR's pre-TTI behavior. llvm-svn: 172609
* Pattern-matched variables in post-inc-icmpzero.llRenato Golin2013-01-151-4/+4
| | | | | | | | | | | Test was failing for clang-native-arm-cortex-a9 build-bot configuration. The reason for the failure was the test was using hardcoded names. The attached patch fixes this failure by replacing the hard-coded variables names with pattern-matched variable names. Patch by Manish Verma, ARM llvm-svn: 172534
* SCEVExpander fix. RAUW needs to update the InsertedExpressions cache.Andrew Trick2013-01-141-0/+84
| | | | | | | | Note that this bug is only exposed because LTO fails to use TTI. Fixes self-LTO of clang. rdar://13007381. llvm-svn: 172462
* Switch the SCEV expander and LoopStrengthReduce to useChandler Carruth2013-01-074-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TargetTransformInfo rather than TargetLowering, removing one of the primary instances of the layering violation of Transforms depending directly on Target. This is a really big deal because LSR used to be a "special" pass that could only be tested fully using llc and by looking at the full output of it. It also couldn't run with any other loop passes because it had to be created by the backend. No longer is this true. LSR is now just a normal pass and we should probably lift the creation of LSR out of lib/CodeGen/Passes.cpp and into the PassManagerBuilder. =] I've not done this, or updated all of the tests to use opt and a triple, because I suspect someone more familiar with LSR would do a better job. This change should be essentially without functional impact for normal compilations, and only change behvaior of targetless compilations. The conversion required changing all of the LSR code to refer to the TTI interfaces, which fortunately are very similar to TargetLowering's interfaces. However, it also allowed us to *always* expect to have some implementation around. I've pushed that simplification through the pass, and leveraged it to simplify code somewhat. It required some test updates for one of two things: either we used to skip some checks altogether but now we get the default "no" answer for them, or we used to have no information about the target and now we do have some. I've also started the process of removing AddrMode, as the TTI interface doesn't use it any longer. In some cases this simplifies code, and in others it adds some complexity, but I think it's not a bad tradeoff even there. Subsequent patches will try to clean this up even further and use other (more appropriate) abstractions. Yet again, almost all of the formatting changes brought to you by clang-format. =] llvm-svn: 171735
* Fix a crash in LSR replaceCongruentIVs.Andrew Trick2013-01-061-0/+44
| | | | | | | Indirect branch in the preheader crashes replaceCongruentIVs. Fixes rdar://12910141. llvm-svn: 171653
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2012-12-302-2/+2
| | | | | | | | ModuleID This is done to avoid odd test failures, like the one fixed in r171243. llvm-svn: 171250
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2012-12-301-1/+1
| | | | | | | | ModuleID This is done to avoid odd test failures, like the one fixed in r171243. llvm-svn: 171246
* LSR critical edge splitting fix for PR13756.Andrew Trick2012-09-181-3/+41
| | | | llvm-svn: 164147
* During the CodeGenPrepare we often lower intrinsics (such as objsize)Nadav Rotem2012-08-141-4/+4
| | | | | | | | | | | and allow some optimizations to turn conditional branches into unconditional. This commit adds a simple control-flow optimization which merges two consecutive basic blocks which are connected by a single edge. This allows the codegen to operate on larger basic blocks. rdar://11973998 llvm-svn: 161852
* Add a much more conservative strategy for aligning branch targets.Chandler Carruth2012-08-071-1/+0
| | | | | | | | | | | | | Previously, MBP essentially aligned every branch target it could. This bloats code quite a bit, especially non-looping code which has no real reason to prefer aligned branch targets so heavily. As Andy said in review, it's still a bit odd to do this without a real cost model, but this at least has much more plausible heuristics. Fixes PR13265. llvm-svn: 161409
* Added unit test for PR13361: LSR + SCEV "hangs" on reasonably sized test.Andrew Trick2012-07-181-0/+517
| | | | llvm-svn: 160439
* LSR Fix: check SCEV expression safety before expansion.Andrew Trick2012-07-131-0/+90
| | | | | | | | | | All SCEV expressions used by LSR formulae must be safe to expand. i.e. they may not contain UDiv unless we can prove nonzero denominator. Fixes PR11356: LSR hoists UDiv. llvm-svn: 160205
* Fix the remaining TCL-style quotes found in the testsuite. This isChandler Carruth2012-07-024-5/+5
| | | | | | | | | | | | | | | | | another mechanical change accomplished though the power of terrible Perl scripts. I have manually switched some "s to 's to make escaping simpler. While I started this to fix tests that aren't run in all configurations, the massive number of tests is due to a really frustrating fragility of our testing infrastructure: things like 'grep -v', 'not grep', and 'expected failures' can mask broken tests all too easily. Essentially, I'm deeply disturbed that I can change the testsuite so radically without causing any change in results for most platforms. =/ llvm-svn: 159547
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-024-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This was done through the aid of a terrible Perl creation. I will not paste any of the horrors here. Suffice to say, it require multiple staged rounds of replacements, state carried between, and a few nested-construct-parsing hacks that I'm not proud of. It happens, by luck, to be able to deal with all the TCL-quoting patterns in evidence in the LLVM test suite. If anyone is maintaining large out-of-tree test trees, feel free to poke me and I'll send you the steps I used to convert things, as well as answer any painful questions etc. IRC works best for this type of thing I find. Once converted, switch the LLVM lit config to use ShTests the same as Clang. In addition to being able to delete large amounts of Python code from 'lit', this will also simplify the entire test suite and some of lit's architecture. Finally, the test suite runs 33% faster on Linux now. ;] For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s llvm-svn: 159525
* Unit test for LSR kind=Special fix: r158536.Andrew Trick2012-06-151-0/+102
| | | | llvm-svn: 158570
* LSR fix: add a missing phi check during IV hoisting.Andrew Trick2012-05-221-0/+57
| | | | | | Fixes PR12898: SCEVExpander crash. llvm-svn: 157263
* Make sure HoistInsertPosition finds a position that is dominated by allRafael Espindola2012-04-301-0/+34
| | | | | | inputs. llvm-svn: 155809
* Flip the new block-placement pass to be on by default.Chandler Carruth2012-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly to test the waters. I'd like to get results from FNT build bots and other bots running on non-x86 platforms. This feature has been pretty heavily tested over the last few months by me, and it fixes several of the execution time regressions caused by the inlining work by preventing inlining decisions from radically impacting block layout. I've seen very large improvements in yacr2 and ackermann benchmarks, along with the expected noise across all of the benchmark suite whenever code layout changes. I've analyzed all of the regressions and fixed them, or found them to be impossible to fix. See my email to llvmdev for more details. I'd like for this to be in 3.1 as it complements the inliner changes, but if any failures are showing up or anyone has concerns, it is just a flag flip and so can be easily turned off. I'm switching it on tonight to try and get at least one run through various folks' performance suites in case SPEC or something else has serious issues with it. I'll watch bots and revert if anything shows up. llvm-svn: 154816
* Unit test for PR11950: LSR crash.Andrew Trick2012-03-261-0/+49
| | | | llvm-svn: 153472
* Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnuEli Bendersky2012-03-252-16/+2
| | | | | | | | | | | | | | * Removed test/lib/llvm.exp - it is no longer needed * Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files left in the test suite so this code is no longer required. test/lit.cfg is now much shorter and clearer * Removed a lot of duplicate code in lit.local.cfg files that need access to the root configuration, by adding a "root" attribute to the TestingConfig object. This attribute is dynamically computed to provide the same information as was previously provided by the custom getRoot functions. * Documented the config.root attribute in docs/CommandGuide/lit.pod llvm-svn: 153408
* Convert -indvars tests that rely on SCEV expansion to -loop-reduce tests.Andrew Trick2012-03-222-0/+124
| | | | llvm-svn: 153259
* LSR: teach isSimplifiedLoopNest to handle PHI IVUsers.Andrew Trick2012-03-201-0/+32
| | | | llvm-svn: 153132
* LSR: fix IVUsers isSimplifiedLoopNest to perform a full domtree walkAndrew Trick2012-03-201-0/+73
| | | | | | | | | instead of skipping the current loop. My prior fix was incomplete because of an overzealous compile-time optimization: Better fix for: <rdar://problem/11049788> Segmentation fault: 11 in LoopStrengthReduce llvm-svn: 153131
* LSR fix: Add isSimplifiedLoopNest to IVUsers analysis.Andrew Trick2012-03-161-0/+50
| | | | | | | | | | | | | | Only record IVUsers that are dominated by simplified loop headers. Otherwise SCEVExpander will crash while looking for a preheader. I previously tried to work around this in LSR itself, but that was insufficient. This way, LSR can continue to run if some uses are not in simple loops, as long as we don't attempt to analyze those users. Fixes <rdar://problem/11049788> Segmentation fault: 11 in LoopStrengthReduce llvm-svn: 152892
* Move llc + target triple tests into X86Andrew Trick2012-03-102-0/+0
| | | | llvm-svn: 152502
* Fix this assert. IP can point to an instruction with strange dominanceRafael Espindola2012-02-271-0/+30
| | | | | | | properties (invoke). Just assert that the instruction we return dominates the insertion point. llvm-svn: 151511
* Change the implementation of dominates(inst, inst) to one based on what theRafael Espindola2012-02-261-0/+40
| | | | | | | | verifier does. This correctly handles invoke. Thanks to Duncan, Andrew and Chris for the comments. Thanks to Joerg for the early testing. llvm-svn: 151469
* Semantically revert 151015. Add a comment on why we should be able to assertRafael Espindola2012-02-221-0/+38
| | | | | | | | the dominance once the dominates method is fixed and why we can use the builder's insertion point. Fixes pr12048. llvm-svn: 151125
* Don't skip debug instructions when looking for the insertion point ofRafael Espindola2012-02-181-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the cast. If we do, we can end up with inst1 --------------- < Insertion point dbg inst new inst instead of the desired inst1 new inst --------------- < Insertion point dbg inst Another option would be for InsertNoopCastOfTo (or its callers) to move the insertion point and we would end up with inst1 dbg inst new inst --------------- < Insertion point but that complicates the callers. This fixes PR12018 (and firefox's build). llvm-svn: 150884
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-166-13/+27
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* Handle a corner case with IV chain collection with bailout instead of assert.Andrew Trick2012-01-201-0/+43
| | | | | | Fixes PR11783: bad cast to AddRecExpr. llvm-svn: 148572
* Test case comments missing from my previous checkin.Andrew Trick2012-01-201-0/+5
| | | | llvm-svn: 148571
* SCEVExpander fixes. Affects LSR and indvars.Andrew Trick2012-01-201-0/+37
| | | | | | | | | | | | | | | | LSR has gradually been improved to more aggressively reuse existing code, particularly existing phi cycles. This exposed problems with the SCEVExpander's sloppy treatment of its insertion point. I applied some rigor to the insertion point problem that will hopefully avoid an endless bug cycle in this area. Changes: - Always used properlyDominates to check safe code hoisting. - The insertion point provided to SCEV is now considered a lower bound. This is usually a block terminator or the use itself. Under no cirumstance may SCEVExpander insert below this point. - LSR is reponsible for finding a "canonical" insertion point across expansion of different expressions. - Robust logic to determine whether IV increments are in "expanded" form and/or can be safely hoisted above some insertion point. Fixes PR11783: SCEVExpander assert. llvm-svn: 148535
* Test case renameAndrew Trick2012-01-171-0/+0
| | | | llvm-svn: 148344
* LSR fix: broaden the check for loop preheaders.Andrew Trick2012-01-171-0/+113
| | | | | | | It's becoming clear that LoopSimplify needs to unconditionally create loop preheaders. But that is a bigger fix. For now, continuing to hack LSR. Fixes rdar://10701050 "Cannot split an edge from an IndirectBrInst" assert. llvm-svn: 148288
* Fix a corner case hit by redundant phi elimination running after LSR.Andrew Trick2012-01-141-0/+50
| | | | | | Fixes PR11761: bad IR w/ redundant Phi elim llvm-svn: 148177
* Enable LSR IV Chains with sufficient heuristics.Andrew Trick2012-01-103-0/+597
| | | | | | | | | | | | | | | | | | | | | | | | | These heuristics are sufficient for enabling IV chains by default. Performance analysis has been done for i386, x86_64, and thumbv7. The optimization is rarely important, but can significantly speed up certain cases by eliminating spill code within the loop. Unrolled loops are prime candidates for IV chains. In many cases, the final code could still be improved with more target specific optimization following LSR. The goal of this feature is for LSR to make the best choice of induction variables. Instruction selection may not completely take advantage of this feature yet. As a result, there could be cases of slight code size increase. Code size can be worse on x86 because it doesn't support postincrement addressing. In fact, when chains are formed, you may see redundant address plus stride addition in the addressing mode. GenerateIVChains tries to compensate for the common cases. On ARM, code size increase can be mitigated by using postincrement addressing, but downstream codegen currently misses some opportunities. llvm-svn: 147826
* Adding IV chain generation to LSR.Andrew Trick2012-01-091-0/+96
| | | | | | | | | | | | | | | | | | After collecting chains, check if any should be materialized. If so, hide the chained IV users from the LSR solver. LSR will only solve for the head of the chain. GenerateIVChains will then materialize the chained IV users by computing the IV relative to its previous value in the chain. In theory, chained IV users could be exposed to LSR's solver. This would be considerably complicated to implement and I'm not aware of a case where we need it. In practice it's more important to intelligently prune the search space of nontrivial loops before running the solver, otherwise the solver is often forced to prune the most optimal solutions. Hiding the chained users does this well, so that LSR is more likely to find the best IV for the chain as a whole. llvm-svn: 147801
* LSR: Don't optimize loops if an outer loop has no preheader.Andrew Trick2012-01-071-3/+41
| | | | | | | | LoopSimplify may not run on some outer loops, e.g. because of indirect branches. SCEVExpander simply cannot handle outer loops with no preheaders. Fixes rdar://10655343 SCEVExpander segfault. llvm-svn: 147718
* comment typoAndrew Trick2012-01-071-1/+1
| | | | llvm-svn: 147701
* Fix SCEVExpander to handle loops with no preheader when LSR gives it aAndrew Trick2012-01-021-0/+50
| | | | | | | | "phony" insertion point. Fixes rdar://10619599: "SelectionDAGBuilder shouldn't visit PHI nodes!" assert llvm-svn: 147439
* Unit test for r146950: LSR postinc expansion, PR11571.Andrew Trick2011-12-201-0/+39
| | | | llvm-svn: 146951
* LSR: Fold redundant bitcasts on-the-fly.Andrew Trick2011-12-141-4/+4
| | | | llvm-svn: 146597
* LSR: prune undesirable formulae early.Andrew Trick2011-12-061-0/+96
| | | | | | | | | It's always good to prune early, but formulae that are unsatisfactory in their own right need to be removed before running any other pruning heuristics. We easily avoid generating such formulae, but we need them as an intermediate basis for forming other good formulae. llvm-svn: 145906
* Better test case found in duplicate PR10570.Andrew Trick2011-11-301-43/+23
| | | | llvm-svn: 145484
* LSR: handle the expansion of phi operands that use postinc forms of the IV.Andrew Trick2011-11-301-0/+56
| | | | | | Fixes PR11431: SCEVExpander::expandAddRecExprLiterally(const llvm::SCEVAddRecExpr*): Assertion `(!isa<Instruction>(Result) || SE.DT->dominates(cast<Instruction>(Result), Builder.GetInsertPoint())) && "postinc expansion does not dominate use"' failed. llvm-svn: 145482
* Upgrade syntax of tests using volatile instructions to use 'load volatile' ↵Chris Lattner2011-11-273-4/+4
| | | | | | instead of 'volatile load', which is archaic. llvm-svn: 145171
* Fix SCEVExpander assert during LSR: "argument of incompatible type".Andrew Trick2011-10-151-0/+27
| | | | | | | | | Just because we're dealing with a GEP doesn't mean we can assert the SCEV has a pointer type. The fix is simply to ignore the SCEV pointer type, which we really didn't need. Fixes PR11138 webkit crash. llvm-svn: 142058
* Reapply r141870, SCEV expansion of post-inc.Andrew Trick2011-10-131-0/+111
| | | | | | | Speculatively reapply to see if this test case still crashes on linux. I may have fixed it in my last checkin. llvm-svn: 141895
* Revert r141870. The test case crashes on linux with data corruption. A ↵Andrew Trick2011-10-131-111/+0
| | | | | | deeper issue was exposed. llvm-svn: 141873
OpenPOWER on IntegriCloud