Correctly use alignment size from loaded size not output value size.
Details
Diff Detail
Event Timeline
Could you be more specific?
test/CodeGen/AMDGPU/extload.ll | ||
---|---|---|
1 | -debug-only will have the same problem that this will only work in asserts build |
In the SplitVecOp_EXTRACT_VECTOR_ELT(N) in LegalizeVectorTypes, there is a call to DAG.getExtLoad where the optional Alignment argument is omitted and defaulted to 0.
This appears to be the only call in llvm of such that triggers that code path and all other similar alignment checks appear correct.
In terms of a test, it's not clear to me how to expose the issue with alignment from an element of a decomposed vector in the current upstream without inspecting intermediate state via debug. The easiest way would be to fold this into D14834. I'd prefer to make this a separate commit as it is an obvious and separable mistake. Perhaps we could add this test for now, and then delete it as redundant with D14834.
test/CodeGen/AMDGPU/extload-align.ll | ||
---|---|---|
5 ↗ | (On Diff #70408) | It is not obvious what you're checking here. Do you want to match the alignment? (or are you matching the lack of a non-default alignment)? |
Add comment explaining test
test/CodeGen/AMDGPU/extload-align.ll | ||
---|---|---|
5 ↗ | (On Diff #70408) | That's correct. I'm checking that the alignment is 2 and matching the underlying i16 load, not 4 matching the size of the extend value. I've added a comment to the test making this clearer. |
Can you do something else that doesn't use -debug? This will break in release build