[clang] [OpenACC] Change lowering signature for 'destroy' (PR #156716)

2025-09-03 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin` 
running on `doug-worker-4` while building `clang` at step 6 
"test-build-unified-tree-check-all".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/190/builds/26641


Here is the relevant piece of the build log for the reference

```
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
 TEST 'lld :: MinGW/driver.test' FAILED 
Exit Code: 127

Command Output (stdout):
--
# RUN: at line 1
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld -### foo.o -m 
i386pe 2>&1 | /Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=X86 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld '-###' foo.o -m 
i386pe
# note: command had no output on stdout or stderr
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=X86 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# note: command had no output on stdout or stderr
# RUN: at line 7
echo "-### foo.o -m i386pe" > 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/tools/lld/test/MinGW/Output/driver.test.tmp.rsp
# executed command: echo '-### foo.o -m i386pe'
# note: command had no output on stdout or stderr
# RUN: at line 8
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld 
@/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/tools/lld/test/MinGW/Output/driver.test.tmp.rsp
 2>&1 | /Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=X86 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld 
@/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/tools/lld/test/MinGW/Output/driver.test.tmp.rsp
# note: command had no output on stdout or stderr
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=X86 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# note: command had no output on stdout or stderr
# RUN: at line 10
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld -### foo.o -m 
i386pep 2>&1 | 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=X64 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld '-###' foo.o -m 
i386pep
# note: command had no output on stdout or stderr
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=X64 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# note: command had no output on stdout or stderr
# RUN: at line 16
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld -### foo.o -m 
thumb2pe 2>&1 | 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=ARM 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld '-###' foo.o -m 
thumb2pe
# note: command had no output on stdout or stderr
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=ARM 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# note: command had no output on stdout or stderr
# RUN: at line 22
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld -### foo.o -m 
arm64pe 2>&1 | 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=ARM64 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld '-###' foo.o -m 
arm64pe
# note: command had no output on stdout or stderr
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=ARM64 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# note: command had no output on stdout or stderr
# RUN: at line 28
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld -### foo.o -m 
arm64ecpe 2>&1 | 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=ARM64EC 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld '-###' foo.o -m 
arm64ecpe
# note: command had no output on stdout or stderr
# executed command: 
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/FileCheck 
-check-prefix=ARM64EC 
/Users/buildbot/buildbot-root/llvm-project/lld/test/MinGW/driver.test
# note: command had no output on stdout or stderr
# RUN: at line 34
/Volumes/RAMDisk/buildbot-root/aarch64-darwin/build/bin/ld.lld -### foo.o -m 
arm64xpe 2>&1 | 

[clang] [OpenACC] Change lowering signature for 'destroy' (PR #156716)

2025-09-03 Thread Erich Keane via cfe-commits

https://github.com/erichkeane closed 
https://github.com/llvm/llvm-project/pull/156716
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [OpenACC] Change lowering signature for 'destroy' (PR #156716)

2025-09-03 Thread Razvan Lupusoru via cfe-commits

https://github.com/razvanlupusoru approved this pull request.

Thank you!

https://github.com/llvm/llvm-project/pull/156716
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [OpenACC] Change lowering signature for 'destroy' (PR #156716)

2025-09-03 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Erich Keane (erichkeane)


Changes

Patch #156545 is introducing a different syntax for the 'destroy' 
section of a recipe, which takes the 'original' value as the first argument, 
and the one-to-be-destroyed as the 2nd.  This patch corrects the lowering to 
match that signature.

---

Patch is 91.57 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/156716.diff


14 Files Affected:

- (modified) clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp (+7-3) 
- (modified) clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp 
(+2-2) 
- (modified) clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp (+2-2) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/combined-reduction-clause-inline-ops.cpp (+19-19) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/combined-reduction-clause-outline-ops.cpp 
(+18-18) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/compute-firstprivate-clause-templates.cpp (+1-1) 
- (modified) clang/test/CIR/CodeGenOpenACC/compute-firstprivate-clause.cpp 
(+2-2) 
- (modified) clang/test/CIR/CodeGenOpenACC/compute-private-clause-templates.cpp 
(+1-1) 
- (modified) clang/test/CIR/CodeGenOpenACC/compute-private-clause.cpp (+2-2) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/compute-reduction-clause-inline-ops.cpp (+18-18) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/compute-reduction-clause-outline-ops.cpp (+18-18) 
- (modified) clang/test/CIR/CodeGenOpenACC/loop-private-clause.cpp (+2-2) 
- (modified) clang/test/CIR/CodeGenOpenACC/loop-reduction-clause-inline-ops.cpp 
(+18-18) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/loop-reduction-clause-outline-ops.cpp (+18-18) 


``diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp 
b/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
index 98e71b6609f0d..41834da8a86c3 100644
--- a/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
@@ -548,14 +548,18 @@ class OpenACCClauseCIREmitter final
   mlir::Value mainOp, CharUnits alignment,
   QualType baseType,
   mlir::Region &destroyRegion) {
-mlir::Block *block = builder.createBlock(
-&destroyRegion, destroyRegion.end(), {mainOp.getType()}, {loc});
+mlir::Block *block =
+builder.createBlock(&destroyRegion, destroyRegion.end(),
+{mainOp.getType(), mainOp.getType()}, {loc, loc});
 builder.setInsertionPointToEnd(&destroyRegion.back());
 CIRGenFunction::LexicalScope ls(cgf, loc, block);
 
 mlir::Type elementTy =
 mlir::cast(mainOp.getType()).getPointee();
-Address addr{block->getArgument(0), elementTy, alignment};
+// The destroy region has a signature of "original item, privatized item".
+// So the 2nd item is the one that needs destroying, the former is just for
+// reference and we don't really have a need for it at the moment.
+Address addr{block->getArgument(1), elementTy, alignment};
 cgf.emitDestroy(addr, baseType,
 cgf.getDestroyer(QualType::DK_cxx_destructor));
 
diff --git a/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp 
b/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
index f17e7b1a9b691..7a71842d5014f 100644
--- a/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
+++ b/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
@@ -58,7 +58,7 @@ struct HasDtor {
 // CHECK-NEXT: acc.yield
 //
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr> 
{{.*}}):
+// CHECK-NEXT: ^bb0(%[[ORIG:.*]]: !cir.ptr> 
{{.*}}, %[[ARG:.*]]: !cir.ptr> {{.*}}):
 // CHECK-NEXT: %[[LAST_IDX:.*]] = cir.const #cir.int<4> : !u64i
 // CHECK-NEXT: %[[ARRPTR:.*]] = cir.cast(array_to_ptrdecay, %[[ARG]] : 
!cir.ptr>), !cir.ptr
 // CHECK-NEXT: %[[ELEM:.*]] = cir.ptr_stride(%[[ARRPTR]] : 
!cir.ptr, %[[LAST_IDX]] : !u64i), !cir.ptr
@@ -311,7 +311,7 @@ struct HasDtor {
 // CHECK-NEXT: cir.call @_ZN7HasDtorC1ERKS_(%[[ARG_TO]], %[[ARG_FROM]]) 
nothrow : (!cir.ptr, !cir.ptr) -> ()
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr {{.*}}):
+// CHECK-NEXT: ^bb0(%[[ORIG:.*]]: !cir.ptr {{.*}}, %[[ARG:.*]]: 
!cir.ptr {{.*}}):
 // CHECK-NEXT: cir.call @_ZN7HasDtorD1Ev(%[[ARG]]) nothrow : 
