This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Allow 8,16 bit sources in calculateSrcByte
ClosedPublic

Authored by jrbyrnes on Jul 20 2023, 10:20 AM.

Details

Summary

This is required for many trees produced in practice for i8 CodeGen.

Diff Detail

Event Timeline

jrbyrnes created this revision.Jul 20 2023, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 10:20 AM
jrbyrnes requested review of this revision.Jul 20 2023, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 10:20 AM
arsenm added inline comments.Jul 20 2023, 4:59 PM
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
10431

Calling this "Src" is a bit confusing given you handle cast operations here and this is the Dest for them

10599

I'd hope this is unreachable

10700

there are stripBitcast helpers around

10889

I think isByteSized works

jrbyrnes updated this revision to Diff 543685.Jul 24 2023, 1:37 PM
jrbyrnes marked 4 inline comments as done.

Address comments + rework "hasEightBitAccesses".

hasEightBitAccesses is really just a heuristic to stop combinations of type:

s_mov mask, 0x01000504
v_perm d, v1, v0, mask

when we can instead do:

v_lshl_or d, v0, 16, v1

These will occur iff both operands have ultimate srcs that are exactly 16 bit, and they are addressed as 16 bit operands in the relevant or (that is, they havent been byte extracted / shuffled).

jrbyrnes edited the summary of this revision. (Show Details)Jul 24 2023, 1:38 PM
arsenm accepted this revision.Jul 26 2023, 2:19 PM
This revision is now accepted and ready to land.Jul 26 2023, 2:19 PM
This revision was automatically updated to reflect the committed changes.