[llvm-commits] [llvm] r159096 - in /llvm/trunk: lib/Transforms/Scalar/Reassociate.cpp test/Transforms/Reassociate/crash.ll
Nick Lewycky
nicholas at mxc.ca
Sat Jun 23 18:44:08 PDT 2012
Author: nicholas
Date: Sat Jun 23 20:44:08 2012
New Revision: 159096
URL: http://llvm.org/viewvc/llvm-project?rev=159096&view=rev
Log:
Remove a dangling reference to a deleted instruction. Fixes PR13185!
Modified:
llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
llvm/trunk/test/Transforms/Reassociate/crash.ll
Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=159096&r1=159095&r2=159096&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Sat Jun 23 20:44:08 2012
@@ -1478,6 +1478,7 @@
SmallVector<Value*, 8> Ops(I->op_begin(), I->op_end());
// Erase the dead instruction.
ValueRankMap.erase(I);
+ RedoInsts.remove(I);
I->eraseFromParent();
// Optimize its operands.
SmallPtrSet<Instruction *, 8> Visited; // Detect self-referential nodes.
Modified: llvm/trunk/test/Transforms/Reassociate/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Reassociate/crash.ll?rev=159096&r1=159095&r2=159096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Reassociate/crash.ll (original)
+++ llvm/trunk/test/Transforms/Reassociate/crash.ll Sat Jun 23 20:44:08 2012
@@ -108,3 +108,14 @@
%z4 = add i32 %y4, %y4
ret void
}
+
+; PR13185
+define void @pr13185(i16 %p) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.cond, %entry
+ %x.0 = phi i32 [ undef, %entry ], [ %conv, %for.cond ]
+ %conv = zext i16 %p to i32
+ br label %for.cond
+}
More information about the llvm-commits
mailing list