Cast instructions are important to handle since induction variables are often extended to 64-bits.
This patch is intended to be applied after D10205 (though it could be applied independently with minor changes).
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
- Don't try to const-prop casts if the simplified value is just an offset from a base pointer.
Comment Actions
No test case here? Is this covered by the tests in D10208?
lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
---|---|---|
430–434 ↗ | (On Diff #27091) | I think the need for this will go away when offsets aren't (incorrectly) marked as needed in SimplifiedValues. See my comments is D10205. |
436 ↗ | (On Diff #27091) | This doesn't seem to be specific to ptrtoint. =] |
Comment Actions
- Fallback to Base visitor if failed to constant fold (and only then call simplifyInstWithSCEV).
- Add TODO to visitCast.
Comment Actions
This patch looks fine, but I'd like to have a test case that specifically exercises it. Is that possible given the current state, or does that come in a subsequent patch?
lib/Transforms/Scalar/LoopUnrollPass.cpp | ||
---|---|---|
444 ↗ | (On Diff #27261) | This comment still seems stale (referring to ptrtoint). |
Comment Actions
Just as a note, this LGTM provided a minimal test change is included when it is committed.
Comment Actions
Thanks!
I added a new test here and committed the patch (with comment fixed too) in r242257.