At -O0, multiple uses of a virtual registers in the same BB are being marked
"kill". This looks like a bug upstream. Since that's going to take some time
to understand, loosen the assertion and disable the optimization when
multiple kills are seen.
llvm-svn: 144568
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 33ed4cc..a702c6c 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -502,7 +502,8 @@
continue;
if (!UI.getOperand().isKill())
return 0;
- assert(!KillMI && "More than one local kills?");
+ if (KillMI)
+ return 0; // -O0 kill markers cannot be trusted?
KillMI = UseMI;
}