- Aug 10, 2011
-
-
Andrew Trick authored
SimplifyIndVar utility since it is required. llvm-svn: 137202
-
Andrew Trick authored
based on ScalarEvolution without changing the induction variable phis. This utility is the main tool of IndVarSimplifyPass, but the pass also restructures induction variables in strange ways that are sensitive to pass ordering. This provides a way for other loop passes to simplify new uses of induction variables created during transformation. The utility may be used by any pass that preserves ScalarEvolution. Soon LoopUnroll will use it. The net effect in this checkin is to cleanup the IndVarSimplify pass by factoring out the SimplifyIndVar algorithm into a standalone utility. llvm-svn: 137197
-
- Aug 06, 2011
-
-
Andrew Trick authored
recurrence, the initial values low bits can sometimes be ignored. To take advantage of this, added FoldIVUser to IndVarSimplify to fold an IV operand into a udiv/lshr if the operator doesn't affect the result. -indvars -disable-iv-rewrite now transforms i = phi i4 i1 = i0 + 1 idx = i1 >> (2 or more) i4 = i + 4 into i = phi i4 idx = i0 >> ... i4 = i + 4 llvm-svn: 137013
-
- Jul 21, 2011
-
-
Andrew Trick authored
llvm-svn: 135684
-
Chris Lattner authored
to for it to be an an anon namespace and be in a header. Eliminate some extraenous uses of tie. llvm-svn: 135669
-
- Jul 20, 2011
-
-
Jay Foad authored
llvm-svn: 135581
-
Andrew Trick authored
llvm-svn: 135568
-
Andrew Trick authored
info. Holding Use* pointers is bad form even though it happened to work in this case. llvm-svn: 135566
-
Andrew Trick authored
llvm-svn: 135558
-
- Jul 18, 2011
-
-
Andrew Trick authored
llvm-svn: 135426
-
Andrew Trick authored
For -disable-iv-rewrite, perform LFTR without generating a new "canonical" induction variable. Instead find the "best" existing induction variable for use in the loop exit test and compute the final value of that IV for use in the new loop exit test. In short, convert to a simple eq/ne exit test as long as it's cheap to do so. llvm-svn: 135420
-
Andrew Trick authored
not interfere with BackedgeTakenCount computation. llvm-svn: 135412
-
Andrew Trick authored
preheader for the sole purpose of LFTR, since LFTR itself is usually not a clear optimization. llvm-svn: 135409
-
Chris Lattner authored
llvm-svn: 135375
-
- Jul 16, 2011
-
-
Andrew Trick authored
assertion I added in r135333. Check for the existence of a preheader before expanding a recurrence. llvm-svn: 135335
-
Andrew Trick authored
llvm-svn: 135334
-
- Jul 12, 2011
-
-
Andrew Trick authored
LinearFunctionTestReplace rewrite. No functionality. I've been wanting to group the indvar subphases into sections and order them by their logical sequence. My next checkin adds functions related to LFTR, and doing the reorg now should help reviewers. Since, most of the code in IndVarSimplify.cpp has recently been replaced or will be replaced soon, obscuring blame should not be an issue. This seems like an ideal time to shuffle the code around. I'm happy to take more suggestions for cleaning up the code. Or if you've been wanting to cleanup anything in this file yourself, now is a good time. llvm-svn: 134941
-
- Jul 06, 2011
-
-
Andrew Trick authored
careful about referencing values. llvm-svn: 134537
-
Andrew Trick authored
llvm-svn: 134530
-
- Jul 05, 2011
-
-
Devang Patel authored
llvm-svn: 134441
-
Andrew Trick authored
Putting back the helper that I removed on 7/1 to do this right. llvm-svn: 134423
-
- Jul 02, 2011
-
-
Andrew Trick authored
llvm-svn: 134306
-
- Jun 30, 2011
-
-
Andrew Trick authored
llvm-svn: 134177
-
Andrew Trick authored
llvm-svn: 134124
-
Andrew Trick authored
llvm-svn: 134112
-
- Jun 29, 2011
-
-
Andrew Trick authored
mean they can be removed. llvm-svn: 134054
-
- Jun 28, 2011
-
-
Andrew Trick authored
llvm-svn: 134010
-
Andrew Trick authored
llvm-svn: 133992
-
Andrew Trick authored
llvm-svn: 133988
-
Andrew Trick authored
evaluates all other IV exprs. llvm-svn: 133982
-
Andrew Trick authored
a bit more control over the order SCEVs are evaluated. llvm-svn: 133959
-
- Jun 22, 2011
-
-
Devang Patel authored
llvm-svn: 133636
-
- Jun 21, 2011
-
-
Andrew Trick authored
llvm-svn: 133518
-
Andrew Trick authored
ops. This is a rewrite of the IV simplification algorithm used by -disable-iv-rewrite. To avoid perturbing the default mode, I temporarily split the driver and created SimplifyIVUsersNoRewrite. The idea is to avoid doing opcode/pattern matching inside IndVarSimplify. SCEV already does it. We want to optimize with the full generality of SCEV, but optimize def-use chains top down on-demand rather than rewriting the entire expression bottom-up. This was easy to do for operations that SCEV can prove are identity function. So we're now eliminating bitmasks and zero extends this way. A result of this rewrite is that indvars -disable-iv-rewrite no longer requires IVUsers. llvm-svn: 133502
-
- May 26, 2011
-
-
Andrew Trick authored
Use a proper worklist for use-def traversal without holding onto an iterator. Now that we process all IV uses, we need complete logic for resusing existing derived IV defs. See HoistStep. llvm-svn: 132103
-
- May 25, 2011
-
-
Andrew Trick authored
cleanup and overdue test cases. llvm-svn: 132038
-
- May 20, 2011
-
-
Andrew Trick authored
No functionality enabled by default. Use -disable-iv-rewrite. Extended IVUsers to keep track of the phi that represents the users' IV. Added the WidenIV transform to replace a narrow IV with a wide IV by doing a one-for-one replacement of IV users instead of expanding the SCEV expressions. [sz]exts are removed and truncs are inserted. llvm-svn: 131744
-
Andrew Trick authored
llvm-svn: 131716
-
- May 13, 2011
-
-
Andrew Trick authored
the users. llvm-svn: 131277
-
- May 12, 2011
-
-
Andrew Trick authored
Interleave IV simplifications. Currently involves EliminateComparison and EliminateRemainder. Next I'll add EliminateExtend. llvm-svn: 131210
-