llvm-project/llvm/test/CodeGen/MIR/AMDGPU
Matt Arsenault b812b7a45e AMDGPU: Invert frame index offset interpretation
Since the beginning, the offset of a frame index has been consistently
interpreted backwards. It was treating it as an offset from the
scratch wave offset register as a frame register. The correct
interpretation is the offset from the SP on entry to the function,
before the prolog. Frame index elimination then should select either
SP or another register as an FP.

Treat the scratch wave offset on kernel entry as the pre-incremented
SP. Rely more heavily on the standard hasFP and frame pointer
elimination logic, and clean up the private reservation code. This
saves a copy in most callee functions.

The kernel prolog emission code is still kind of a mess relying on
checking the uses of physical registers, which I would prefer to
eliminate.

Currently selection directly emits MUBUF instructions, which require
using a reference to some register. Use the register chosen for SP,
and then ignore this later. This should probably be cleaned up to use
pseudos that don't refer to any specific base register until frame
index elimination.

Add a workaround for shaders using large numbers of SGPRs. I'm not
sure these cases were ever working correctly, since as far as I can
tell the logic for figuring out which SGPR is the scratch wave offset
doesn't match up with the shader input initialization in the shader
programming guide.

llvm-svn: 362661
2019-06-05 22:20:47 +00:00
..
expected-target-index-name.mir
intrinsics.mir
invalid-target-index-operand.mir
lit.local.cfg
load-store-opt-dlc.mir [AMDGPU] gfx1010 tests. NFC. 2019-05-13 19:30:06 +00:00
machine-function-info-no-ir.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
machine-function-info-register-parse-error1.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
machine-function-info-register-parse-error2.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
machine-function-info.ll AMDGPU: Invert frame index offset interpretation 2019-06-05 22:20:47 +00:00
mfi-frame-offset-reg-class.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
mfi-parse-error-frame-offset-reg.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
mfi-parse-error-scratch-rsrc-reg.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
mfi-parse-error-scratch-wave-offset-reg.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
mfi-parse-error-stack-ptr-offset-reg.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
mfi-scratch-rsrc-reg-reg-class.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
mfi-scratch-wave-offset-reg-class.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
mfi-stack-ptr-offset-reg-class.mir MIR: Allow targets to serialize MachineFunctionInfo 2019-03-14 22:54:43 +00:00
mir-canon-multi.mir [MIR-Canon] Hardening propagateLocalCopies. 2019-05-31 04:49:58 +00:00
parse-order-reserved-regs.mir [MIR-Canon] Don't do vreg skip for independent instructions if there are none. 2019-05-31 17:34:25 +00:00
stack-id.mir
syncscopes.mir [AMDGPU] gfx1010 VMEM and SMEM implementation 2019-04-30 22:08:23 +00:00
target-flags.mir
target-index-operands.mir [AMDGPU] gfx1010 VMEM and SMEM implementation 2019-04-30 22:08:23 +00:00