[llvm] 2863c64 - [RISCV][NFC] Simplify ISD::SELECT Legality (#142650)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Jun  3 12:49:45 PDT 2025
    
    
  
Author: Sam Elliott
Date: 2025-06-03T12:49:42-07:00
New Revision: 2863c640fa0d8ab183b0180becf948de7becb639
URL: https://github.com/llvm/llvm-project/commit/2863c640fa0d8ab183b0180becf948de7becb639
DIFF: https://github.com/llvm/llvm-project/commit/2863c640fa0d8ab183b0180becf948de7becb639.diff
LOG: [RISCV][NFC] Simplify ISD::SELECT Legality (#142650)
ISD::SELECT is legal by default, so this change to the conditional makes
it clearer that XTHeadCondMov and XMipsCMove both leave this operation
legal rather than custom expanding it.
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 74686d9fc4188..f74ca2a1c5492 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -434,9 +434,7 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
     setOperationAction(ISD::ABS, MVT::i32, Custom);
   }
 
-  if (Subtarget.useCCMovInsn())
-    setOperationAction(ISD::SELECT, XLenVT, Legal);
-  else if (!Subtarget.hasVendorXTHeadCondMov())
+  if (!Subtarget.useCCMovInsn() && !Subtarget.hasVendorXTHeadCondMov())
     setOperationAction(ISD::SELECT, XLenVT, Custom);
 
   if (Subtarget.hasVendorXqcia() && !Subtarget.is64Bit()) {
        
    
    
More information about the llvm-commits
mailing list