Function return instruction lowering, currently uses the fixed register pair, s[30:31] for holding the return address.
It can be any SGPR pair other than the CSRs. Created an SGPR pair sub-register class exclusive of the CSRs, and used this register class while lowering the return instruction.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Hi Matt,
The codegen is different now and the scheduler & RA introduce most changes in the test cases.
lib/Target/AMDGPU/SOPInstructions.td | ||
---|---|---|
133–137 ↗ | (On Diff #207023) | The name doesn't match what this is for. I would rather not introduce a separate instruction class for this. You can instead parameterize the existing class with the (ins) for the instruction, defaulting to (ins SReg_64:$src0) |
test/CodeGen/AMDGPU/cross-block-use-is-not-abi-copy.ll | ||
32 ↗ | (On Diff #207023) | It looks like you manually added these checks instead of using update_llc_test_checks? |
test/CodeGen/AMDGPU/nested-calls.ll | ||
33 ↗ | (On Diff #207023) | Are the results actually better looking? Can you add explicit checks for the register s_setpc_b64 is using? |
Parameterized the existing operand class 'SOP1_1' to accommodate different register classes.
Added explicit check for the register pair in return instruction, 's_setpc_b64' (for nested-calls.ll test)
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
2237 ↗ | (On Diff #207250) | This line looks too long? Run clang-format? |
lib/Target/AMDGPU/SIRegisterInfo.td | ||
492 ↗ | (On Diff #207250) | You should bee able to use SGPR_64.RegTypes to avoid repeating the type list |
493–494 ↗ | (On Diff #207250) | You can also avoid repeating these with SGPR_64.CopyCost, and AllocationPriority |
reused the existing register class' parameters for the new class.
Also ran clang-format to fix the long lines.