summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorSteve King <steve@metrokings.com>2015-08-25 02:31:21 +0000
committerSteve King <steve@metrokings.com>2015-08-25 02:31:21 +0000
commit5cdbd20cc335f8bd4762e929b8c3658ee531318f (patch)
treefaff8b1358d910919faab4bc7c2983b55e6a4d27 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent9b33e28270a2796ed434de8c43ddb7d1a7daa5fa (diff)
downloadbcm5719-llvm-5cdbd20cc335f8bd4762e929b8c3658ee531318f.tar.gz
bcm5719-llvm-5cdbd20cc335f8bd4762e929b8c3658ee531318f.zip
Pass function attributes instead of boolean in isIntDivCheap().
llvm-svn: 245921
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index ffffaf0fe6f..88ace8f5051 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -2725,6 +2725,16 @@ static SDValue BuildExactSDIV(const TargetLowering &TLI, SDValue Op1, APInt d,
return Mul;
}
+SDValue TargetLowering::BuildSDIVPow2(SDNode *N, const APInt &Divisor,
+ SelectionDAG &DAG,
+ std::vector<SDNode *> *Created) const {
+ AttributeSet Attr = DAG.getMachineFunction().getFunction()->getAttributes();
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
+ if (TLI.isIntDivCheap(N->getValueType(0), Attr))
+ return SDValue(N,0); // Lower SDIV as SDIV
+ return SDValue();
+}
+
/// \brief Given an ISD::SDIV node expressing a divide by constant,
/// return a DAG expression to select that will generate the same value by
/// multiplying by a magic number.
OpenPOWER on IntegriCloud