From: Simon Pilgrim Date: Fri, 12 Oct 2018 15:48:47 +0000 (+0000) Subject: Pull out repeated value types. NFCI. X-Git-Tag: llvmorg-8.0.0-rc1~6676 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b926fd7b3618f5facfa8d574b34e789a028e6bfb;p=platform%2Fupstream%2Fllvm.git Pull out repeated value types. NFCI. llvm-svn: 344354 --- diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index 8524156..8cc37b5 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.