HSA still needs this for OpenCL but it is not needed for other
subtargets.
Details
- Reviewers
t-tye madhur13490 arsenm
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
944–946 | This isn't a real ABI requirement and I don't think should vary based on the triple. Why do you want to re-reduce this? |
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
944–946 | As far as I understand it, an alignment of 16 is needed for OpenCL but otherwise not required (as real memory addresses for lanes are aligned to 4 only anyway). Is there a downside of requiring an alignment of 4? Are there cases outside OpenCL where a higher alignment is required and the stack would need to be realigned? |
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
944–946 | It's not needed, it just introduces stack realignment if you have any stack objects with a higher alignment. Values up to 16-bytes are common (and 8 are very common). This isn't a property of the source language since the target ABI still has higher alignments for common types. |
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
944–946 | I have been thinking we should add an optimization pass to reduce the alignment of allocas if the address isn't captured |
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
944–946 | To be clear, reducing this back to 4 (I had it at 4 originally) may be a good plan with some optimizations, but I don't think this should vary based on the triple |
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
944–946 | Thanks for the helpful explanation. I might come back to this in a while. |
I think this should be abandoned. Requiring 16-byte stack alignment doesn't require 16-byte alignment for a VGPR spill. The spill alignment requirement is only 4. This mostly matters for when stack realignment is necessary. The stack waste comes only in call frame contexts
This isn't a real ABI requirement and I don't think should vary based on the triple. Why do you want to re-reduce this?