summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-04-09 18:32:38 +0000
committerNikita Popov <nikita.ppv@gmail.com>2019-04-09 18:32:38 +0000
commit2f5e9de8d1f80e1e94e5eaacde7ba59ba0c55ca0 (patch)
treeaebeb7cab8d6b9d1f15b430e86ba24189c30a313 /llvm/lib/Transforms
parenteda3b9326e1f68cab38a5ae7923a4a20ff020d77 (diff)
downloadbcm5719-llvm-2f5e9de8d1f80e1e94e5eaacde7ba59ba0c55ca0.tar.gz
bcm5719-llvm-2f5e9de8d1f80e1e94e5eaacde7ba59ba0c55ca0.zip
Revert "[InstCombine] [InstCombine] Canonicalize (-X s/ Y) to -(X s/ Y)."
This reverts commit 1383a9168948aabfd827220c9445ce0ce5765800. sdiv-canonicalize.ll fails after this revision. The fold needs to be moved outside the branch handling constant operands. However when this is done there are further test changes, so I'm reverting this in the meantime. llvm-svn: 358026
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 2db6e849b19..cb8708446b2 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1043,12 +1043,6 @@ Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
Value *NarrowOp = Builder.CreateSDiv(Op0Src, NarrowDivisor);
return new SExtInst(NarrowOp, Op0->getType());
}
-
- // -X / Y --> -(X / Y)
- Value *Y;
- if (match(&I, m_SDiv(m_OneUse(m_NSWSub(m_Zero(), m_Value(X))), m_Value(Y))))
- return BinaryOperator::CreateNSWNeg(
- Builder.CreateSDiv(X, Y, I.getName(), I.isExact()));
// -X / C --> X / -C (if the negation doesn't overflow).
// TODO: This could be enhanced to handle arbitrary vector constants by
OpenPOWER on IntegriCloud