summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-28 06:24:31 +0000
committerChris Lattner <sabre@nondot.org>2007-12-28 06:24:31 +0000
commit5179819beb544c355c6a314f0569ed6b799b8d30 (patch)
tree50a5a0be459d4c878f0f3b7d8f9bf36d43da5bfa /llvm/lib
parent7ef31d3c53e862a6a7c01beac3e2ad889309334b (diff)
downloadbcm5719-llvm-5179819beb544c355c6a314f0569ed6b799b8d30.tar.gz
bcm5719-llvm-5179819beb544c355c6a314f0569ed6b799b8d30.zip
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. llvm-svn: 45383
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index d4278e3a7c7..fc1443a9be8 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -4835,9 +4835,11 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
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;
OpenPOWER on IntegriCloud