Skip to content

Commit 5e9b2dd

Browse files
[AArch64] Set fcanonicalize to Legal for f32,f64
1 parent d126bbb commit 5e9b2dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,12 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
767767
setOperationAction(Op, MVT::v8bf16, Expand);
768768
}
769769

770+
// Legalize fcanonicalize to circumvent default expansion
771+
setOperationAction(ISD::FCANONICALIZE, {MVT::f32, MVT::f64}, Legal);
772+
if (Subtarget->hasFullFP16()) {
773+
setOperationAction(ISD::FCANONICALIZE, MVT::f16, Legal);
774+
}
775+
770776
// fpextend from f16 or bf16 to f32 is legal
771777
setOperationAction(ISD::FP_EXTEND, MVT::f32, Legal);
772778
setOperationAction(ISD::FP_EXTEND, MVT::v4f32, Legal);

0 commit comments

Comments
 (0)