(!cir.ptr) -> ()
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: }
diff --git a/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp 
b/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
index 0b58bae9239b2..6063f7d7f500b 100644
--- a/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
+++ b/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
@@ -20,7 +20,7 @@ struct HasDtor {
 // CHECK-NEXT: cir.alloca !cir.array, 
!cir.ptr>, ["openacc.private.init"]
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr> 
{{.*}}):
+// CHECK-NEXT:

[clang] [OpenACC] Change lowering signature for 'destroy' (PR #156716)

2025-09-03 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clangir

Author: Erich Keane (erichkeane)


Changes

Patch #156545 is introducing a different syntax for the 'destroy' 
section of a recipe, which takes the 'original' value as the first argument, 
and the one-to-be-destroyed as the 2nd.  This patch corrects the lowering to 
match that signature.

---

Patch is 91.57 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/156716.diff


14 Files Affected:

- (modified) clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp (+7-3) 
- (modified) clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp 
(+2-2) 
- (modified) clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp (+2-2) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/combined-reduction-clause-inline-ops.cpp (+19-19) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/combined-reduction-clause-outline-ops.cpp 
(+18-18) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/compute-firstprivate-clause-templates.cpp (+1-1) 
- (modified) clang/test/CIR/CodeGenOpenACC/compute-firstprivate-clause.cpp 
(+2-2) 
- (modified) clang/test/CIR/CodeGenOpenACC/compute-private-clause-templates.cpp 
(+1-1) 
- (modified) clang/test/CIR/CodeGenOpenACC/compute-private-clause.cpp (+2-2) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/compute-reduction-clause-inline-ops.cpp (+18-18) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/compute-reduction-clause-outline-ops.cpp (+18-18) 
- (modified) clang/test/CIR/CodeGenOpenACC/loop-private-clause.cpp (+2-2) 
- (modified) clang/test/CIR/CodeGenOpenACC/loop-reduction-clause-inline-ops.cpp 
(+18-18) 
- (modified) 
clang/test/CIR/CodeGenOpenACC/loop-reduction-clause-outline-ops.cpp (+18-18) 


``diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp 
b/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
index 98e71b6609f0d..41834da8a86c3 100644
--- a/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
@@ -548,14 +548,18 @@ class OpenACCClauseCIREmitter final
   mlir::Value mainOp, CharUnits alignment,
   QualType baseType,
   mlir::Region &destroyRegion) {
-mlir::Block *block = builder.createBlock(
-&destroyRegion, destroyRegion.end(), {mainOp.getType()}, {loc});
+mlir::Block *block =
+builder.createBlock(&destroyRegion, destroyRegion.end(),
+{mainOp.getType(), mainOp.getType()}, {loc, loc});
 builder.setInsertionPointToEnd(&destroyRegion.back());
 CIRGenFunction::LexicalScope ls(cgf, loc, block);
 
 mlir::Type elementTy =
 mlir::cast(mainOp.getType()).getPointee();
-Address addr{block->getArgument(0), elementTy, alignment};
+// The destroy region has a signature of "original item, privatized item".
+// So the 2nd item is the one that needs destroying, the former is just for
+// reference and we don't really have a need for it at the moment.
+Address addr{block->getArgument(1), elementTy, alignment};
 cgf.emitDestroy(addr, baseType,
 cgf.getDestroyer(QualType::DK_cxx_destructor));
 
diff --git a/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp 
b/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
index f17e7b1a9b691..7a71842d5014f 100644
--- a/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
+++ b/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
@@ -58,7 +58,7 @@ struct HasDtor {
 // CHECK-NEXT: acc.yield
 //
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr> 
{{.*}}):
+// CHECK-NEXT: ^bb0(%[[ORIG:.*]]: !cir.ptr> 
{{.*}}, %[[ARG:.*]]: !cir.ptr> {{.*}}):
 // CHECK-NEXT: %[[LAST_IDX:.*]] = cir.const #cir.int<4> : !u64i
 // CHECK-NEXT: %[[ARRPTR:.*]] = cir.cast(array_to_ptrdecay, %[[ARG]] : 
