[llvm] 6f0e39c - [NVPTX] Set ISD::FP_{EXTEND, ROUND} to Custom for more types
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 10:27:55 PST 2024
Author: David Majnemer
Date: 2024-02-21T18:26:37Z
New Revision: 6f0e39c4239bb4c0980a048e264f61bded147388
URL: https://github.com/llvm/llvm-project/commit/6f0e39c4239bb4c0980a048e264f61bded147388
DIFF: https://github.com/llvm/llvm-project/commit/6f0e39c4239bb4c0980a048e264f61bded147388.diff
LOG: [NVPTX] Set ISD::FP_{EXTEND,ROUND} to Custom for more types
Sometimes those nodes are queried with the non-bf16. We need to request
to SDAG that we want to handle the non-bf16 side so that the handler can
detect if bf16 is being used on either side.
Added:
Modified:
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index ef3b61fbd0dea2..63920a1db25c8c 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -780,8 +780,10 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
setOperationAction(ISD::BF16_TO_FP, MVT::f32, Expand);
}
if (STI.getSmVersion() < 90 || STI.getPTXVersion() < 78) {
- setOperationAction(ISD::FP_EXTEND, MVT::f64, Custom);
- setOperationAction(ISD::FP_ROUND, MVT::bf16, Custom);
+ for (MVT VT : {MVT::bf16, MVT::f32, MVT::f64}) {
+ setOperationAction(ISD::FP_EXTEND, VT, Custom);
+ setOperationAction(ISD::FP_ROUND, VT, Custom);
+ }
setOperationAction(ISD::BF16_TO_FP, MVT::f64, Custom);
}
More information about the llvm-commits
mailing list