[llvm] r315159 - [X86] Use getConstantOperandVal to simplify some code. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 7 18:33:39 PDT 2017
Author: ctopper
Date: Sat Oct 7 18:33:38 2017
New Revision: 315159
URL: http://llvm.org/viewvc/llvm-project?rev=315159&view=rev
Log:
[X86] Use getConstantOperandVal to simplify some code. NFC
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=315159&r1=315158&r2=315159&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Oct 7 18:33:38 2017
@@ -36112,9 +36112,8 @@ static SDValue combineInsertSubvector(SD
SDLoc dl(N);
SDValue Vec = N->getOperand(0);
SDValue SubVec = N->getOperand(1);
- SDValue Idx = N->getOperand(2);
- unsigned IdxVal = cast<ConstantSDNode>(Idx)->getZExtValue();
+ unsigned IdxVal = N->getConstantOperandVal(2);
MVT SubVecVT = SubVec.getSimpleValueType();
if (ISD::isBuildVectorAllZeros(Vec.getNode())) {
@@ -36220,7 +36219,8 @@ static SDValue combineInsertSubvector(SD
Vec = DAG.getNode(ISD::INSERT_SUBVECTOR, dl, OpVT, DAG.getUNDEF(OpVT),
SubVec2, Vec.getOperand(2));
DCI.AddToWorklist(Vec.getNode());
- return DAG.getNode(ISD::INSERT_SUBVECTOR, dl, OpVT, Vec, SubVec, Idx);
+ return DAG.getNode(ISD::INSERT_SUBVECTOR, dl, OpVT, Vec, SubVec,
+ N->getOperand(2));
}
}
More information about the llvm-commits
mailing list