This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Enable constant offset promotion to immediate operand for VMEM stores
ClosedPublic

Authored by vpykhtin on Aug 29 2019, 9:41 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

vpykhtin created this revision.Aug 29 2019, 9:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2019, 9:41 AM

Needs tests

vpykhtin updated this revision to Diff 218125.Aug 30 2019, 10:17 AM

Added test. There're some failures in GlobalISel tests need to check if its connected.

llvm-check is now passing, previous failures were irrelevant to this patch.

rampitec added inline comments.Sep 3 2019, 11:11 AM
lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
1326

nullptr or !TII->getNamedOperand()

1326

Stores also have vdata, aren't they?

test/CodeGen/AMDGPU/promote-constOffset-to-imm.mir
194 ↗(On Diff #218125)

Needs test where stores are actually combined.

vpykhtin marked an inline comment as done.Sep 4 2019, 6:56 AM
vpykhtin added inline comments.
test/CodeGen/AMDGPU/promote-constOffset-to-imm.mir
194 ↗(On Diff #218125)

I'm not sure what do you mean, this is about address offset promotion, in this sence it is combined.

vpykhtin marked an inline comment as done.Sep 4 2019, 7:58 AM
vpykhtin added inline comments.
lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
1326

this was done to save the original semantic for mayLoad checks, I'm not sure why it is used.

rampitec added inline comments.Sep 4 2019, 3:22 PM
lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
1326

What will happen it you remove mayLoad() from this condition? I think it will still work as expected.

test/CodeGen/AMDGPU/promote-constOffset-to-imm.mir
194 ↗(On Diff #218125)

I see, that is constant promotion, not the combining.

vpykhtin marked an inline comment as done.Sep 5 2019, 5:20 AM
vpykhtin added inline comments.
lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
1326

Looks like this check is related to RMW atomics, which are supposed to be added later, but they are now skipped by the first check.

If I remove mayLoad check then it would skip stores.

rampitec accepted this revision.Sep 5 2019, 9:07 AM

LGTM

This revision is now accepted and ready to land.Sep 5 2019, 9:07 AM
This revision was automatically updated to reflect the committed changes.