This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Select icmp intrinsic
ClosedPublic

Authored by Petar.Avramovic on Jun 26 2020, 6:00 AM.

Details

Summary

Select into corresponding V_CMP instruction based on CmpInst predicate,
stored as immediate, in last operand.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2020, 6:00 AM

If you're running into these, you should probably switch to using the new ballot intrinsics. I wasn't planning on working on this and fcmp since they're deprecated

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
1019–1020

Should fail to select rather than assert

foad added inline comments.Jun 26 2020, 7:09 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
1019–1020

I suggested this assert, based on my interpretation of your comment that there was no need to try to handle misuse of the intrinsics because they should really be checked by some kind of IR verification.

arsenm added inline comments.Jun 26 2020, 7:39 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
1019–1020

They shouldn't crash, but also shouldn't select. This matches the behavior of intrinsics on subtargets that don't really support the instruction

Replace assert with isel fail.

arsenm accepted this revision.Jun 29 2020, 7:47 AM
This revision is now accepted and ready to land.Jun 29 2020, 7:47 AM
This revision was automatically updated to reflect the committed changes.