This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine][AMDGPU] Trim components of s_buffer_load
ClosedPublic

Authored by piotr on Dec 20 2019, 1:44 PM.

Details

Summary

Add trimming of unused components of s_buffer_load.

For s_buffer_load and unformatted buffer_load also trim unused
components at the beginning of vector and update offset accordingly.

Event Timeline

piotr created this revision.Dec 20 2019, 1:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2019, 1:44 PM
piotr added a comment.Dec 20 2019, 1:49 PM

This is another attempt to trim unused components of buffer loads. Comparing to D70315, this commit does not handle formatted buffer loads, as it is not safe.

piotr added a comment.Jan 17 2020, 7:39 AM

I intend to merge the patch soon, based on the fact that the patch was reviewed in D70315. Compared to that version, 3 problematic cases were removed and tests updated.

arsenm added a subscriber: arsenm.Jan 17 2020, 8:02 AM
arsenm added inline comments.
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
1027

I think this goes over the 80 column limit

1048

Probably shouldn't bother with the legacy intrinsic, I have a patch almost ready to remove them

1062

Line length

llvm/test/Transforms/InstCombine/AMDGPU/amdgcn-demanded-vector-elts.ll
847

Need some 8 and 16 bit element tests at least

piotr updated this revision to Diff 241081.Jan 29 2020, 2:47 AM

Addressed review comments.

Unit tests: fail. 62254 tests passed, 1 failed and 827 were skipped.

failed: libc++.std/thread/thread_mutex/thread_mutex_requirements/thread_timedmutex_requirements/thread_timedmutex_recursive/try_lock_for.pass.cpp

clang-tidy: fail. clang-tidy found 0 errors and 2 warnings. 0 of them are added as review comments below (why?).

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

piotr updated this revision to Diff 241113.Jan 29 2020, 4:37 AM

Silenced clang-tidy warnings.

Unit tests: pass. 62255 tests passed, 0 failed and 827 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

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