- Mar 18, 2009
-
-
Chris Lattner authored
it is not APInt clean, but even when it is it needs to be evaluated carefully to determine whether it is actually profitable. This fixes a crash on PR3806 llvm-svn: 67134
-
- Mar 09, 2009
-
-
Dan Gohman authored
if needed. This simplifies the code a little, and is needed for an upcoming refactoring. llvm-svn: 66479
-
Dan Gohman authored
where memory access types are needed. llvm-svn: 66470
-
Dan Gohman authored
llvm-svn: 66469
-
Dan Gohman authored
llvm-svn: 66467
-
Dan Gohman authored
Use VoidTy instead, to be properly conservative. llvm-svn: 66463
-
Dan Gohman authored
of an instruction into a helper function. llvm-svn: 66460
-
Dan Gohman authored
have to be done twice. llvm-svn: 66449
-
Dan Gohman authored
llvm-svn: 66446
-
Dan Gohman authored
before it does any processing. llvm-svn: 66443
-
- Mar 04, 2009
-
-
Dan Gohman authored
llvm-svn: 66065
-
Dan Gohman authored
immediately obvious. llvm-svn: 66062
-
- Feb 24, 2009
-
-
Dan Gohman authored
to more accurately describe what it does. Expand its doxygen comment to describe what the backedge-taken count is and how it differs from the actual iteration count of the loop. Adjust names and comments in associated code accordingly. llvm-svn: 65382
-
Dan Gohman authored
handling non-constant strides. No functionality change. llvm-svn: 65363
-
- Feb 22, 2009
-
-
Dan Gohman authored
-full-lsr code, as well as a GCC warning. llvm-svn: 65288
-
Evan Cheng authored
Only try to sink immediate when TLI is not null. It needs to check if immediate would fit in target addressing field. llvm-svn: 65268
-
- Feb 21, 2009
-
-
Evan Cheng authored
Teach LSR sink to sink the immediate portion of the common expression back into uses if they fit in address modes of all the uses. llvm-svn: 65215
-
- Feb 20, 2009
-
-
Evan Cheng authored
addresses, part 1. This fixes an obvious logic bug. Previously if the only in-loop use is a PHI, it would return AllUsesAreAddresses as true. llvm-svn: 65178
-
Dan Gohman authored
llvm-svn: 65167
-
Dan Gohman authored
llvm-svn: 65159
-
Dan Gohman authored
llvm-svn: 65157
-
Dan Gohman authored
llvm-svn: 65147
-
Dan Gohman authored
reduction of address calculations down to basic pointer arithmetic. This is currently off by default, as it needs a few other features before it becomes generally useful. And even when enabled, full strength reduction is only performed when it doesn't increase register pressure, and when several other conditions are true. This also factors out a bunch of exisiting LSR code out of StrengthReduceStridedIVUsers into separate functions, and tidies up IV insertion. This actually decreases register pressure even in non-superhero mode. The change in iv-users-in-other-loops.ll is an example of this; there are two more adds because there are two fewer leas, and there is less spilling. llvm-svn: 65108
-
- Feb 19, 2009
-
-
Dan Gohman authored
since the latter just passes a null reference when debugging is not enabled. llvm-svn: 65060
-
Dan Gohman authored
llvm-svn: 65057
-
- 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
-