[PATCH] D91516: [AMDGPU][WIP] Lower Function Local LDS Variables.

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 20:53:50 PST 2021


hsmhsm updated this revision to Diff 317763.
hsmhsm added a comment.

Based on the Matt's comment for previous patch, some changes are done w.r.t the handling
of the guarding flag - `amdgpu-enable-function-local-lds-lowering`.

Though Matt is against the usage of any guarding flag for this pass, I personally feel the
need of it for below two reasons.

(1) Presence of this pass means, we should disable the forcefull inlining as it is done within
the pass - `amdgpu-always-inline`. Otherwise, this pass does not make any sense at all. It is a
better idea to disable this forcefull inlining via a flag.

(2) In case of any emergency issue within this pass, customer should have an handy approach to
disable the pass and temporarily move on until the fix available.

So the `amdgpu-enable-function-local-lds-lowering` is a hidden flag, and it is enabled by default.
It works as below:

- Default behavoir is to run the pass as shown below.
  - Old pass manager:

    mahesha at brego:[tmp]$ hipcc main.cpp Running the pass - LowerFunctionLocalLDS mahesha at brego:[tmp]$
  - New pass manager:

    mahesha at brego:[tmp]$ hipcc -fexperimental-new-pass-manager main.cpp Running the pass - LowerFunctionLocalLDS mahesha at brego:[tmp]$

- The pass will not run when it is explicitly turned off as shown below.
  - Old pass manager:

    mahesha at brego:[tmp]$ hipcc -mllvm --amdgpu-enable-function-local-lds-lowering=false main.cpp mahesha at brego:[tmp]$
  - New pass manager:

    mahesha at brego:[tmp]$ hipcc -fexperimental-new-pass-manager  -mllvm --amdgpu-enable-function-local-lds-lowering=false main.cpp mahesha at brego:[tmp]$


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91516

Files:
  llvm/lib/Target/AMDGPU/AMDGPU.h
  llvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
  llvm/lib/Target/AMDGPU/AMDGPULowerFunctionLocalLDS.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h
  llvm/lib/Target/AMDGPU/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91516.317763.patch
Type: text/x-patch
Size: 7676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210120/9caf897a/attachment.bin>


More information about the llvm-commits mailing list