summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-08-07 14:40:21 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-08-07 14:40:21 +0000
commit6943e3935396033f1a91451d93f8745853ee1615 (patch)
treea6c3df3f0af195326c3348cc7a98a66362efbbc8 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent1fe337562001e9d1a4b7eefe5ba1909179ba3463 (diff)
downloadbcm5719-llvm-6943e3935396033f1a91451d93f8745853ee1615.tar.gz
bcm5719-llvm-6943e3935396033f1a91451d93f8745853ee1615.zip
[TargetLowering] Use pre-computed Shift value type in BuildUDIV (NFCI)
This was missed in D49248 llvm-svn: 339146
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 7cd913a866f..d3d13a21043 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -3551,10 +3551,8 @@ SDValue TargetLowering::BuildUDIV(SDNode *N, SelectionDAG &DAG,
bool IsAfterLegalization,
SmallVectorImpl<SDNode *> &Created) const {
SDLoc dl(N);
- auto &DL = DAG.getDataLayout();
-
EVT VT = N->getValueType(0);
- EVT ShVT = getShiftAmountTy(VT, DL);
+ EVT ShVT = getShiftAmountTy(VT, DAG.getDataLayout());
// Check to see if we can do this.
// FIXME: We should be more aggressive here.
@@ -3669,13 +3667,11 @@ SDValue TargetLowering::BuildUDIV(SDNode *N, SelectionDAG &DAG,
// For vectors we might have a mix of non-NPQ/NPQ paths, so use
// MULHU to act as a SRL-by-1 for NPQ, else multiply by zero.
- if (VT.isVector()) {
+ if (VT.isVector())
NPQ = GetMULHU(NPQ, NPQFactor);
- } else {
- NPQ = DAG.getNode(
- ISD::SRL, dl, VT, NPQ,
- DAG.getConstant(1, dl, getShiftAmountTy(NPQ.getValueType(), DL)));
- }
+ else
+ NPQ = DAG.getNode(ISD::SRL, dl, VT, NPQ, DAG.getConstant(1, dl, ShVT));
+
Created.push_back(NPQ.getNode());
Q = DAG.getNode(ISD::ADD, dl, VT, NPQ, Q);
OpenPOWER on IntegriCloud