This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Extend CalculateByteProvider to capture vectors and signed
ClosedPublic

Authored by jrbyrnes on Aug 4 2023, 1:25 PM.

Details

Summary

Trees often involve extract i8 / i16s, and ultimate sources may come from extract i32s. Capturing trees that involve e.g. SIGN_EXTEND has limited impact on combining into perms, but significantly helps for combining trees for arithmetic ops (e.g. v_dot4)

Diff Detail

Event Timeline

jrbyrnes created this revision.Aug 4 2023, 1:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2023, 1:25 PM
jrbyrnes requested review of this revision.Aug 4 2023, 1:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2023, 1:25 PM
arsenm added inline comments.Aug 4 2023, 1:44 PM
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
10461

handling any_extend here seems dangerous, can you do that in a separate patch? It might be correct but I'd rather keep it separate

10473

getStoreSize

jrbyrnes updated this revision to Diff 547379.Aug 4 2023, 3:39 PM
jrbyrnes marked 2 inline comments as done.

Address comments + remove redundant ValueSize checks and handling

llvm/lib/Target/AMDGPU/SIISelLowering.cpp
10461

No problem -- I would think it is correct as we only ever take the non extension bits. Either way, I'll look at it separately.

jrbyrnes updated this revision to Diff 547380.Aug 4 2023, 3:44 PM

Remove remaining redundant code.

arsenm added inline comments.Aug 7 2023, 2:21 PM
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
10681

Unchecked dyn_cast, this will break on variable indexes

llvm/test/CodeGen/AMDGPU/permute_i8.ll
2786

Need test with a variable index

jrbyrnes updated this revision to Diff 548395.Aug 8 2023, 4:24 PM

Fix Extract element id handling

arsenm accepted this revision.Aug 11 2023, 7:10 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
10943–10944

this could probably be just return the getBitcast

10951–10953

ditto

This revision is now accepted and ready to land.Aug 11 2023, 7:10 AM
This revision was landed with ongoing or failed builds.Aug 11 2023, 8:59 AM
This revision was automatically updated to reflect the committed changes.
jrbyrnes marked an inline comment as done.