summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-10-12 15:48:47 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-10-12 15:48:47 +0000
commitb926fd7b3618f5facfa8d574b34e789a028e6bfb (patch)
tree40765697cf2d627894d68412ef76214eef3f72db /llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
parentf5b18923483fd6a033acd60b8036bd9d6642ccbd (diff)
downloadbcm5719-llvm-b926fd7b3618f5facfa8d574b34e789a028e6bfb.tar.gz
bcm5719-llvm-b926fd7b3618f5facfa8d574b34e789a028e6bfb.zip
Pull out repeated value types. NFCI.
llvm-svn: 344354
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
index 852415647b1..8cc37b5f233 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
@@ -1079,7 +1079,7 @@ SDValue VectorLegalizer::ExpandCTLZ(SDValue Op) {
if (Op.getOpcode() == ISD::CTLZ_ZERO_UNDEF &&
TLI.isOperationLegalOrCustom(ISD::CTLZ, VT)) {
SDLoc DL(Op);
- return DAG.getNode(ISD::CTLZ, DL, Op.getValueType(), Op.getOperand(0));
+ return DAG.getNode(ISD::CTLZ, DL, VT, Op.getOperand(0));
}
// If we have the appropriate vector bit operations, it is better to use them
@@ -1095,10 +1095,12 @@ SDValue VectorLegalizer::ExpandCTLZ(SDValue Op) {
}
SDValue VectorLegalizer::ExpandCTTZ_ZERO_UNDEF(SDValue Op) {
+ EVT VT = Op.getValueType();
+
// If the non-ZERO_UNDEF version is supported we can use that instead.
- if (TLI.isOperationLegalOrCustom(ISD::CTTZ, Op.getValueType())) {
+ if (TLI.isOperationLegalOrCustom(ISD::CTTZ, VT)) {
SDLoc DL(Op);
- return DAG.getNode(ISD::CTTZ, DL, Op.getValueType(), Op.getOperand(0));
+ return DAG.getNode(ISD::CTTZ, DL, VT, Op.getOperand(0));
}
// Otherwise go ahead and unroll.
OpenPOWER on IntegriCloud