This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Don't transform illegal intrinsics to V_ILLEGAL
ClosedPublic

Authored by foad on Apr 12 2023, 6:29 AM.

Details

Summary

This reverts parts of D123693. The functionality of allowing unsupported
intrinsics to select has been superseded by D139000 "Remove function
with incompatible features".

Retain assembler/disassembler support for v_illegal on GFX10+ only,
where it is documented.

Diff Detail

Event Timeline

foad created this revision.Apr 12 2023, 6:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 6:29 AM
foad requested review of this revision.Apr 12 2023, 6:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 6:29 AM

Thanks for putting this up. LGTM, but I think someone should verify that device libs can be correctly built with the patch.

arsenm added inline comments.Apr 12 2023, 3:10 PM
llvm/lib/Target/AMDGPU/SIInstructions.td
3640–3656

We should still recognize the encoded instructions (at least of gfx10 where it's defined)

foad added inline comments.Apr 13 2023, 1:16 AM
llvm/lib/Target/AMDGPU/SIInstructions.td
3640–3656

They should have been added in a separate patch.

foad updated this revision to Diff 513106.Apr 13 2023, 1:53 AM

Retain v_illegal for GFX10+.

foad retitled this revision from [AMDGPU] Revert "Transform illegal intrinsics to V_ILLEGAL" to [AMDGPU] Don't transform illegal intrinsics to V_ILLEGAL.Apr 13 2023, 1:54 AM
foad edited the summary of this revision. (Show Details)

If I understand correctly, the instruction exists pre-GFX10 but isn't documented?
Would it be worth keeping it in just for completeness? It seems rather harmless.

foad added a comment.Apr 17 2023, 4:00 AM

If I understand correctly, the instruction exists pre-GFX10 but isn't documented?

I think "the instruction exists" is a meaningless concept when you're talking about an illegal instruction. The *only* reason for mapping v_illegal to a particular opcode is if it is documented as such.

Pierre-vh accepted this revision.Apr 18 2023, 5:25 AM

LGTM but please wait to see if @arsenm has any other comments

This revision is now accepted and ready to land.Apr 18 2023, 5:25 AM
This revision was landed with ongoing or failed builds.Apr 19 2023, 2:00 AM
This revision was automatically updated to reflect the committed changes.
llvm/test/CodeGen/AMDGPU/unsupported-image-sample.ll