[clang] [llvm] [AMDGPU] Fix 8-byte printf slot placement (PR #237178)

Steffen Larsen via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 30 04:33:12 PDT 2026


https://github.com/steffenlarsen updated https://github.com/llvm/llvm-project/pull/237178

>From ba9ba51b37c593de2bdc76f9672cf46cfe183f38 Mon Sep 17 00:00:00 2001
From: Steffen Holst Larsen <sholstla at amd.com>
Date: Fri, 30 Oct 2026 06:09:09 -0500
Subject: [PATCH 1/2] [AMDGPU] Fix 8-byte printf slot placement

The device runtime reads each non-string argument of a buffered printf
from 8-byte slots, and the buffer reserves at least 8 bytes for each.
The pointer to the next argument was advanced by the stored value's own
alloc size, though, so a value stored in fewer than 8 bytes shifted
every argument after it.

Round both the reservation and the advance for a non-string argument up
to a multiple of 8 bytes. The words of a constant string are still
stored back to back, as the string as a whole is already padded to 8
bytes. Store non-string arguments in their own case so their advance is
separate from the string words, which flattens the argument loop.

Assisted-by: Claude Opus 5.5

Signed-off-by: Steffen Holst Larsen <sholstla at amd.com>
---
 clang/test/CodeGenHIP/printf_nonhostcall.cpp  | 73 +++++++++++++++++++
 .../lib/Transforms/Utils/AMDGPUEmitPrintf.cpp | 72 ++++++++++--------
 2 files changed, 116 insertions(+), 29 deletions(-)

diff --git a/clang/test/CodeGenHIP/printf_nonhostcall.cpp b/clang/test/CodeGenHIP/printf_nonhostcall.cpp
index 7e8a468a335271..956d8950bcb18a 100644
--- a/clang/test/CodeGenHIP/printf_nonhostcall.cpp
+++ b/clang/test/CodeGenHIP/printf_nonhostcall.cpp
@@ -460,3 +460,76 @@ __device__ int foo4() {
   const char* s = "format str%d";
   return printf(s, 10);
 }
+
+// A 32-bit pointer, here to LDS or private memory, is stored in 4 bytes but
+// still takes an 8-byte slot, so the argument after it starts 8 bytes later.
+// CHECK-LABEL: define dso_local noundef i32 @_Z4foo5PU3AS3vPU3AS5v
+// CHECK-SAME: (ptr addrspace(3) noundef [[LDS:%.*]], ptr addrspace(5) noundef [[PRIV:%.*]]) #{{[0-9]+}} {
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:    [[LDS_ADDR:%.*]] = alloca ptr addrspace(3), align 4, addrspace(5)
+// CHECK-NEXT:    [[PRIV_ADDR:%.*]] = alloca ptr addrspace(5), align 4, addrspace(5)
+// CHECK-NEXT:    [[LDS_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[LDS_ADDR]] to ptr
+// CHECK-NEXT:    [[PRIV_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[PRIV_ADDR]] to ptr
+// CHECK-NEXT:    store ptr addrspace(3) [[LDS]], ptr [[LDS_ADDR_ASCAST]], align 4
+// CHECK-NEXT:    store ptr addrspace(5) [[PRIV]], ptr [[PRIV_ADDR_ASCAST]], align 4
+// CHECK-NEXT:    [[TMP0:%.*]] = load ptr addrspace(3), ptr [[LDS_ADDR_ASCAST]], align 4
+// CHECK-NEXT:    [[TMP1:%.*]] = load ptr addrspace(5), ptr [[PRIV_ADDR_ASCAST]], align 4
+// CHECK-NEXT:    [[PRINTF_ALLOC_FN:%.*]] = call ptr addrspace(1) @__printf_alloc(i32 44)
+// CHECK-NEXT:    [[TMP2:%.*]] = icmp ne ptr addrspace(1) [[PRINTF_ALLOC_FN]], null
+// CHECK-NEXT:    br i1 [[TMP2]], label [[ARGPUSH_BLOCK:%.*]], label [[END_BLOCK:%.*]]
+// CHECK:       end.block:
+// CHECK-NEXT:    [[TMP3:%.*]] = xor i1 [[TMP2]], true
+// CHECK-NEXT:    [[PRINTF_RESULT:%.*]] = sext i1 [[TMP3]] to i32
+// CHECK-NEXT:    ret i32 [[PRINTF_RESULT]]
+// CHECK:       argpush.block:
+// CHECK-NEXT:    store i32 178, ptr addrspace(1) [[PRINTF_ALLOC_FN]], align 4
+// CHECK-NEXT:    [[TMP4:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[PRINTF_ALLOC_FN]], i32 4
+// CHECK-NEXT:    store i64 -2001953306523763028, ptr addrspace(1) [[TMP4]], align 8
+// CHECK-NEXT:    [[TMP5:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP4]], i32 8
+// CHECK-NEXT:    store ptr addrspace(3) [[TMP0]], ptr addrspace(1) [[TMP5]], align 4
+// CHECK-NEXT:    [[PRINTBUFFNEXTPTR:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP5]], i32 8
+// CHECK-NEXT:    store i64 1, ptr addrspace(1) [[PRINTBUFFNEXTPTR]], align 8
+// CHECK-NEXT:    [[PRINTBUFFNEXTPTR1:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[PRINTBUFFNEXTPTR]], i32 8
+// CHECK-NEXT:    store ptr addrspace(5) [[TMP1]], ptr addrspace(1) [[PRINTBUFFNEXTPTR1]], align 4
+// CHECK-NEXT:    [[PRINTBUFFNEXTPTR2:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[PRINTBUFFNEXTPTR1]], i32 8
+// CHECK-NEXT:    store i64 2, ptr addrspace(1) [[PRINTBUFFNEXTPTR2]], align 8
+// CHECK-NEXT:    [[PRINTBUFFNEXTPTR3:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[PRINTBUFFNEXTPTR2]], i32 8
+// CHECK-NEXT:    br label [[END_BLOCK]]
+//
+// CHECK_CONSTRAINED-LABEL: define dso_local noundef i32 @_Z4foo5PU3AS3vPU3AS5v
+// CHECK_CONSTRAINED-SAME: (ptr addrspace(3) noundef [[LDS:%.*]], ptr addrspace(5) noundef [[PRIV:%.*]]) #{{[0-9]+}} {
+// CHECK_CONSTRAINED-NEXT:  entry:
+// CHECK_CONSTRAINED-NEXT:    [[LDS_ADDR:%.*]] = alloca ptr addrspace(3), align 4, addrspace(5)
+// CHECK_CONSTRAINED-NEXT:    [[PRIV_ADDR:%.*]] = alloca ptr addrspace(5), align 4, addrspace(5)
+// CHECK_CONSTRAINED-NEXT:    [[LDS_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[LDS_ADDR]] to ptr
+// CHECK_CONSTRAINED-NEXT:    [[PRIV_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[PRIV_ADDR]] to ptr
+// CHECK_CONSTRAINED-NEXT:    store ptr addrspace(3) [[LDS]], ptr [[LDS_ADDR_ASCAST]], align 4
+// CHECK_CONSTRAINED-NEXT:    store ptr addrspace(5) [[PRIV]], ptr [[PRIV_ADDR_ASCAST]], align 4
+// CHECK_CONSTRAINED-NEXT:    [[TMP0:%.*]] = load ptr addrspace(3), ptr [[LDS_ADDR_ASCAST]], align 4
+// CHECK_CONSTRAINED-NEXT:    [[TMP1:%.*]] = load ptr addrspace(5), ptr [[PRIV_ADDR_ASCAST]], align 4
+// CHECK_CONSTRAINED-NEXT:    [[PRINTF_ALLOC_FN:%.*]] = call ptr addrspace(1) @__printf_alloc(i32 44)
+// CHECK_CONSTRAINED-NEXT:    [[TMP2:%.*]] = icmp ne ptr addrspace(1) [[PRINTF_ALLOC_FN]], null
+// CHECK_CONSTRAINED-NEXT:    br i1 [[TMP2]], label [[ARGPUSH_BLOCK:%.*]], label [[END_BLOCK:%.*]]
+// CHECK_CONSTRAINED:       end.block:
+// CHECK_CONSTRAINED-NEXT:    [[TMP3:%.*]] = xor i1 [[TMP2]], true
+// CHECK_CONSTRAINED-NEXT:    [[PRINTF_RESULT:%.*]] = sext i1 [[TMP3]] to i32
+// CHECK_CONSTRAINED-NEXT:    ret i32 [[PRINTF_RESULT]]
+// CHECK_CONSTRAINED:       argpush.block:
+// CHECK_CONSTRAINED-NEXT:    store i32 178, ptr addrspace(1) [[PRINTF_ALLOC_FN]], align 4
+// CHECK_CONSTRAINED-NEXT:    [[TMP4:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[PRINTF_ALLOC_FN]], i32 4
+// CHECK_CONSTRAINED-NEXT:    store i64 -2001953306523763028, ptr addrspace(1) [[TMP4]], align 8
+// CHECK_CONSTRAINED-NEXT:    [[TMP5:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP4]], i32 8
+// CHECK_CONSTRAINED-NEXT:    store ptr addrspace(3) [[TMP0]], ptr addrspace(1) [[TMP5]], align 4
+// CHECK_CONSTRAINED-NEXT:    [[PRINTBUFFNEXTPTR:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP5]], i32 8
+// CHECK_CONSTRAINED-NEXT:    store i64 1, ptr addrspace(1) [[PRINTBUFFNEXTPTR]], align 8
+// CHECK_CONSTRAINED-NEXT:    [[PRINTBUFFNEXTPTR1:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[PRINTBUFFNEXTPTR]], i32 8
+// CHECK_CONSTRAINED-NEXT:    store ptr addrspace(5) [[TMP1]], ptr addrspace(1) [[PRINTBUFFNEXTPTR1]], align 4
+// CHECK_CONSTRAINED-NEXT:    [[PRINTBUFFNEXTPTR2:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[PRINTBUFFNEXTPTR1]], i32 8
+// CHECK_CONSTRAINED-NEXT:    store i64 2, ptr addrspace(1) [[PRINTBUFFNEXTPTR2]], align 8
+// CHECK_CONSTRAINED-NEXT:    [[PRINTBUFFNEXTPTR3:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[PRINTBUFFNEXTPTR2]], i32 8
+// CHECK_CONSTRAINED-NEXT:    br label [[END_BLOCK]]
+//
+__device__ int foo5(__attribute__((address_space(3))) void *lds,
+                    __attribute__((address_space(5))) void *priv) {
+  return printf("%p %d %p %d\n", lds, 1, priv, 2);
+}
diff --git a/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp b/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
index 11fb00f9b6a373..2c233f77b35f30 100644
--- a/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
+++ b/llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
@@ -274,10 +274,11 @@ static Value *callBufferedPrintfStart(
             StringData(StringRef(), LenWithNull, LenWithNullAligned, false));
       }
     } else {
-      int AllocSize = M->getDataLayout().getTypeAllocSize(Args[i]->getType());
+      uint64_t AllocSize =
+          M->getDataLayout().getTypeAllocSize(Args[i]->getType());
       // We end up expanding non string arguments to 8 bytes
       // (args smaller than 8 bytes)
-      BufSize += std::max(AllocSize, 8);
+      BufSize += alignTo(AllocSize, 8);
     }
   }
 
