This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Handle new address pattern in LowerKernelAttributes introduced by opaque pointers
ClosedPublic

Authored by cfang on Sep 24 2022, 5:55 PM.

Details

Summary

With opaque pointer support, the "ptr" type is introduced and thus BitCast is not necessary in some cases.
This work takes care of this change, and recognizes the new address patterns to do appropriate optimizations.

Diff Detail

Event Timeline

cfang created this revision.Sep 24 2022, 5:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2022, 5:55 PM
cfang requested review of this revision.Sep 24 2022, 5:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2022, 5:55 PM
arsenm added inline comments.Sep 25 2022, 12:08 PM
llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp
114

Would be shorter to check for bitcast first

121

Typo LOad

llvm/test/CodeGen/AMDGPU/implicit-arg-v5-opt-opaque-ptr.ll
3

Don’t need -O3 or the code object flag

cfang marked 2 inline comments as done.Sep 25 2022, 3:56 PM
cfang added inline comments.
llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp
114

Cannot see how it can be shorter. However, I have a new approach which seems more readable.

121

Done. Thanks.

llvm/test/CodeGen/AMDGPU/implicit-arg-v5-opt-opaque-ptr.ll
3

Removed -O3. The code object version flag is still needed because v5 is not default, and the module flag approach is not ready yet.
Will update together with other 79 tests when ready.

cfang updated this revision to Diff 462776.Sep 25 2022, 4:13 PM
cfang marked 2 inline comments as done.

Updated based on arsenm's comments.

arsenm accepted this revision.Sep 26 2022, 6:57 AM
This revision is now accepted and ready to land.Sep 26 2022, 6:57 AM