!cir.ptr>), !cir.ptr
 // CHECK-NEXT: %[[ELEM:.*]] = cir.ptr_stride(%[[ARRPTR]] : 
!cir.ptr, %[[LAST_IDX]] : !u64i), !cir.ptr
@@ -311,7 +311,7 @@ struct HasDtor {
 // CHECK-NEXT: cir.call @_ZN7HasDtorC1ERKS_(%[[ARG_TO]], %[[ARG_FROM]]) 
nothrow : (!cir.ptr, !cir.ptr) -> ()
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr {{.*}}):
+// CHECK-NEXT: ^bb0(%[[ORIG:.*]]: !cir.ptr {{.*}}, %[[ARG:.*]]: 
!cir.ptr {{.*}}):
 // CHECK-NEXT: cir.call @_ZN7HasDtorD1Ev(%[[ARG]]) nothrow : 
(!cir.ptr) -> ()
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: }
diff --git a/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp 
b/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
index 0b58bae9239b2..6063f7d7f500b 100644
--- a/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
+++ b/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
@@ -20,7 +20,7 @@ struct HasDtor {
 // CHECK-NEXT: cir.alloca !cir.array, 
!cir.ptr>, ["openacc.private.init"]
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr> 
{{.*}}):
+// CHECK-NEX

