This is an archive of the discontinued LLVM Phabricator instance.

[GVN] Invalidate cached info for phis when setting dead predecessors to undef
ClosedPublic

Authored by john.brawn on Aug 22 2018, 5:51 AM.

Details

Summary

When GVN sets the incoming value for a phi to undef because the incoming block is unreachable it needs to also invalidate the cached info for that phi in MemoryDependenceAnalysis, otherwise later queries will return stale information.

Diff Detail

Repository
rL LLVM

Event Timeline

john.brawn created this revision.Aug 22 2018, 5:51 AM
efriedma accepted this revision.Aug 22 2018, 11:35 AM

LGTM

lib/Transforms/Scalar/GVN.cpp
2460 ↗(On Diff #161926)

The isPtrOrPtrVectorTy check is unnecessary; invalidateCachedPointerInfo does its own check.

This revision is now accepted and ready to land.Aug 22 2018, 11:35 AM
This revision was automatically updated to reflect the committed changes.