This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Optimized indirect multi-VGPR addressing
ClosedPublic

Authored by rampitec on May 13 2020, 12:03 PM.

Details

Summary

SelectMOVRELOffset prevents peeling of a constant from an index
if final base could be negative. isBaseWithConstantOffset() succeeds
if a value is an "add" or "or" operator. In case of "or" it shall
be an add-like "or" which never changes a sign of the sum given a
non-negative offset. I.e. we can safely allow peeling if operator is
an "or".

Diff Detail

Event Timeline

rampitec created this revision.May 13 2020, 12:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2020, 12:03 PM
arsenm added inline comments.May 13 2020, 12:44 PM
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1905

Couldn't it change the sign for (or 0, 0x80000000)?

rampitec updated this revision to Diff 263841.May 13 2020, 1:20 PM
rampitec marked 2 inline comments as done.
rampitec edited the summary of this revision. (Show Details)

Added check for positive index.

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1905

Thanks. Added check.

arsenm accepted this revision.May 13 2020, 1:56 PM
This revision is now accepted and ready to land.May 13 2020, 1:56 PM
This revision was automatically updated to reflect the committed changes.