With this change:
- Methods in LoopBase trip an assert if the receiver has been invalidated
- LoopBase::invalidate frees up the memory held the LoopBase instance
This change also shuffles things around as necessary to work with this stricter invariant.
Paths
| Differential D38055
Tighten the invariants around LoopBase::invalidate ClosedPublic Authored by sanjoy on Sep 19 2017, 2:26 PM.
Details Summary With this change:
This change also shuffles things around as necessary to work with this stricter invariant.
Diff Detail
Event Timelinesanjoy added a parent revision: D37996: [LoopInfo] Make LoopBase and Loop destructors non-public.Sep 19 2017, 2:27 PM Comment Actions Generally like the API changes here. The enum seems a big improvement.
This revision now requires changes to proceed.Sep 19 2017, 5:34 PM sanjoy edited edge metadata. sanjoy marked 2 inline comments as done. Comment Actions
Comment Actions Generally looks good. Description should likely be updated to reflect changes made during review. Feel free to submit!
This revision is now accepted and ready to land.Sep 19 2017, 6:57 PM
Closed by commit rL313708: Tighten the invariants around LoopBase::invalidate (authored by sanjoy). · Explain WhySep 19 2017, 7:33 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 115949 include/llvm/Analysis/LoopInfo.h
include/llvm/Analysis/LoopInfoImpl.h
include/llvm/Transforms/Scalar/LoopPassManager.h
include/llvm/Transforms/Utils/UnrollLoop.h
lib/Analysis/LoopInfo.cpp
lib/Analysis/LoopPass.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Utils/LoopUnroll.cpp
test/Transforms/LoopUnroll/unroll-loop-invalidation.ll
|
I find clear a better name for these methods. And eventually you may just run the destructor.
I don't want it to be confused with invalidating analyses *on* the loop with a loop analysis manager.