This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Split MUBUF offset into aligned components
ClosedPublic

Authored by nhaehnle on Sep 14 2017, 6:19 AM.

Details

Summary

Atomic buffer operations do not work (and trap on gfx9) when the
components are unaligned, even if their sum is aligned.

Previously, we generated an offset of 4156 without an SGPR by
splitting it as 4095 + 61 (immediate + inline constant). The
highest offset for which we can do this correctly is 4152 = 4092 + 60.

Fixes dEQP-GLES31.functional.ssbo.atomic.*

Diff Detail

Repository
rL LLVM

Event Timeline

nhaehnle created this revision.Sep 14 2017, 6:19 AM
nhaehnle updated this revision to Diff 115210.Sep 14 2017, 6:20 AM

Updated commit message: the highest value that can be represented with
immediate + inline is 4156 = 4092 + 64.

arsenm added inline comments.Sep 14 2017, 11:50 AM
lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
1236 ↗(On Diff #115210)

Can you keep using the bit ranges, and then use the various alignTo functions instead of changing the hardcoded values

nhaehnle updated this revision to Diff 117163.Sep 29 2017, 9:17 AM

Use alignDown instead of magic 4092.

arsenm accepted this revision.Oct 2 2017, 12:36 PM

LGTM

This revision is now accepted and ready to land.Oct 2 2017, 12:36 PM
This revision was automatically updated to reflect the committed changes.