[PATCH] D14479: Fix bug 25440: GVN assertion after coercing loads

Weiming Zhao via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 23:22:57 PST 2015


weimingz created this revision.
weimingz added a subscriber: llvm-commits.

when coercing loads, it inserts some instructions, which have no GV assigned.

https://llvm.org/bugs/show_bug.cgi?id=25440


http://reviews.llvm.org/D14479

Files:
  lib/Transforms/Scalar/GVN.cpp

Index: lib/Transforms/Scalar/GVN.cpp
===================================================================
--- lib/Transforms/Scalar/GVN.cpp
+++ lib/Transforms/Scalar/GVN.cpp
@@ -2529,7 +2529,7 @@
     if (isa<Argument>(Op) || isa<Constant>(Op) || isa<GlobalValue>(Op))
       continue;
 
-    if (Value *V = findLeader(Pred, VN.lookup(Op))) {
+    if (Value *V = findLeader(Pred, VN.lookup_or_add(Op))) {
       Instr->setOperand(i, V);
     } else {
       success = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14479.39636.patch
Type: text/x-patch
Size: 474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151107/1968d32c/attachment.bin>


More information about the llvm-commits mailing list