summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorJesper Antonsson <jesper.antonsson@ericsson.com>2019-09-27 13:01:37 +0000
committerJesper Antonsson <jesper.antonsson@ericsson.com>2019-09-27 13:01:37 +0000
commit39b81f1cbc3cead2e065e5d65692dca47de1b6c2 (patch)
tree80ec61a9916877a349b0b426038b4591fd73d820 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent9431b72ce9e2dee9eddc71cff34f5fdaf853e9d4 (diff)
downloadbcm5719-llvm-39b81f1cbc3cead2e065e5d65692dca47de1b6c2.tar.gz
bcm5719-llvm-39b81f1cbc3cead2e065e5d65692dca47de1b6c2.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index b3a6e284f4f..c74428051b2 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -3332,7 +3332,7 @@ private:
// So the values are different and does not match. So we need them to
// match. (But we register no more than one match per PHI node, so that
// we won't later try to replace them twice.)
- if (!MatchedPHIs.insert(FirstPhi).second)
+ if (MatchedPHIs.insert(FirstPhi).second)
Matcher.insert({ FirstPhi, SecondPhi });
// But me must check it.
WorkList.push_back({ FirstPhi, SecondPhi });
OpenPOWER on IntegriCloud