[llvm] 04a09b9 - [X86] Use isNullConstantOrUndef helper. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 10:13:44 PDT 2024


Author: Simon Pilgrim
Date: 2024-06-12T18:13:30+01:00
New Revision: 04a09b9b0c6da9adc8662ec46c8d2487b73cb5e4

URL: https://github.com/llvm/llvm-project/commit/04a09b9b0c6da9adc8662ec46c8d2487b73cb5e4
DIFF: https://github.com/llvm/llvm-project/commit/04a09b9b0c6da9adc8662ec46c8d2487b73cb5e4.diff

LOG: [X86] Use isNullConstantOrUndef helper. NFC.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index ba6a12859e367..06839b662c127 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -7330,9 +7330,8 @@ static SDValue lowerBuildVectorAsBroadcast(BuildVectorSDNode *BVOp,
     unsigned SeqLen = Sequence.size();
     bool UpperZeroOrUndef =
         SeqLen == 1 ||
-        llvm::all_of(ArrayRef(Sequence).drop_front(), [](SDValue V) {
-          return !V || V.isUndef() || isNullConstant(V);
-        });
+        llvm::all_of(ArrayRef(Sequence).drop_front(),
+                     [](SDValue V) { return !V || isNullConstantOrUndef(V); });
     SDValue Op0 = Sequence[0];
     if (UpperZeroOrUndef && ((Op0.getOpcode() == ISD::BITCAST) ||
                              (Op0.getOpcode() == ISD::ZERO_EXTEND &&
@@ -43741,7 +43740,7 @@ static SDValue combineBitcast(SDNode *N, SelectionDAG &DAG,
       for (unsigned i = 1, e = SrcVT.getVectorNumElements(); i != e; ++i) {
         SDValue Op = N0.getOperand(i);
         LowUndef &= Op.isUndef() || (i >= e/2);
-        AllUndefOrZero &= (Op.isUndef() || isNullConstant(Op));
+        AllUndefOrZero &= isNullConstantOrUndef(Op);
       }
       if (AllUndefOrZero) {
         SDValue N00 = N0.getOperand(0);


        


More information about the llvm-commits mailing list