From 332ba6e124b85e27a75ec50206f8d9a17257aaa0 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 28 Sep 2017 15:53:27 +0000 Subject: [PATCH] Use SDValue::getConstantOperandVal helper. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314425 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index e78f70cc52c..c6d41452e0c 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -30228,7 +30228,7 @@ static bool combineBitcastForMaskedOp(SDValue OrigOp, SelectionDAG &DAG, case X86ISD::VALIGN: { if (EltVT != MVT::i32 && EltVT != MVT::i64) return false; - uint64_t Imm = cast(Op.getOperand(2))->getZExtValue(); + uint64_t Imm = Op.getConstantOperandVal(2); MVT OpEltVT = Op.getSimpleValueType().getVectorElementType(); unsigned ShiftAmt = Imm * OpEltVT.getSizeInBits(); unsigned EltSize = EltVT.getSizeInBits(); @@ -30256,7 +30256,7 @@ static bool combineBitcastForMaskedOp(SDValue OrigOp, SelectionDAG &DAG, // Only change element size, not type. if (EltVT.isInteger() != OpEltVT.isInteger()) return false; - uint64_t Imm = cast(Op.getOperand(2))->getZExtValue(); + uint64_t Imm = Op.getConstantOperandVal(2); Imm = (Imm * OpEltVT.getSizeInBits()) / EltSize; SDValue Op0 = DAG.getBitcast(VT, Op.getOperand(0)); DCI.AddToWorklist(Op0.getNode()); @@ -35813,7 +35813,7 @@ static SDValue combineInsertSubvector(SDNode *N, SelectionDAG &DAG, if (SubVec.getOpcode() == ISD::EXTRACT_SUBVECTOR && SubVec.getOperand(0).getSimpleValueType() == OpVT && (IdxVal != 0 || !Vec.isUndef())) { - int ExtIdxVal = cast(SubVec.getOperand(1))->getZExtValue(); + int ExtIdxVal = SubVec.getConstantOperandVal(1); if (ExtIdxVal != 0) { int VecNumElts = OpVT.getVectorNumElements(); int SubVecNumElts = SubVecVT.getVectorNumElements(); -- 2.40.0