[llvm] [AMDGPU][LTO] Introduce AMDGPUCloneModuleLDS (PR #89683)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 01:11:05 PDT 2024


================
@@ -0,0 +1,58 @@
+; RUN: opt -passes=amdgpu-clone-module-lds %s -S | FileCheck %s
+
+target triple = "amdgcn-amd-amdhsa"
+
+; In this examples, CloneModuleLDS pass creates two copies of LDS_GV
+; as two kernels call the same device function where LDS_GV is used.
+
+; CHECK: [[LDS_GV_CLONE:@.*\.clone\.0]] = internal unnamed_addr addrspace(3) global [64 x i32] poison, align 16
+; CHECK: [[LDS_GV:@.*]] = internal unnamed_addr addrspace(3) global [64 x i32] undef, align 16
+ at lds_gv = internal unnamed_addr addrspace(3) global [64 x i32] undef, align 16
----------------
arsenm wrote:

```suggestion
@lds_gv = internal unnamed_addr addrspace(3) global [64 x i32] poison, align 16
```

https://github.com/llvm/llvm-project/pull/89683


More information about the llvm-commits mailing list