[clang] [OpenACC] Change lowering signature for 'destroy' (PR #156716)

2025-09-03 Thread Erich Keane via cfe-commits

https://github.com/erichkeane created 
https://github.com/llvm/llvm-project/pull/156716

Patch #156545 is introducing a different syntax for the 'destroy' section of a 
recipe, which takes the 'original' value as the first argument, and the 
one-to-be-destroyed as the 2nd.  This patch corrects the lowering to match that 
signature.

>From d05983cf9b44817b23838b0b4335327640b1ed81 Mon Sep 17 00:00:00 2001
From: erichkeane 
Date: Wed, 3 Sep 2025 10:00:56 -0700
Subject: [PATCH] [OpenACC] Change lowering signature for 'destroy'

Patch #156545 is introducing a different syntax for the 'destroy'
section of a recipe, which takes the 'original' value as the first
argument, and the one-to-be-destroyed as the 2nd.  This patch corrects
the lowering to match that signature.
---
 clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp | 10 +++--
 .../combined-firstprivate-clause.cpp  |  4 +-
 .../combined-private-clause.cpp   |  4 +-
 .../combined-reduction-clause-inline-ops.cpp  | 38 +--
 .../combined-reduction-clause-outline-ops.cpp | 36 +-
 .../compute-firstprivate-clause-templates.cpp |  2 +-
 .../compute-firstprivate-clause.cpp   |  4 +-
 .../compute-private-clause-templates.cpp  |  2 +-
 .../CodeGenOpenACC/compute-private-clause.cpp |  4 +-
 .../compute-reduction-clause-inline-ops.cpp   | 36 +-
 .../compute-reduction-clause-outline-ops.cpp  | 36 +-
 .../CodeGenOpenACC/loop-private-clause.cpp|  4 +-
 .../loop-reduction-clause-inline-ops.cpp  | 36 +-
 .../loop-reduction-clause-outline-ops.cpp | 36 +-
 14 files changed, 128 insertions(+), 124 deletions(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp 
b/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
index 98e71b6609f0d..41834da8a86c3 100644
--- a/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
@@ -548,14 +548,18 @@ class OpenACCClauseCIREmitter final
   mlir::Value mainOp, CharUnits alignment,
   QualType baseType,
   mlir::Region &destroyRegion) {
-mlir::Block *block = builder.createBlock(
-&destroyRegion, destroyRegion.end(), {mainOp.getType()}, {loc});
+mlir::Block *block =
+builder.createBlock(&destroyRegion, destroyRegion.end(),
+{mainOp.getType(), mainOp.getType()}, {loc, loc});
 builder.setInsertionPointToEnd(&destroyRegion.back());
 CIRGenFunction::LexicalScope ls(cgf, loc, block);
 
 mlir::Type elementTy =
 mlir::cast(mainOp.getType()).getPointee();
-Address addr{block->getArgument(0), elementTy, alignment};
+// The destroy region has a signature of "original item, privatized item".
+// So the 2nd item is the one that needs destroying, the former is just for
+// reference and we don't really have a need for it at the moment.
+Address addr{block->getArgument(1), elementTy, alignment};
 cgf.emitDestroy(addr, baseType,
 cgf.getDestroyer(QualType::DK_cxx_destructor));
 
diff --git a/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp 
b/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
index f17e7b1a9b691..7a71842d5014f 100644
--- a/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
+++ b/clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp
@@ -58,7 +58,7 @@ struct HasDtor {
 // CHECK-NEXT: acc.yield
 //
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr> 
{{.*}}):
+// CHECK-NEXT: ^bb0(%[[ORIG:.*]]: !cir.ptr> 
{{.*}}, %[[ARG:.*]]: !cir.ptr> {{.*}}):
 // CHECK-NEXT: %[[LAST_IDX:.*]] = cir.const #cir.int<4> : !u64i
 // CHECK-NEXT: %[[ARRPTR:.*]] = cir.cast(array_to_ptrdecay, %[[ARG]] : 
!cir.ptr>), !cir.ptr
 // CHECK-NEXT: %[[ELEM:.*]] = cir.ptr_stride(%[[ARRPTR]] : 
!cir.ptr, %[[LAST_IDX]] : !u64i), !cir.ptr
@@ -311,7 +311,7 @@ struct HasDtor {
 // CHECK-NEXT: cir.call @_ZN7HasDtorC1ERKS_(%[[ARG_TO]], %[[ARG_FROM]]) 
nothrow : (!cir.ptr, !cir.ptr) -> ()
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr {{.*}}):
+// CHECK-NEXT: ^bb0(%[[ORIG:.*]]: !cir.ptr {{.*}}, %[[ARG:.*]]: 
!cir.ptr {{.*}}):
 // CHECK-NEXT: cir.call @_ZN7HasDtorD1Ev(%[[ARG]]) nothrow : 
(!cir.ptr) -> ()
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: }
diff --git a/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp 
b/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
index 0b58bae9239b2..6063f7d7f500b 100644
--- a/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
+++ b/clang/test/CIR/CodeGenOpenACC/combined-private-clause.cpp
@@ -20,7 +20,7 @@ struct HasDtor {
 // CHECK-NEXT: cir.alloca !cir.array, 
!cir.ptr>, ["openacc.private.init"]
 // CHECK-NEXT: acc.yield
 // CHECK-NEXT: } destroy {
-// CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr> 
{{.*}}):
+// CHECK-NEXT: ^bb0(%[[ORIG