[PATCH] D61494: AMDGPU: Write LDS objects out as global symbols in code generation

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 06:48:15 PDT 2019


nhaehnle marked 2 inline comments as done.
nhaehnle added a comment.

Thanks.



================
Comment at: lib/Target/AMDGPU/SIInstructions.td:1144-1147
+def : GCNPat <
+  (SIlds tglobaladdr:$ga),
+  (S_MOV_B32 $ga)
+>;
----------------
arsenm wrote:
> I would be surprised this is ever useful, but it's fine
This is required to get rid of the SIlds node. Without wrapping the targetglobaladdress in a dedicated node, a lot of stuff just breaks or gets really messy, e.g.:

1. Global addrs can't be address operands for DS instructions, so we'd need to pick them out there manually.
2. At least one test case numerically compares an LDS address to a number and ends up breaking the constant bus limitations without this.

Besides, all the targets I've looked at de facto wrap targetglobaladdresses in other DAG nodes in one way or another. Selecting "naked" tgas seems to just be totally unexpected behavior.

This also simplifies the computeKnownBits integration. Long story short, the weird stuff I did previously were all things to work around the deficiencies of naked tgas and my thinking it would be nicer to avoid a dedicated SD node just for this. I still think it's silly to require a dedicated SD node, but that assumption is deeply embedded in a lot of places...


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61494/new/

https://reviews.llvm.org/D61494





More information about the llvm-commits mailing list