[PATCH] D82496: [amdgpu] Add codegen support for HIP dynamic shared memory.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 12:56:00 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:2258
+        Type *Ty = GV->getValueType();
+        if (B.getDataLayout().getTypeAllocSize(Ty).isZero()) {
+          // Adjust alignment for that dynamic shared memory array.
----------------
Should get global's alignment, not just the type


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:5588
+        // Adjust alignment for that dynamic shared memory array.
+        MFI->setDynLDSAlign(DAG.getDataLayout().getABITypeAlign(Ty));
+        return SDValue(
----------------
This should take the alignment from the global, not just the type alignment


================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/hip.extern.shared.array.ll:10
+ at dynamic_shared1 = external addrspace(3) global [0 x double], align 4
+
+; CHECK-LABEL: {{^}}dynamic_shared_array_0:
----------------
Needs some tests with larger explicit alignments


================
Comment at: llvm/test/CodeGen/MIR/AMDGPU/machine-function-info-dynlds-align-invalid-case.mir:1-2
+# XFAIL: *
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -run-pass=none -verify-machineinstrs %s -o - 2>&1 | FileCheck %s
+
----------------
This isn't XFAIL, it's run with not and check the error message output


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82496



More information about the llvm-commits mailing list