Index: lib/Transforms/Scalar/GVN.cpp =================================================================== --- lib/Transforms/Scalar/GVN.cpp +++ lib/Transforms/Scalar/GVN.cpp @@ -2529,7 +2529,7 @@ if (isa(Op) || isa(Op) || isa(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;