@@ -377,35 +378,48 @@ callBufferedPrintfArgPush(IRBuilder<> &Builder, ArrayRef<Value *> Args,
   auto StrIt = StringContents.begin();
   size_t i = IsConstFmtStr ? 1 : 0;
   for (; i < Args.size(); i++) {
-    SmallVector<Value *, 32> WhatToStore;
-    if ((i == 0) || SpecIsCString.test(i)) {
-      if (StrIt->IsConst) {
-        processConstantStringArg(StrIt, Builder, WhatToStore);
-        StrIt++;
-      } else {
-        // This copies the contents of the string, however the next offset
-        // is at aligned length, the extra space that might be created due
-        // to alignment padding is not populated with any specific value
-        // here. This would be safe as long as runtime is sync with
-        // the offsets.
-        Builder.CreateMemCpy(PtrToStore, /*DstAlign*/ Align(1), Args[i],
-                             /*SrcAlign*/ Args[i]->getPointerAlignment(DL),
-                             StrIt->RealSize);
-
-        PtrToStore =
-            Builder.CreateInBoundsGEP(Builder.getInt8Ty(), PtrToStore,
-                                      {StrIt->AlignedSize}, "PrintBuffNextPtr");
-        LLVM_DEBUG(dbgs() << "inserting gep to the printf buffer:"
-                          << *PtrToStore << '\n');
-
-        // done with current argument, move to next
-        StrIt++;
-        continue;
-      }
-    } else {
-      WhatToStore.push_back(processNonStringArg(Args[i], Builder));
+    if (i != 0 && !SpecIsCString.test(i)) {
+      // The runtime reads each non-string argument from a whole number of
+      // 8-byte slots, also when the stored value is smaller.
+      Value *ToStore = processNonStringArg(Args[i], Builder);
+      StoreInst *StBuff = Builder.CreateStore(ToStore, PtrToStore);
+      LLVM_DEBUG(dbgs() << "inserting store to printf buffer:" << *StBuff
+                        << '\n');
+      (void)StBuff;
+      PtrToStore = Builder.CreateConstInBoundsGEP1_32(
+          Builder.getInt8Ty(), PtrToStore,
+          alignTo(DL.getTypeAllocSize(ToStore->getType()), 8),
+          "PrintBuffNextPtr");
+      LLVM_DEBUG(dbgs() << "inserting gep to the printf buffer:" << *PtrToStore
+                        << '\n');
+      continue;
+    }
+
+    if (!StrIt->IsConst) {
+      // This copies the contents of the string, however the next offset
+      // is at aligned length, the extra space that might be created due
+      // to alignment padding is not populated with any specific value
+      // here. This would be safe as long as runtime is sync with
+      // the offsets.
+      Builder.CreateMemCpy(PtrToStore, /*DstAlign*/ Align(1), Args[i],
+                           /*SrcAlign*/ Args[i]->getPointerAlignment(DL),
+                           StrIt->RealSize);
+
+      PtrToStore =
+          Builder.CreateInBoundsGEP(Builder.getInt8Ty(), PtrToStore,
+                                    {StrIt->AlignedSize}, "PrintBuffNextPtr");
+      LLVM_DEBUG(dbgs() << "inserting gep to the printf buffer:" << *PtrToStore
+                        << '\n');
+
+      // done with current argument, move to next
+      StrIt++;
+      continue;
     }
 
+    SmallVector<Value *, 32> WhatToStore;
+    processConstantStringArg(StrIt, Builder, WhatToStore);
+    StrIt++;
+
     for (Value *toStore : WhatToStore) {
       StoreInst *StBuff = Builder.CreateStore(toStore, PtrToStore);
       LLVM_DEBUG(dbgs() << "inserting store to printf buffer:" << *StBuff

>From 46213eb26952e50f3c40f085d8a2f041f7953c12 Mon Sep 17 00:00:00 2001
From: Steffen Holst Larsen <sholstla at amd.com>
Date: Fri, 30 Oct 2026 06:32:58 -0500
Subject: [PATCH 2/2] Fix script regen

Signed-off-by: Steffen Holst Larsen <sholstla at amd.com>
---
 clang/test/CodeGenHIP/printf_nonhostcall.cpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/clang/test/CodeGenHIP/printf_nonhostcall.cpp b/clang/test/CodeGenHIP/printf_nonhostcall.cpp
index 956d8950bcb18a..e46932a6a3ce34 100644
--- a/clang/test/CodeGenHIP/printf_nonhostcall.cpp
+++ b/clang/test/CodeGenHIP/printf_nonhostcall.cpp
@@ -1,9 +1,9 @@
 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2
 // REQUIRES: amdgpu-registered-target
 // RUN: %clang_cc1 -triple amdgpu-amd-amdhsa -x hip -emit-llvm -mprintf-kind=buffered -fcuda-is-device \
-// RUN:   -o - %s | FileCheck --enable-var-scope %s
+// RUN:   -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple amdgpu-amd-amdhsa -x hip -emit-llvm -ffp-exception-behavior=strict -mprintf-kind=buffered -fcuda-is-device \
-// RUN:   -o - %s | FileCheck --enable-var-scope --check-prefix=CHECK_CONSTRAINED %s
+// RUN:   -o - %s | FileCheck --check-prefix=CHECK_CONSTRAINED %s
 
 #define __device__ __attribute__((device))
 #define __shared__ __attribute__((shared))
@@ -12,6 +12,7 @@
 extern "C" __device__ int printf(const char *format, ...);
 
 // CHECK-LABEL: define dso_local noundef i32 @_Z4foo1v
+// CHECK-SAME: () #[[ATTR0:[0-9]+]] {
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:    [[S:%.*]] = alloca ptr, align 8, addrspace(5)
 // CHECK-NEXT:    [[S_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[S]] to ptr
@@ -67,6 +68,7 @@ extern "C" __device__ int printf(const char *format, ...);
 // CHECK-NEXT:    br label [[END_BLOCK]]
 //
 // CHECK_CONSTRAINED-LABEL: define dso_local noundef i32 @_Z4foo1v
+// CHECK_CONSTRAINED-SAME: () #[[ATTR0:[0-9]+]] {
 // CHECK_CONSTRAINED-NEXT:  entry:
 // CHECK_CONSTRAINED-NEXT:    [[S:%.*]] = alloca ptr, align 8, addrspace(5)
 // CHECK_CONSTRAINED-NEXT:    [[S_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[S]] to ptr
@@ -129,6 +131,7 @@ __device__ int foo1() {
 __device__ char *dstr;
 __device__ const
 // CHECK-LABEL: define dso_local noundef i32 @_Z4foo2v
+// CHECK-SAME: () #[[ATTR0]] {
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:    [[LCVAL:%.*]] = alloca i32, align 4, addrspace(5)
 // CHECK-NEXT:    [[LCVAL_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[LCVAL]] to ptr
@@ -179,6 +182,7 @@ __device__ const
 // CHECK-NEXT:    br label [[END_BLOCK]]
 //
 // CHECK_CONSTRAINED-LABEL: define dso_local noundef i32 @_Z4foo2v
+// CHECK_CONSTRAINED-SAME: () #[[ATTR0]] {
 // CHECK_CONSTRAINED-NEXT:  entry:
 // CHECK_CONSTRAINED-NEXT:    [[LCVAL:%.*]] = alloca i32, align 4, addrspace(5)
 // CHECK_CONSTRAINED-NEXT:    [[LCVAL_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[LCVAL]] to ptr
@@ -246,6 +250,7 @@ __device__ _BitInt(44) Int44 = 312;
 __device__ _BitInt(128) Int128 = 45637;
 
 // CHECK-LABEL: define dso_local noundef i32 @_Z4foo3v
+// CHECK-SAME: () #[[ATTR0]] {
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:    store i32 25, ptr addrspacecast (ptr addrspace(3) @_ZZ4foo3vE1s to ptr), align 4
 // CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @_ZZ4foo3vE1s to ptr), align 4
@@ -305,6 +310,7 @@ __device__ _BitInt(128) Int128 = 45637;
 // CHECK-NEXT:    br label [[END_BLOCK]]
 //
 // CHECK_CONSTRAINED-LABEL: define dso_local noundef i32 @_Z4foo3v
+// CHECK_CONSTRAINED-SAME: () #[[ATTR0]] {
 // CHECK_CONSTRAINED-NEXT:  entry:
 // CHECK_CONSTRAINED-NEXT:    store i32 25, ptr addrspacecast (ptr addrspace(3) @_ZZ4foo3vE1s to ptr), align 4
 // CHECK_CONSTRAINED-NEXT:    [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @_ZZ4foo3vE1s to ptr), align 4
@@ -371,6 +377,7 @@ __device__ int foo3() {
 
 //A non trivial case,
 // CHECK-LABEL: define dso_local noundef i32 @_Z4foo4v
+// CHECK-SAME: () #[[ATTR0]] {
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:    [[S:%.*]] = alloca ptr, align 8, addrspace(5)
 // CHECK-NEXT:    [[S_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[S]] to ptr
@@ -414,6 +421,7 @@ __device__ int foo3() {
 // CHECK-NEXT:    br label [[END_BLOCK]]
 //
 // CHECK_CONSTRAINED-LABEL: define dso_local noundef i32 @_Z4foo4v
+// CHECK_CONSTRAINED-SAME: () #[[ATTR0]] {
 // CHECK_CONSTRAINED-NEXT:  entry:
 // CHECK_CONSTRAINED-NEXT:    [[S:%.*]] = alloca ptr, align 8, addrspace(5)
 // CHECK_CONSTRAINED-NEXT:    [[S_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[S]] to ptr
@@ -464,7 +472,7 @@ __device__ int foo4() {
 // A 32-bit pointer, here to LDS or private memory, is stored in 4 bytes but
 // still takes an 8-byte slot, so the argument after it starts 8 bytes later.
 // CHECK-LABEL: define dso_local noundef i32 @_Z4foo5PU3AS3vPU3AS5v
-// CHECK-SAME: (ptr addrspace(3) noundef [[LDS:%.*]], ptr addrspace(5) noundef [[PRIV:%.*]]) #{{[0-9]+}} {
+// CHECK-SAME: (ptr addrspace(3) noundef [[LDS:%.*]], ptr addrspace(5) noundef [[PRIV:%.*]]) #[[ATTR0]] {
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:    [[LDS_ADDR:%.*]] = alloca ptr addrspace(3), align 4, addrspace(5)
 // CHECK-NEXT:    [[PRIV_ADDR:%.*]] = alloca ptr addrspace(5), align 4, addrspace(5)
@@ -497,7 +505,7 @@ __device__ int foo4() {
 // CHECK-NEXT:    br label [[END_BLOCK]]
 //
 // CHECK_CONSTRAINED-LABEL: define dso_local noundef i32 @_Z4foo5PU3AS3vPU3AS5v
-// CHECK_CONSTRAINED-SAME: (ptr addrspace(3) noundef [[LDS:%.*]], ptr addrspace(5) noundef [[PRIV:%.*]]) #{{[0-9]+}} {
+// CHECK_CONSTRAINED-SAME: (ptr addrspace(3) noundef [[LDS:%.*]], ptr addrspace(5) noundef [[PRIV:%.*]]) #[[ATTR0]] {
 // CHECK_CONSTRAINED-NEXT:  entry:
 // CHECK_CONSTRAINED-NEXT:    [[LDS_ADDR:%.*]] = alloca ptr addrspace(3), align 4, addrspace(5)
 // CHECK_CONSTRAINED-NEXT:    [[PRIV_ADDR:%.*]] = alloca ptr addrspace(5), align 4, addrspace(5)



More information about the cfe-commits mailing list