This is an extension of the fix in r271424. That fix dealt with builder
insert points being moved by SCEV expansion, but only for the lifetime
of the expand call. This change modifies the interface so that LSR can
safely call expand multiple times at the same insert point and do the
right thing if one of the expansions decides to move the original insert
point.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
+Sanjoy and Hal, perhaps you could take a look?
This is for PR28719 which is a 3.9 blocker.
Comment Actions
lgtm, but at this point I'm wondering if there is something we can do to rule out this class of bugs. Any ideas @gberry? Or is the solution here just "be careful when using SCEVExpander".
test/Transforms/LoopStrengthReduce/X86/pr28719.ll | ||
---|---|---|
10 ↗ | (On Diff #67454) | Can you still please add a CHECK for something obvious, like CHECK-LABEL: @main( ? |
Comment Actions
The only other solution that comes to mind is instead of fixing up the insert points, avoid moving them in the first place in SCEVExpander. I'm not familiar enough with that code to say whether that makes sense or would cause performance regressions. It's also probably a riskier fix for the release.