After D71539, we need to forget the loop before setting the incoming
values of phi nodes in exit blocks, because we are looking through those
phi nodes now and the SCEV expression could depend on the loop phi. If
we update the phi nodes before forgetting the loop, we miss those users
during invalidation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Utils/LoopUtils.cpp | ||
---|---|---|
729 | This call performs an unconditional SCEV verification, probably not what you intended. Should be behind NDEBUG at least. |
llvm/lib/Transforms/Utils/LoopUtils.cpp | ||
---|---|---|
729 | Yes, should be done in 7bae2bc5a8dd11c016c895e3a691fb93575773f3, thanks! |
Hi!
I just wrote
https://bugs.llvm.org/show_bug.cgi?id=47753
about a failure that starts occuring with this patch.
llvm/lib/Transforms/Utils/LoopUtils.cpp | ||
---|---|---|
729 | I wonder if *all* SCEV has to be correct at this point. I mean, you are only deleting one single loop while possibly doing something else in some other place and plan to invalidate SCEV later. I don't think it's a right place for an assert. We have a test failing on this, but I cannot figure out how to make a simple repro unfortunately. The failure seems not related to the loop in question. The point is that it fails this assertion but passes when we verify all IR after each pass. |
llvm/lib/Transforms/Utils/LoopUtils.cpp | ||
---|---|---|
729 | In my case, the test fails even if we verify SCEV in the beginning on this method. So I don't think it's correct to verify it here since the whole thing can be called on broken SCEV which we plan to fully drop later. |
This call performs an unconditional SCEV verification, probably not what you intended. Should be behind NDEBUG at least.