This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Replace certain llvm.amdgcn.class uses with llvm.is.fpclass
ClosedPublic

Authored by arsenm on Feb 6 2023, 10:14 AM.

Details

Reviewers
foad
Pierre-vh
rampitec
Group Reviewers
Restricted Project
Summary

Most transforms should now be performed on llvm.is.fpclass. Unlike the
generic intrinsic, this supports variable test masks.

Diff Detail

Event Timeline

arsenm created this revision.Feb 6 2023, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2023, 10:14 AM
arsenm requested review of this revision.Feb 6 2023, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2023, 10:14 AM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec accepted this revision.Feb 6 2023, 10:58 AM
This revision is now accepted and ready to land.Feb 6 2023, 10:58 AM
foad added inline comments.Feb 7 2023, 2:01 AM
llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
438

I'm not convinced this is sound. E.g. if Src1 is dynamically zero (resp. all-ones) then the result should be false (resp. true) even if Src0 is undef. But that's a pre-existing problem.

rampitec added inline comments.Feb 7 2023, 2:42 AM
llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
438

In fact in the wake of Poison replacing Undef I am not sure that isa<UndefValue> is a test to go anymore.

arsenm added inline comments.Feb 7 2023, 4:58 AM
llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
438

I thought I fixed this before (maybe that’s what I implemented for the generic intrinsic). I can fix this separately