[llvm] [RISCV] Support Inline ASM for the bf16 type. (PR #80118)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 01:04:29 PDT 2024
================
@@ -479,6 +479,12 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
// FIXME: Need to promote bf16 FCOPYSIGN to f32, but the
// DAGCombiner::visitFP_ROUND probably needs improvements first.
setOperationAction(ISD::FCOPYSIGN, MVT::bf16, Expand);
+
+ // To fold (bf16 bitcast (copyfromreg f16)) -> (copyfromreg bf16), we have
+ // to legalize the f16 CopyFromReg for avoiding SoftPromoteHalf.
+ setOperationAction(ISD::CopyFromReg, MVT::f16, Legal);
+ // Fold the (bf16 bitcast (copyfromreg f16)) -> (copyfromreg bf16).
+ setTargetDAGCombine(ISD::BITCAST);
----------------
arsenm wrote:
The bitcast handling shouldn't be strictly necessary for the asm support and should be done in a separate PR
https://github.com/llvm/llvm-project/pull/80118
More information about the llvm-commits
mailing list