summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-07-08 12:08:24 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-07-08 12:08:24 +0000
commit2bb8b26aa836aea1f87ef5469aed325c7f202d37 (patch)
tree38716c05f1127f9a993bb8081f0c2d49af3d07ba /llvm/lib/CodeGen
parentd280754094a883a72988c3bd8bd51c5892452345 (diff)
downloadbcm5719-llvm-2bb8b26aa836aea1f87ef5469aed325c7f202d37.tar.gz
bcm5719-llvm-2bb8b26aa836aea1f87ef5469aed325c7f202d37.zip
Apparently we can't expect a BinaryOperator here.
Should fix llvm-gcc selfhost. llvm-svn: 134699
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 2a362ebfc2d..2afec3328b9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2502,14 +2502,14 @@ void SelectionDAGBuilder::visitShift(const User &I, unsigned Opcode) {
}
void SelectionDAGBuilder::visitSDiv(const User &I) {
- const BinaryOperator *BO = cast<BinaryOperator>(&I);
SDValue Op1 = getValue(I.getOperand(0));
SDValue Op2 = getValue(I.getOperand(1));
// Turn exact SDivs into multiplications.
// FIXME: This should be in DAGCombiner, but it doesn't have access to the
// exact bit.
- if (BO->isExact() && !isa<ConstantSDNode>(Op1) &&
+ if (isa<BinaryOperator>(&I) && cast<BinaryOperator>(&I)->isExact() &&
+ !isa<ConstantSDNode>(Op1) &&
isa<ConstantSDNode>(Op2) && !cast<ConstantSDNode>(Op2)->isNullValue())
setValue(&I, TLI.BuildExactSDIV(Op1, Op2, getCurDebugLoc(), DAG));
else
OpenPOWER on IntegriCloud