[llvm] d42992e - [RISCV] Cleanup setOperationAction for ISD::BITCAST with Zfa and D extension. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 10:44:13 PDT 2024


Author: Craig Topper
Date: 2024-03-20T10:43:54-07:00
New Revision: d42992e71c660d57c89056f6ee4a5be74fa4d1f4

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

LOG: [RISCV] Cleanup setOperationAction for ISD::BITCAST with Zfa and D extension. NFC

We only need Custom handling for i64 on RV32. This will be used by
type legalization. We don't need to make it custom for f64 to get
type legalization to custom split i64.

If f64 and i64 are legal types, then ISD::BITCAST should be legal.

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 25f035e6dd9de1..3aa28215efc23c 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -562,8 +562,8 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
     if (Subtarget.hasStdExtZfa()) {
       setOperationAction(FPRndMode, MVT::f64, Legal);
       setOperationAction(ISD::FNEARBYINT, MVT::f64, Legal);
-      setOperationAction(ISD::BITCAST, MVT::i64, Custom);
-      setOperationAction(ISD::BITCAST, MVT::f64, Custom);
+      if (!Subtarget.is64Bit())
+        setOperationAction(ISD::BITCAST, MVT::i64, Custom);
     } else {
       if (Subtarget.is64Bit())
         setOperationAction(FPRndMode, MVT::f64, Custom);


        


More information about the llvm-commits mailing list