aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-01-30 18:24:20 +0000
committerDuncan Sands <baldrick@free.fr>2011-01-30 18:24:20 +0000
commit7af00c0f6e4a5612a2438269a6f8a71b0ae9190e (patch)
tree596576f7d968d8d27fce35adfd8ea828324925e0
parent1895e98ef38afbe011575cc25f4889d96e37421b (diff)
downloadexternal_llvm-7af00c0f6e4a5612a2438269a6f8a71b0ae9190e.zip
external_llvm-7af00c0f6e4a5612a2438269a6f8a71b0ae9190e.tar.gz
external_llvm-7af00c0f6e4a5612a2438269a6f8a71b0ae9190e.tar.bz2
Commit 124487 broke 254.gap. See if disabling the part that might be triggered
by PR9088 fixes things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124561 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/InstructionSimplify.cpp10
-rw-r--r--test/Transforms/InstSimplify/2010-12-20-Reassociate.ll4
2 files changed, 5 insertions, 9 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index fcbc6d5..a907150 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -804,11 +804,11 @@ static Value *SimplifyDiv(unsigned Opcode, Value *Op0, Value *Op1,
Value *X = 0, *Y = 0;
if (match(Op0, m_Mul(m_Value(X), m_Value(Y))) && (X == Op1 || Y == Op1)) {
if (Y != Op1) std::swap(X, Y); // Ensure expression is (X * Y) / Y, Y = Op1
- BinaryOperator *Mul = cast<BinaryOperator>(Op0);
- // If the Mul knows it does not overflow, then we are good to go.
- if ((isSigned && Mul->hasNoSignedWrap()) ||
- (!isSigned && Mul->hasNoUnsignedWrap()))
- return X;
+// BinaryOperator *Mul = cast<BinaryOperator>(Op0);
+// // If the Mul knows it does not overflow, then we are good to go.
+// if ((isSigned && Mul->hasNoSignedWrap()) ||
+// (!isSigned && Mul->hasNoUnsignedWrap()))
+// return X;
// If X has the form X = A / Y then X * Y cannot overflow.
if (BinaryOperator *Div = dyn_cast<BinaryOperator>(X))
if (Div->getOpcode() == Opcode && Div->getOperand(1) == Y)
diff --git a/test/Transforms/InstSimplify/2010-12-20-Reassociate.ll b/test/Transforms/InstSimplify/2010-12-20-Reassociate.ll
index 928442a..c0ae257 100644
--- a/test/Transforms/InstSimplify/2010-12-20-Reassociate.ll
+++ b/test/Transforms/InstSimplify/2010-12-20-Reassociate.ll
@@ -92,12 +92,10 @@ define i32 @sub3(i32 %x, i32 %y) {
}
define i32 @sdiv1(i32 %x, i32 %y) {
-; CHECK: @sdiv1
; (no overflow X * Y) / Y -> X
%mul = mul nsw i32 %x, %y
%r = sdiv i32 %mul, %y
ret i32 %r
-; CHECK: ret i32 %x
}
define i32 @sdiv2(i32 %x, i32 %y) {
@@ -138,12 +136,10 @@ define i32 @sdiv5(i32 %x, i32 %y) {
}
define i32 @udiv1(i32 %x, i32 %y) {
-; CHECK: @udiv1
; (no overflow X * Y) / Y -> X
%mul = mul nuw i32 %x, %y
%r = udiv i32 %mul, %y
ret i32 %r
-; CHECK: ret i32 %x
}
define i32 @udiv2(i32 %x, i32 %y) {