[llvm] f475f08 - [RISCV][P-ext] Combine repeated code. NFC (#228163)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 21:47:35 PDT 2026


Author: Craig Topper
Date: 2026-10-02T21:47:28-07:00
New Revision: f475f085bf7ba0429d7a583a591a332eb1e56df3

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

LOG: [RISCV][P-ext] Combine repeated code. NFC (#228163)

The body of these 2 if statements are identical and the if conditions
are equivalent to checking if the VT is XLenVT.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index c96a481705cec..3892e62f715cf 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -13194,12 +13194,7 @@ SDValue RISCVTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
       return DAG.getNode(ISD::BUILD_VECTOR, DL, VT, Lo, Hi);
     }
 
-    if (VT == MVT::i32 && !Subtarget.is64Bit()) {
-      unsigned Opc = getRVPQFormatAccScalarOpcode(IntNo);
-      return DAG.getNode(Opc, DL, XLenVT, Rd, Rs1, Rs2);
-    }
-
-    if (VT == MVT::i64 && Subtarget.is64Bit()) {
+    if (VT == XLenVT) {
       unsigned Opc = getRVPQFormatAccScalarOpcode(IntNo);
       return DAG.getNode(Opc, DL, XLenVT, Rd, Rs1, Rs2);
     }


        


More information about the llvm-commits mailing list