[llvm] ab6d5fa - [Sparc] Use isNullConstant (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 14 21:01:06 PDT 2023


Author: Kazu Hirata
Date: 2023-10-14T21:00:59-07:00
New Revision: ab6d5fa3d0643e68d6ec40d9190f20fb14190ed1

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

LOG: [Sparc] Use isNullConstant (NFC)

Added: 
    

Modified: 
    llvm/lib/Target/Sparc/SparcISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
index b6afb8d5a6de9f9..4f0801479211059 100644
--- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp
+++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
@@ -2604,9 +2604,8 @@ static SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG,
   if (LHS.getValueType().isInteger()) {
     // On V9 processors running in 64-bit mode, if CC compares two `i64`s
     // and the RHS is zero we might be able to use a specialized branch.
-    const ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(RHS);
-    if (is64Bit && isV9 && LHS.getValueType() == MVT::i64 && RHSC &&
-        RHSC->isZero() && !ISD::isUnsignedIntSetCC(CC))
+    if (is64Bit && isV9 && LHS.getValueType() == MVT::i64 &&
+        isNullConstant(RHS) && !ISD::isUnsignedIntSetCC(CC))
       return DAG.getNode(SPISD::BR_REG, dl, MVT::Other, Chain, Dest,
                          DAG.getConstant(intCondCCodeToRcond(CC), dl, MVT::i32),
                          LHS);


        


More information about the llvm-commits mailing list