OSDN Git Service

[X86] Use isNullConstant helper. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 1 Aug 2018 13:06:14 +0000 (13:06 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 1 Aug 2018 13:06:14 +0000 (13:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338530 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 981bb17..2820004 100644 (file)
@@ -39472,8 +39472,7 @@ static SDValue combineInsertSubvector(SDNode *N, SelectionDAG &DAG,
   if ((IdxVal == OpVT.getVectorNumElements() / 2) &&
       Vec.getOpcode() == ISD::INSERT_SUBVECTOR &&
       OpVT.getSizeInBits() == SubVecVT.getSizeInBits() * 2) {
-    auto *Idx2 = dyn_cast<ConstantSDNode>(Vec.getOperand(2));
-    if (Idx2 && Idx2->getZExtValue() == 0) {
+    if (isNullConstant(Vec.getOperand(2))) {
       SDValue SubVec2 = Vec.getOperand(1);
       // If needed, look through bitcasts to get to the load.
       if (auto *FirstLd = dyn_cast<LoadSDNode>(peekThroughBitcasts(SubVec2))) {