Extend Local utils to update MemorySSA.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 21580 Build 21580: arc lint + arc unit
Event Timeline
Looks fine to me, though I'd prefer if someone familiar with this code had a look, as well.
Looks like a nice improvement.
lib/Transforms/Utils/Local.cpp | ||
---|---|---|
2231 | Yes, I think the deletion order doesn't matter. |
lib/Transforms/Utils/Local.cpp | ||
---|---|---|
2231 | It seems to make sense to use this in the first iteration over the blocks in F that follows, but not the second one doing the erase, since that's better to be iterator based. |
Thanks for the improvement! Comments are inline.
lib/Transforms/Utils/Local.cpp | ||
---|---|---|
2231 | I think maybe you can replace ToDeleteBBs with DeadBlockSet.
, if you are interested, you can run CTMarks/have some other benchmarks to see whether there is performance degradation. |
Thanks for the change.
Please have a look at my new inline comments. (I have a quick glance at the source code of MemorySSA and I think it's fine; but it's better for you to check that).
LGTM.
lib/Transforms/Utils/Local.cpp | ||
---|---|---|
2240 | We sometimes have BasicBlocks which are pending deletion in the DomTreeUpdater. (like that previously in DeferredDominance). So, sometimes a same BasicBlock can be passed into MSSAU->removeBlocks multiple times in different calls to removeUnreachableBlocks. You need to be aware of that and check whether it is fine. |
Thank you for the review!
lib/Transforms/Utils/Local.cpp | ||
---|---|---|
2240 | I believe that's fine. In MemorySSA, all memory accesses will be deleted for a dead block on the first call, subsequent calls will find an empty list. |
Yes, I think the deletion order doesn't matter.