[SROA] Correctly invalidate analyses when dead instructions deleted
authorTeresa Johnson <tejohnson@google.com>
Mon, 20 Nov 2017 18:33:38 +0000 (18:33 +0000)
committerTeresa Johnson <tejohnson@google.com>
Mon, 20 Nov 2017 18:33:38 +0000 (18:33 +0000)
commit3309002a868382abc57804507a92be4d5c400c6d
tree2844729d23f5872375e2a70278581b28305662f9
parent37d3288cf53deb53f2ef0c3f04d513b650f8036d
[SROA] Correctly invalidate analyses when dead instructions deleted

Summary:
SROA can fail in rewriting alloca but still rewrite a phi resulting
in dead instruction elimination. The Changed flag was not being set
correctly, resulting in downstream passes using stale analyses.
The included test case will assert during the second BDCE pass as a
result.

Subscribers: llvm-commits

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

llvm-svn: 318677
llvm/include/llvm/Transforms/Scalar/SROA.h
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/dead-inst.ll [new file with mode: 0644]