[llvm] d44b6be - [RISCV] Don't Custom legalize f16/f32/f64 bitcasts if those types aren't Legal.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 22 11:56:13 PST 2022
Author: Craig Topper
Date: 2022-01-22T11:55:18-08:00
New Revision: d44b6be6eaa8c165d3526d61dcc0f1c459e5722f
URL: https://github.com/llvm/llvm-project/commit/d44b6be6eaa8c165d3526d61dcc0f1c459e5722f
DIFF: https://github.com/llvm/llvm-project/commit/d44b6be6eaa8c165d3526d61dcc0f1c459e5722f.diff
LOG: [RISCV] Don't Custom legalize f16/f32/f64 bitcasts if those types aren't 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 e1f1c49094424..411191343cf04 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -1025,9 +1025,12 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
setOperationAction(ISD::BITCAST, MVT::i16, Custom);
setOperationAction(ISD::BITCAST, MVT::i32, Custom);
setOperationAction(ISD::BITCAST, MVT::i64, Custom);
- setOperationAction(ISD::BITCAST, MVT::f16, Custom);
- setOperationAction(ISD::BITCAST, MVT::f32, Custom);
- setOperationAction(ISD::BITCAST, MVT::f64, Custom);
+ if (Subtarget.hasStdExtZfh())
+ setOperationAction(ISD::BITCAST, MVT::f16, Custom);
+ if (Subtarget.hasStdExtF())
+ setOperationAction(ISD::BITCAST, MVT::f32, Custom);
+ if (Subtarget.hasStdExtD())
+ setOperationAction(ISD::BITCAST, MVT::f64, Custom);
}
}
More information about the llvm-commits
mailing list