[GVN] Invalidate cached info for phis when setting dead predecessors to undef
authorJohn Brawn <john.brawn@arm.com>
Thu, 23 Aug 2018 12:48:17 +0000 (12:48 +0000)
committerJohn Brawn <john.brawn@arm.com>
Thu, 23 Aug 2018 12:48:17 +0000 (12:48 +0000)
commit23cbf09fad7ca004aec7ef77e89dd0d01ef0dd5f
tree807e725545f07ad59e28458b2a6a3c0f01b2baa8
parentcf1f714d3b1bcb623dbeed33dc8c469f3af0bdf2
[GVN] Invalidate cached info for phis when setting dead predecessors to undef

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.

Differential Revision: https://reviews.llvm.org/D51099

llvm-svn: 340529
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Transforms/GVN/unreachable-predecessor.ll [new file with mode: 0644]