Generate (at runtime) the table used to drive getSubRegFromChannel,
base on AMDGPUSubRegIdxRanges from TableGen data.
The is a step closer to it being staticly generated by TableGen and
allows getSubRegFromChannel handle all bitwidths in the mean time.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks good, I have one comment.
| llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
|---|---|---|
| 92–93 | I think this should be just sizeof(SubRegFromChannelTable). | |
LGTM. I think this can remove some of the workarounds in the globalisel insert/extract selection
| llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
|---|---|---|
| 92–93 | Yes, this should be NoSubregister | |
| llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
|---|---|---|
| 45 | This could use a comment. | |
Address reviews comments:
- Fix initialiser to use AMDGPU::NoSubRegister and not memset.
- Add comment on mapping array.
Having addressed the comments could I get a second quick read before I submit?
Thanks.
| llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
|---|---|---|
| 45 | Added a detailed comment. | |
| 92–93 | Agreed, this was meant to be AMDGPU::NoSubRegister. | |
- Use std::array and tidy up initialisation.
- Fix number of rows in table.
| llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
|---|---|---|
| 45 | Apparently I forgot to increase the array size and this magically did not create any problems. My assertions were also not tight enough to catch this. | |
| llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
|---|---|---|
| 102 | This index should also be Width - 1 | |
This could use a comment.