This is an archive of the discontinued LLVM Phabricator instance.

[amdgpu] Change LDS lowering default to hybrid
ClosedPublic

Authored by JonChesterfield on Jan 16 2023, 7:16 AM.

Details

Summary

Postponed from D139433 until the bug fixed by D139874 could be resolved.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 7:16 AM
JonChesterfield requested review of this revision.Jan 16 2023, 7:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 7:16 AM

Internal CI number 792330 running at present.

arsenm accepted this revision.Jan 16 2023, 7:26 AM

I would have expected a test update?

This revision is now accepted and ready to land.Jan 16 2023, 7:26 AM

I also wouldn’t call it a regalloc bug and point to to commit in the message

JonChesterfield edited the summary of this revision. (Show Details)Jan 30 2023, 6:00 AM
  • Change to hybrid. Reintroduces code block deleted by git misfire
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1331–1343

This is latent because the module lds variable is always lowered to zero and the path through codegen coincidentally picks zero for it. It breaks on the "kernel" lowering strategy because that can reference variables that aren't at zero directly, and breaks on the "hybrid" lowering when it happens to pick the "kernel" strategy for a variable allocated by a kernel which does not use the "module" scope variable.

Still, relying on unspecified -> zero is bad. Planning to add a test case for this behaviour change (it won't show up in codegen that picks zero anyway, but should do for codegen where zero was not the right answer)

JonChesterfield requested review of this revision.Feb 22 2023, 9:04 AM
  • update test, no longer emitting traps

Checked in the new test case (codegen for hybrid path, previously only checking IR) before this patch in order to highlight the s_trap -> working change. Will commit this as is to catch up with rocm and then change to absolute_symbols (as in D144221), patching trunk first so that rocm picks up the change without manual intervention.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 24 2023, 7:27 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.