llvm-project/llvm/test/CodeGen/MIR/AMDGPU
Venkata Ramanaiah Nalamothu 04fff547e2 [AMDGPU] Move call clobbered return address registers s[30:31] to callee saved range
Currently the return address ABI registers s[30:31], which fall in the call
clobbered register range, are added as a live-in on the function entry to
preserve its value when we have calls so that it gets saved and restored
around the calls.

But the DWARF unwind information (CFI) needs to track where the return address
resides in a frame and the above approach makes it difficult to track the
return address when the CFI information is emitted during the frame lowering,
due to the involvment of understanding the control flow.

This patch moves the return address ABI registers s[30:31] into callee saved
registers range and stops adding live-in for return address registers, so that
the CFI machinery will know where the return address resides when CSR
save/restore happen during the frame lowering.

And doing the above poses an issue that now the return instruction uses undefined
register `sgpr30_sgpr31`. This is resolved by hiding the return address register
use by the return instruction through the `SI_RETURN` pseudo instruction, which
doesn't take any input operands, until the `SI_RETURN` pseudo gets lowered to the
`S_SETPC_B64_return` during the `expandPostRAPseudo()`.

As an added benefit, this patch simplifies overall return instruction handling.

Note: The AMDGPU CFI changes are there only in the downstream code and another
version of this patch will be posted for review for the downstream code.

Reviewed By: arsenm, ronlieb

Differential Revision: https://reviews.llvm.org/D114652
2022-03-09 12:18:02 +05:30
..
custom-pseudo-source-values.ll
expected-target-index-name.mir
extra-imm-operand.mir MIR: Start diagnosing too many operands on an instruction 2022-02-21 10:36:39 -05:00
extra-reg-operand.mir MIR: Start diagnosing too many operands on an instruction 2022-02-21 10:36:39 -05:00
intrinsics.mir
invalid-frame-index-invalid-fixed-stack.mir
invalid-frame-index-invalid-stack.mir
invalid-frame-index-no-stack.mir
invalid-frame-index.mir
invalid-frame-index2.mir
invalid-target-index-operand.mir
lit.local.cfg
llc-target-cpu-attr-from-cmdline-ir.mir
llc-target-cpu-attr-from-cmdline.mir
load-store-opt-dlc.mir
machine-function-info-after-pei.ll
machine-function-info-dynlds-align-invalid-case.mir
machine-function-info-no-ir.mir AMDGPU: Enable fixed function ABI by default 2021-12-04 10:49:18 -05:00
machine-function-info-register-parse-error1.mir
machine-function-info-register-parse-error2.mir
machine-function-info.ll AMDGPU: Enable fixed function ABI by default 2021-12-04 10:49:18 -05:00
machine-metadata-error.mir
machine-metadata.mir [AMDGPU] Move call clobbered return address registers s[30:31] to callee saved range 2022-03-09 12:18:02 +05:30
mfi-frame-offset-reg-class.mir
mfi-parse-error-frame-offset-reg.mir
mfi-parse-error-scratch-rsrc-reg.mir
mfi-parse-error-stack-ptr-offset-reg.mir
mfi-scratch-rsrc-reg-reg-class.mir
mfi-stack-ptr-offset-reg-class.mir
mir-canon-multi.mir
mircanon-memoperands.mir
parse-order-reserved-regs.mir
stack-id-assert.mir [AMDGPU] Move call clobbered return address registers s[30:31] to callee saved range 2022-03-09 12:18:02 +05:30
stack-id.mir
subreg-def-is-not-ssa.mir
syncscopes.mir
target-flags.mir
target-index-operands.mir
target-memoperands.mir [AMDGPU] Use new target MMO flag MONoClobber 2022-02-02 17:12:36 +00:00