[AMDGPU][SIMemoryLegalizer] Consider scratch operations as NV=1 if GAS is disabled
- Clarify that `thread-private` MMO flag is still useful.
- If GAS is not enabled (which is the default as of last patch), consider an op as `NV=1` if it's a `scratch_` opcode, or if the MMO is in the private AS.
- Add tests for the new cases.
- Update AMDGPUUsage GFX12.5 memory model
[RFC][AMDGPU] Add BARRIER address space
Add a new BARRIER address space that is used for global variables that are used to represent the barrier IDs in GFX12.5.
These barrier addresses just have values corresponding 1-1 to barrier IDs. They are still implemented on top of LDS, but the offsetting happens during an addrspacecast to generic, not whenever the barrier GV is used.
The motivation for this is to make the relation between LDS and barrier GVs explicit in the compiler. It does add a bit more complexity, but that complexity was already there, just hidden by pretending barrier GVs were actual LDS.
[NFCI][clang] Allow overriding any global variable address space
Allow the target to change the AS of a global variable at will, not just whenever Clang cannot assign one.
This enables the next patch that will specialize LDS GVs for barriers as a separate address space.
[Sema] Call ActOnFields before late parsing in ParseStructUnionBody (#187166)
Implements for: #186914
Move the call to `ActOnFields()` before `ParseLexedCAttributeList()` in
ParseStructUnionBody for reordering so that the struct type is complete
when late-parsed attributes like counted_by get evaluated. This is a
prerequisite for supporting sizeof/offsetof expressions in counted_by
evaluation.
Update the heuristic for `GetEnclosingNamedOrTopAnonRecord`. Remove the
`isCompleteDefinition()` condition since it will always return true
under the new ordering. The `GetEnclosingNamedOrTopAnonRecord` intend to
treat the unnamed and anonymous struct permissively.
Add one test to verify the new ordering still make sure the function of
unnamed and anonymous struct works normally.
[NFC][AMDGPU] Generalize some LDS MemoryUtils
In preparation for upcoming work, I need some functions used by the LDS lowering
system to work on any GV. I removed the LDS specific queries inside these functions
and replaced them with functors passed by the caller, so these utility functions can be reused.
I also cleaned-up a few things that weren't up to code, such as lowercase variable names.