[llvm-commits] [llvm] r45383 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
sabre at nondot.org
Thu Dec 27 22:24:32 PST 2007
Author: lattner
Date: Fri Dec 28 00:24:31 2007
New Revision: 45383
URL: http://llvm.org/viewvc/llvm-project?rev=45383&view=rev
Log:
disable this instcombine xform, it miscompiles:
define i32 @main() {
entry:
%z = alloca i32 ; <i32*> [#uses=2]
store i32 0, i32* %z
%tmp = load i32* %z ; <i32> [#uses=1]
%sub = sub i32 %tmp, 1 ; <i32> [#uses=1]
%cmp = icmp ult i32 %sub, 0 ; <i1> [#uses=1]
%retval = select i1 %cmp, i32 1, i32 0 ; <i32> [#uses=1]
ret i32 %retval
}
into ret 1, instead of ret 0.
Christopher, please investigate.
Modified:
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=45383&r1=45382&r2=45383&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Fri Dec 28 00:24:31 2007
@@ -4835,9 +4835,11 @@
if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) {
Value *A, *B;
+#if 0
// (icmp cond (sub A B) 0) -> (icmp cond A B)
if (CI->isNullValue() && match(Op0, m_Sub(m_Value(A), m_Value(B))))
return new ICmpInst(I.getPredicate(), A, B);
+#endif
switch (I.getPredicate()) {
default: break;
More information about the llvm-commits
mailing list