This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Consider XOR in waterfall loop as a terminator
ClosedPublic

Authored by scott.linder on Feb 4 2019, 11:48 AM.

Details

Summary

Ensure the XOR in the waterfall loop for indirect addressing is considered a terminator.

Diff Detail

Repository
rL LLVM

Event Timeline

scott.linder created this revision.Feb 4 2019, 11:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2019, 11:48 AM
arsenm added inline comments.Feb 4 2019, 11:52 AM
test/CodeGen/AMDGPU/indirect-addressing-term.ll
1–19 ↗(On Diff #185114)

This test isn't really useful. -stop-after=isel and checking the MIR should work

arsenm added inline comments.Feb 4 2019, 11:55 AM
test/CodeGen/AMDGPU/indirect-addressing-term.ll
1–19 ↗(On Diff #185114)

Possibly -O0 could show something break

I agree the test does not test much at all, it was just the minimum I could think of considering none of our existing tests notice the change. I'm not sure what pass you mean by 'isel', but 'stop-after=amdgpu-isel' is too early to see the SI_INDIRECT_SRC_* psuedo expanded.

You mentioned to try at -O0 and I see spill code being inserted between the xor and branch in the current trunk. I've updated the test to just go to ISA and confirm there is no intervening instruction between the xor and branch, but I don't know if this is what you had in mind either.

I agree the test does not test much at all, it was just the minimum I could think of considering none of our existing tests notice the change. I'm not sure what pass you mean by 'isel', but 'stop-after=amdgpu-isel' is too early to see the SI_INDIRECT_SRC_* psuedo expanded.

You mentioned to try at -O0 and I see spill code being inserted between the xor and branch in the current trunk. I've updated the test to just go to ISA and confirm there is no intervening instruction between the xor and branch, but I don't know if this is what you had in mind either.

Oh, right. This needs to be after expand-isel-pseudos

arsenm added inline comments.Feb 4 2019, 12:59 PM
test/CodeGen/AMDGPU/indirect-addressing-term.ll
11–12 ↗(On Diff #185132)

If you're not going to go for the MIR test, this should explicitly check for the existence of the spill code before the terminator

I think MIR is the best place to look; this now tests that the right pseudo is produced and that spills don't interleave the terminators.

arsenm accepted this revision.Feb 5 2019, 7:48 AM

LGTM

This revision is now accepted and ready to land.Feb 5 2019, 7:48 AM
This revision was automatically updated to reflect the committed changes.