- Feb 18, 2009
-
-
Dan Gohman authored
llvm-svn: 64859
-
- Feb 17, 2009
-
-
Evan Cheng authored
llvm-svn: 64703
-
- Feb 15, 2009
-
-
Evan Cheng authored
Fix pr3571: If stride is a value defined by an instruction, make sure it dominates the loop preheader. When IV users are strength reduced, the stride is inserted into the preheader. It could create a use before def situation. llvm-svn: 64579
-
Evan Cheng authored
llvm-svn: 64575
-
- Feb 13, 2009
-
-
Dan Gohman authored
about the code it describes, but at least now the comment is right. llvm-svn: 64465
-
Dan Gohman authored
addrec in a different loop to check the value being added to the accumulated Start value, not the Start value before it has the new value added to it. This prevents LSR from going crazy on the included testcase. Dale, please review. llvm-svn: 64440
-
Dan Gohman authored
after sorting by stride value. This prevents it from missing IV reuse opportunities in a host-sensitive manner. llvm-svn: 64415
-
- Feb 09, 2009
-
-
Dale Johannesen authored
llvm-svn: 64177
-
- Jan 14, 2009
-
-
Dale Johannesen authored
my earlier patch to this file. The issue there was that all uses of an IV inside a loop are actually references to Base[IV*2], and there was one use outside that was the same but LSR didn't see the base or the scaling because it didn't recurse into uses outside the loop; thus, it used base+IV*scale mode inside the loop instead of pulling base out of the loop. This was extra bad because register pressure later forced both base and IV into memory. Doing that recursion, at least enough to figure out addressing modes, is a good idea in general; the change in AddUsersIfInteresting does this. However, there were side effects.... It is also possible for recursing outside the loop to introduce another IV where there was only 1 before (if the refs inside are not scaled and the ref outside is). I don't think this is a common case, but it's in the testsuite. It is right to be very aggressive about getting rid of such introduced IVs (CheckForIVReuse and the handling of nonzero RewriteFactor in StrengthReduceStridedIVUsers). In the testcase in question the new IV produced this way has both a nonconstant stride and a nonzero base, neither of which was handled before. And when inserting new code that feeds into a PHI, it's right to put such code at the original location rather than in the PHI's immediate predecessor(s) when the original location is outside the loop (a case that couldn't happen before) (RewriteInstructionToUseNewBase); better to avoid making multiple copies of it in this case. Also, the mechanism for keeping SCEV's corresponding to GEP's no longer works, as the GEP might change after its SCEV is remembered, invalidating the SCEV, and we might get a bad SCEV value when looking up the GEP again for a later loop. This also couldn't happen before, as we weren't recursing into GEP's outside the loop. Also, when we build an expression that involves a (possibly non-affine) IV from a different loop as well as an IV from the one we're interested in (containsAddRecFromDifferentLoop), don't recurse into that. We can't do much with it and will get in trouble if we try to create new non-affine IVs or something. More testcases are coming. llvm-svn: 62212
-
- Jan 12, 2009
-
-
Duncan Sands authored
suggested by Chris. llvm-svn: 62099
-
- Dec 24, 2008
-
-
Dale Johannesen authored
llvm-svn: 61403
-
Dale Johannesen authored
other SPEC breakage. I'll be reverting all recent changes shortly, this checking is mostly so this change doesn't get lost. llvm-svn: 61402
-
- Dec 23, 2008
-
-
Dale Johannesen authored
my last patch to this file. The issue there was that all uses of an IV inside a loop are actually references to Base[IV*2], and there was one use outside that was the same but LSR didn't see the base or the scaling because it didn't recurse into uses outside the loop; thus, it used base+IV*scale mode inside the loop instead of pulling base out of the loop. This was extra bad because register pressure later forced both base and IV into memory. Doing that recursion, at least enough to figure out addressing modes, is a good idea in general; the change in AddUsersIfInteresting does this. However, there were side effects.... It is also possible for recursing outside the loop to introduce another IV where there was only 1 before (if the refs inside are not scaled and the ref outside is). I don't think this is a common case, but it's in the testsuite. It is right to be very aggressive about getting rid of such introduced IVs (CheckForIVReuse and the handling of nonzero RewriteFactor in StrengthReduceStridedIVUsers). In the testcase in question the new IV produced this way has both a nonconstant stride and a nonzero base, neither of which was handled before. And when inserting new code that feeds into a PHI, it's right to put such code at the original location rather than in the PHI's immediate predecessor(s) when the original location is outside the loop (a case that couldn't happen before) (RewriteInstructionToUseNewBase); better to avoid making multiple copies of it in this case. Also, the mechanism for keeping SCEV's corresponding to GEP's no longer works, as the GEP might change after its SCEV is remembered, invalidating the SCEV, and we might get a bad SCEV value when looking up the GEP again for a later loop. This also couldn't happen before, as we weren't recursing into GEP's outside the loop. I owe some testcases for this, want to get it in for nightly runs. llvm-svn: 61362
-
- Dec 18, 2008
-
-
Dale Johannesen authored
llvm-svn: 61181
-
Dale Johannesen authored
my last patch to this file. The issue there was that all uses of an IV inside a loop are actually references to Base[IV*2], and there was one use outside that was the same but LSR didn't see the base or the scaling because it didn't recurse into uses outside the loop; thus, it used base+IV*scale mode inside the loop instead of pulling base out of the loop. This was extra bad because register pressure later forced both base and IV into memory. Doing that recursion, at least enough to figure out addressing modes, is a good idea in general; the change in AddUsersIfInteresting does this. However, there were side effects.... It is also possible for recursing outside the loop to introduce another IV where there was only 1 before (if the refs inside are not scaled and the ref outside is). I don't think this is a common case, but it's in the testsuite. It is right to be very aggressive about getting rid of such introduced IVs (CheckForIVReuse and the handling of nonzero RewriteFactor in StrengthReduceStridedIVUsers). In the testcase in question the new IV produced this way has both a nonconstant stride and a nonzero base, neither of which was handled before. (This patch does not handle all the cases where this can happen.) And when inserting new code that feeds into a PHI, it's right to put such code at the original location rather than in the PHI's immediate predecessor(s) when the original location is outside the loop (a case that couldn't happen before) (RewriteInstructionToUseNewBase); better to avoid making multiple copies of it in this case. Everything above is exercised in CodeGen/X86/lsr-negative-stride.ll (and ifcvt4 in ARM which is the same IR). llvm-svn: 61178
-
- Dec 16, 2008
-
-
Dale Johannesen authored
can be negative. Keep track of whether all uses of an IV are outside the loop. Some cosmetics; no functional change. llvm-svn: 61109
-
- Dec 09, 2008
-
-
Chris Lattner authored
on test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad. llvm-svn: 60739
-
- Dec 05, 2008
-
-
Dale Johannesen authored
loops when they can be subsumed into addressing modes. Change X86 addressing mode check to realize that some PIC references need an extra register. (I believe this is correct for Linux, if not, I'm sure someone will tell me.) llvm-svn: 60608
-
- Dec 03, 2008
-
-
Dale Johannesen authored
llvm-svn: 60508
-
Dale Johannesen authored
llvm-svn: 60506
-
Dale Johannesen authored
llvm-svn: 60494
-
- Dec 02, 2008
-
-
Dale Johannesen authored
llvm-svn: 60442
-
Dale Johannesen authored
llvm-svn: 60431
-
Chris Lattner authored
llvm-svn: 60395
-
- Dec 01, 2008
-
-
Dale Johannesen authored
figuring out the base of the IV. This produces better code in the example. (Addresses use (IV) instead of (BASE,IV) - a significant improvement on low-register machines like x86). llvm-svn: 60374
-
Chris Lattner authored
instead of std::sort. This shrinks the release-asserts LSR.o file by 1100 bytes of code on my system. We should start using array_pod_sort where possible. llvm-svn: 60335
-
Chris Lattner authored
This is a lot cheaper and conceptually simpler. llvm-svn: 60332
-
Chris Lattner authored
DeadInsts ivar, just use it directly. llvm-svn: 60330
-
Chris Lattner authored
buggy rewrite, this notifies ScalarEvolution of a pending instruction about to be removed and then erases it, instead of erasing it then notifying. llvm-svn: 60329
-
- Nov 29, 2008
-
-
Bill Wendling authored
llvm-svn: 60233
-
- Nov 28, 2008
-
-
Chris Lattner authored
making it use RecursivelyDeleteTriviallyDeadInstructions to do the heavy lifting. llvm-svn: 60195
-
Chris Lattner authored
llvm-svn: 60192
-
- Oct 23, 2008
-
-
Daniel Dunbar authored
LoopPass*. - Although less precise, this means they can be used in clients without RTTI (who would otherwise need to include LoopPass.h, which eventually includes things using dynamic_cast). This was the simplest solution that presented itself, but I am happy to use a better one if available. llvm-svn: 58010
-
- Oct 01, 2008
-
-
Dan Gohman authored
instruction, not after. This fixes some uses of free'd memory. llvm-svn: 56908
-
- Sep 15, 2008
-
-
Dan Gohman authored
cases. See the comment above OptimizeSMax for the full story, and the testcase for an example. This cancels out a pessimization commonly attributed to indvars, and will allow us to lift some of the artificial throttles in indvars, rather than add new ones. llvm-svn: 56230
-
- Sep 09, 2008
-
-
Devang Patel authored
llvm-svn: 56011
-
- Sep 08, 2008
-
-
Devang Patel authored
llvm-svn: 55924
-
Devang Patel authored
llvm-svn: 55913
-
- Sep 04, 2008
-
-
Dan Gohman authored
llvm-svn: 55779
-
- Sep 03, 2008
-
-
Devang Patel authored
llvm-svn: 55682
-