This is an archive of the discontinued LLVM Phabricator instance.

[NewGVN] Skip uses in unreachable blocks
ClosedPublic

Authored by davide on Jan 25 2017, 1:38 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

davide created this revision.Jan 25 2017, 1:38 PM
dberlin added inline comments.Jan 25 2017, 2:27 PM
lib/Transforms/Scalar/NewGVN.cpp
1946 ↗(On Diff #85798)

Do you need this lookup?
Won't localnum already be 0, because we now zero the dfs number for uses in unreachable blocks?

davide accepted this revision.Jan 25 2017, 4:40 PM

Landing this fix as it is correct (after clarifying/checking with Danny on IRC).

This revision is now accepted and ready to land.Jan 25 2017, 4:40 PM

For archeologists:

16:22 < davide> DannyB: I may be mistaken, but are we marking users in unreachable blocks with InstrDFSNum == 0 ? Currently we just set that if an instruction is trivially dead
16:23 < davide> DannyB: in the example, the load with SSA name %tmp136 has InstrDFSNum zero, but the gep in bb138 has a non-zero InstrDFSNum
16:24 < DannyB> oh interesting
16:24 < DannyB> how did thathappen?
16:24 < DannyB> oh
16:24 < DannyB> yeah
16:24 < DannyB> you are right
16:24 < DannyB> because they may become reachable later
16:24 < davide> yeah
This revision was automatically updated to reflect the committed changes.