[PATCH] D130729: [SeparateConstOffsetFromGEP] [AMDGPU] Check legality for all uses of transformed GEP

Jeffrey Byrnes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 13:52:26 PDT 2022


jrbyrnes created this revision.
jrbyrnes added reviewers: kerbowa, arsenm, rampitec, vangthao95.
Herald added subscribers: kosarev, hiraditya, t-tye, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
jrbyrnes requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Previously, this pass checked the legality of the transformed GEP by using the addrspace of the base pointer in the original GEP. However, due to things like addrspacecasts, that is not enough. This patch considers all the possible uses of the transformed GEP and checks the legality in which the address will ultimately be used. Unfortunately, there are some circumstances in which we can not be sure of legality (e.g. the result of GEP is eventually passed as argument into function call) so we conserivately say it is illegal.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130729

Files:
  llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
  llvm/test/CodeGen/AMDGPU/gep-const-address-space.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130729.448432.patch
Type: text/x-patch
Size: 18349 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220728/4c75f748/attachment.bin>


More information about the llvm-commits mailing list