This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Use ComplexPatterns for SMRD addressing modes
ClosedPublic

Authored by tstellarAMD on Jul 29 2015, 11:26 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Use ComplexPatterns for SMRD addressing modes.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
arsenm added inline comments.Jul 29 2015, 11:40 AM
lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1164–1167 ↗(On Diff #30930)

I don't think this is accurate for VI. On VI, these instructions are called SMEM format instead of SMRD, so the function name isn't quite right. More importantly, I thought the 20-bit offset on VI was in bytes and dwords on SI/CI.

Updated patch to clarify input to isLegalSMRDImmOffset()

lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1164–1167 ↗(On Diff #30930)

The value passed to the function is the encoded value, so it is already in the correct units for the target. SMRD was renamed to SMEM, but the load instructions are still identical, and we call them SMRD in a few other places.

arsenm accepted this revision.Jul 30 2015, 6:28 PM
arsenm edited edge metadata.

LGTM

lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1165–1166 ↗(On Diff #31097)

I would add another sentence "Note that the offset has different units on VI" or something like that

This revision is now accepted and ready to land.Jul 30 2015, 6:28 PM
This revision was automatically updated to reflect the committed changes.