This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine][AMDGPU] Trim more components of *buffer_load
ClosedPublic

Authored by piotr on Nov 15 2019, 7:53 AM.

Details

Summary

Add trimming of unused components of s_buffer_load.

Extend trimming of *buffer_load to also include
unused components at the beginning of vectors and update offset.

Event Timeline

piotr created this revision.Nov 15 2019, 7:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2019, 7:53 AM
arsenm added inline comments.Nov 19 2019, 4:35 AM
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
989

Can you do Args(II->arg_begin(), II->arg_end())?

1038–1039

I dislike using the raw getScalarSizeInBits on the type in case these are ever used with a pointer. This should go through the datalayout. Can you also add a test that uses a pointer instead of an integer vector?

piotr updated this revision to Diff 230144.Nov 19 2019, 1:58 PM

Addressed review comments, updated var name and fixed language in a comment. Regarding the new test: the code is in the function that can only be called by SimplifyDemandedVectorElts, so only for intrinsics with vector types, not pointer type.

This revision is now accepted and ready to land.Dec 13 2019, 5:50 AM
This revision was automatically updated to reflect the committed changes.
mareko added a subscriber: mareko.Dec 18 2019, 11:31 AM

This breaks gfx8. Can you revert?

I'm trying to gather more details, but either there are bugs or the hw doesn't like it.