Skip to content

Commit 6f0e39c

Browse files
committed
[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.
1 parent 5488e3e commit 6f0e39c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,10 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
780780
setOperationAction(ISD::BF16_TO_FP, MVT::f32, Expand);
781781
}
782782
if (STI.getSmVersion() < 90 || STI.getPTXVersion() < 78) {
783-
setOperationAction(ISD::FP_EXTEND, MVT::f64, Custom);
784-
setOperationAction(ISD::FP_ROUND, MVT::bf16, Custom);
783+
for (MVT VT : {MVT::bf16, MVT::f32, MVT::f64}) {
784+
setOperationAction(ISD::FP_EXTEND, VT, Custom);
785+
setOperationAction(ISD::FP_ROUND, VT, Custom);
786+
}
785787
setOperationAction(ISD::BF16_TO_FP, MVT::f64, Custom);
786788
}
787789

0 commit comments

Comments
 (0)