In the frame index lowering we have to insert shift and add
instructions to adjust stack object access. We need to take care of the stack
object user kind and use scalar shift/add for scalar users.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2238 | Formatting. | |
2241 | Can probably be another mov? | |
2241–2242 | Formatting. | |
2248 | What if $scc is alive? | |
llvm/test/CodeGen/AMDGPU/frame-index.mir | ||
2 | No need to pass -mattr=-promote-alloca -amdgpu-sroa=0. | |
8 | IR is also not needed. | |
60 | Just remove memory operand (part starting from ::) so you do not need IR. | |
89 | Generate the checks. This one misses inlicit-def dead $scc. |
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2236–2240 | It would be a bit more appropriate to check the class of the use operand |
IsSALU check chamged to query operand register class.
MIR test were made auto-generated
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2241 | Never :) |
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2237 | All other places shall mean the whole function? I'd suggest using MBB->computeRegisterLiveness(). |
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2237 | I mean checks like this: CanClobberSCC = !RS->isRegUsed(AMDGPU::SCC); they really interested if SCC is live at exact point. In case this is wrong we have lots of problems |
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2237 | But what point is it? The call does not take an iterator. |
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2237 | It's at the scavenging point, which is separately advanced |
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2237 | Was it advanced before the call? |
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2237 | It should have been advanced by the scavengeRegister call (assuming there is one on the path that reaches here). Plus PrologEpilogInserter advances before the call in the normal usage |
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2237 | OK, thanks. |
test case for SCC multiple defs added. Unnecessary compiler options removed from the test command line.
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | ||
---|---|---|
2237 | RegisterScavenger::forward takes care of that. It is called from PEI::eliminateFrameIndices on each iteration. So it updates live information stepping each instruction. |
There is a case where you are creating readfirstlane, but I do not see a test for it.
Is not isRegUsed for the whole function and will always return true on practice?