[llvm] r338530 - [X86] Use isNullConstant helper. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 06:06:14 PDT 2018


Author: rksimon
Date: Wed Aug  1 06:06:14 2018
New Revision: 338530

URL: http://llvm.org/viewvc/llvm-project?rev=338530&view=rev
Log:
[X86] Use isNullConstant helper. NFCI.

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=338530&r1=338529&r2=338530&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Aug  1 06:06:14 2018
@@ -39472,8 +39472,7 @@ static SDValue combineInsertSubvector(SD
   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))) {




More information about the llvm-commits mailing list