[CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix.
authorJesper Antonsson <jesper.antonsson@ericsson.com>
Fri, 27 Sep 2019 13:01:37 +0000 (13:01 +0000)
committerJesper Antonsson <jesper.antonsson@ericsson.com>
Fri, 27 Sep 2019 13:01:37 +0000 (13:01 +0000)
commit39b81f1cbc3cead2e065e5d65692dca47de1b6c2
tree80ec61a9916877a349b0b426038b4591fd73d820
parent9431b72ce9e2dee9eddc71cff34f5fdaf853e9d4
[CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix.

Summary:
An erroneously negated if-statement by an earlier (March 2019) bugfix left phi replacement/simplification under optimizeMemoryInst()  in CodeGenPrepare largely inactivated. The error was found when csmith found that the same assert as in the original bug report could still be triggered in a different way. This patch fixes the bugfix. The original bug was:
 https://bugs.llvm.org/show_bug.cgi?id=41052
... and the previous fix was D59358.

Reviewers: aprantl, skatkov

Reviewed By: skatkov

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373084
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/CodeGen/X86/codegen-prepare-replacephi2.mir [new file with mode: 0644]