[llvm] r369410 - [X86] Use isNullConstant instead of getConstantOperandVal == 0. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 09:55:12 PDT 2019


Author: ctopper
Date: Tue Aug 20 09:55:12 2019
New Revision: 369410

URL: http://llvm.org/viewvc/llvm-project?rev=369410&view=rev
Log:
[X86] Use isNullConstant instead of getConstantOperandVal == 0. 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=369410&r1=369409&r2=369410&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Aug 20 09:55:12 2019
@@ -44293,10 +44293,10 @@ static SDValue combineInsertSubvector(SD
     // least as large as the original insertion. Just insert the original
     // subvector into a zero vector.
     if (SubVec.getOpcode() == ISD::EXTRACT_SUBVECTOR && IdxVal == 0 &&
-        SubVec.getConstantOperandAPInt(1) == 0 &&
+        isNullConstant(SubVec.getOperand(1)) &&
         SubVec.getOperand(0).getOpcode() == ISD::INSERT_SUBVECTOR) {
       SDValue Ins = SubVec.getOperand(0);
-      if (Ins.getConstantOperandAPInt(2) == 0 &&
+      if (isNullConstant(Ins.getOperand(2)) &&
           ISD::isBuildVectorAllZeros(Ins.getOperand(0).getNode()) &&
           Ins.getOperand(1).getValueSizeInBits() <= SubVecVT.getSizeInBits())
         return DAG.getNode(ISD::INSERT_SUBVECTOR, dl, OpVT,




More information about the llvm-commits mailing list