Skip to content

Commit f08a196

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

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,11 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(const TargetMachine &TM,
423423
setOperationAction({ISD::FLOG10, ISD::FLOG, ISD::FEXP, ISD::FEXP10}, MVT::f16,
424424
Custom);
425425

426+
setOperationAction(ISD::FCANONICALIZE, {MVT::f32, MVT::f64}, Legal);
427+
if (Subtarget->has16BitInsts()) {
428+
setOperationAction(ISD::FCANONICALIZE, MVT::f16, Legal);
429+
}
430+
426431
// FIXME: These IS_FPCLASS vector fp types are marked custom so it reaches
427432
// scalarization code. Can be removed when IS_FPCLASS expand isn't called by
428433
// default unless marked custom/legal.

0 commit comments

Comments
 (0)