This is an archive of the discontinued LLVM Phabricator instance.

[GVN][NFC] Mark instruction for deletion instead of immediate erasing in LoadPRE
ClosedPublic

Authored by mkazantsev on Oct 27 2017, 4:00 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mkazantsev created this revision.Oct 27 2017, 4:00 AM
reames accepted this revision.Oct 27 2017, 9:35 AM

LGTM w/comment applied.

Meta comment: It looks from the comment at the top of processBlock that moving away from InstsToErase entirely would actually be a better direction, but the moment, we can be consistent.

lib/Transforms/Scalar/GVN.cpp
1838 ↗(On Diff #120569)

Looking at the code for InstsToErase, it looks like there's an invariant that the map is empty between every instruction. Can you add an assert here to that effect if you agree with the analysis?

This revision is now accepted and ready to land.Oct 27 2017, 9:35 AM
mkazantsev added inline comments.Oct 29 2017, 8:39 PM
lib/Transforms/Scalar/GVN.cpp
1838 ↗(On Diff #120569)

I will double-check this and commit as a separate NFC.

This revision was automatically updated to reflect the committed changes.