https://github.com/durin42 updated 
https://github.com/llvm/llvm-project/pull/239725

>From 36a8e955f77f8cf9bf7a57d6a414308854de6e6f Mon Sep 17 00:00:00 2001
From: Augie Fackler <[email protected]>
Date: Wed, 4 Nov 2026 13:04:31 -0500
Subject: [PATCH] CGCall: emit allocptr attributes for operator delete

With this change, we're almost ready to drop the entire table out of
MemoryBuiltins.cpp and rely solely on attributes to detect allocator
functions.

Per review feedback on D123085, emit `allocptr` in
`CodeGenModule::ConstructAttributeList` so that both the function
declaration and all calls to replaceable global `operator delete` /
`operator delete[]` receive the attribute.

This patch is originally from 2023 and was rebased and revised with
assistance from an LLM. I have manually reviewed the diffs to the
limit of my abilities (I don't do much in LLVM, and this is my first
time touching clang in a meaningful way) and they appear sensible. The
commit messages are entirely written by me.

Differential Revision: https://reviews.llvm.org/D123085
---
 clang/lib/CodeGen/CGCall.cpp                  |  9 +++++
 clang/test/CIR/CodeGen/delete-aligned.cpp     |  2 +-
 .../test/CIR/CodeGen/delete-array-aligned.cpp |  2 +-
 clang/test/CIR/CodeGen/delete.cpp             |  4 +-
 .../CIR/CodeGen/new-delete-deactivation.cpp   | 10 ++---
 clang/test/CIR/CodeGen/new-delete.cpp         |  6 +--
 .../nobuiltin-replaceable-allocation.cpp      |  2 +-
 .../new-array-init-list-non-trivial-dtor.cpp  |  4 +-
 .../CodeGenHIP/array-structor-addrspace.hip   |  2 +-
 clang/test/CodeGen/pr53127.cpp                |  2 +-
 .../builtin-operator-new-delete.cpp           |  6 +--
 .../CodeGenCXX/cxx1y-sized-deallocation.cpp   | 40 +++++++++----------
 .../CodeGenCXX/cxx1z-aligned-allocation.cpp   | 14 +++----
 .../CodeGenCXX/cxx2a-destroying-delete.cpp    | 14 +++----
 clang/test/CodeGenCXX/delete-two-arg.cpp      |  2 +-
 clang/test/CodeGenCXX/delete.cpp              |  6 +--
 clang/test/CodeGenCXX/dllimport.cpp           |  2 +-
 clang/test/CodeGenCXX/exceptions.cpp          | 14 +++----
 .../CodeGenCXX/microsoft-abi-structors.cpp    |  6 +--
 .../microsoft-vector-deleting-dtors.cpp       | 40 +++++++++----------
 .../microsoft-vector-deleting-dtors2.cpp      | 18 ++++-----
 .../CodeGenCXX/ms-vdtors-devirtualization.cpp |  8 ++--
 ...lobal-delete-forwarding-at-delete-site.cpp |  4 +-
 .../msvc-global-delete-scalar-array-split.cpp |  6 +--
 .../msvc-global-delete-scope-no-dtor.cpp      |  2 +-
 .../msvc-no-global-delete-forwarding.cpp      |  6 +--
 ...svc-vector-deleting-dtors-sized-delete.cpp |  4 +-
 clang/test/CodeGenCXX/new-init-stmt-expr.cpp  |  4 +-
 clang/test/CodeGenCXX/new.cpp                 |  6 +--
 .../CodeGenCXX/ptrauth-virtual-function.cpp   |  2 +-
 clang/test/CodeGenCoroutines/coro-alloc.cpp   |  4 +-
 clang/test/CodeGenCoroutines/coro-cleanup.cpp |  4 +-
 clang/test/CodeGenCoroutines/coro-gro.cpp     |  2 +-
 clang/test/Headers/openmp_new_nothrow.cpp     | 20 +++++-----
 .../msvc-vector-deleting-destructors.cpp      |  8 ++--
 .../OpenMP/structured-bindings-codegen.cpp    |  2 +-
 .../PCH/msvc-vector-deleting-destructors.cpp  |  8 ++--
 37 files changed, 152 insertions(+), 143 deletions(-)

diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 516477250e6e95..c1041a3dfc41c6 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -3185,6 +3185,15 @@ void CodeGenModule::ConstructAttributeList(StringRef 
Name,
     }
   }
 
+  if (const auto *Fn = dyn_cast_if_present<FunctionDecl>(TargetDecl)) {
+    if (Fn->isReplaceableGlobalAllocationFunction() &&
+        Fn->getDeclName().isAnyOperatorDelete()) {
+      auto IRArgs = IRFunctionArgs.getIRArgs(0);
+      assert(IRArgs.second == 1 && "Expected only a single pointer to 
delete.");
+      ArgAttrs[IRArgs.first].addAttribute(llvm::Attribute::AllocatedPointer);
+    }
+  }
+
   unsigned ArgNo = 0;
   for (CGFunctionInfo::const_arg_iterator I = FI.arg_begin(), E = FI.arg_end();
        I != E; ++I, ++ArgNo) {
diff --git a/clang/test/CIR/CodeGen/delete-aligned.cpp 
b/clang/test/CIR/CodeGen/delete-aligned.cpp
index be18ea46c5ecab..98748b46b9ce7e 100644
--- a/clang/test/CIR/CodeGen/delete-aligned.cpp
+++ b/clang/test/CIR/CodeGen/delete-aligned.cpp
@@ -47,7 +47,7 @@ void a2(A *p) { delete p; }
 // OGCG:   %[[ISNULL:.*]] = icmp eq ptr %[[P]], null
 // OGCG:   br i1 %[[ISNULL]], label %{{.*}}, label %[[DELETE_NOTNULL:.*]]
 // OGCG: [[DELETE_NOTNULL]]:
-// OGCG:   call void @_ZdlPvmSt11align_val_t(ptr noundef %[[P]], i64 noundef 
512, i64 noundef 32)
+// OGCG:   call void @_ZdlPvmSt11align_val_t(ptr allocptr noundef %[[P]], i64 
noundef 512, i64 noundef 32)
 
 
 // Class-specific aligned operator delete.
diff --git a/clang/test/CIR/CodeGen/delete-array-aligned.cpp 
b/clang/test/CIR/CodeGen/delete-array-aligned.cpp
index 493c6487341a99..bbf81fa7855721 100644
--- a/clang/test/CIR/CodeGen/delete-array-aligned.cpp
+++ b/clang/test/CIR/CodeGen/delete-array-aligned.cpp
@@ -27,7 +27,7 @@ void test_global_aligned(OverAlignedTy *p) { delete[] p; }
 // CIR-AFTER-NEXT: }
 
 // LLVM-LABEL: define dso_local void @_Z19test_global_alignedP13OverAlignedTy(
-// LLVM: call void @_ZdaPvSt11align_val_t(ptr {{(noundef )?}}%{{.*}}, i64 
{{(noundef )?}}128)
+// LLVM: call void @_ZdaPvSt11align_val_t(ptr {{(allocptr )?}}{{(noundef 
)?}}%{{.*}}, i64 {{(noundef )?}}128)
 
 struct alignas(128) OverAlignedTyClassDelete {
   OverAlignedTyClassDelete();
diff --git a/clang/test/CIR/CodeGen/delete.cpp 
b/clang/test/CIR/CodeGen/delete.cpp
index 47f36519592bb7..9d803e50de9a0f 100644
--- a/clang/test/CIR/CodeGen/delete.cpp
+++ b/clang/test/CIR/CodeGen/delete.cpp
@@ -107,7 +107,7 @@ Container::~Container() { delete contents; }
 // OGCG:   br i1 %[[ISNULL]], label %{{.*}}, label %[[DELETE_NOTNULL:.*]]
 // OGCG: [[DELETE_NOTNULL]]:
 // OGCG:   call void @_ZN8ContentsD2Ev(ptr noundef nonnull align 1 
dereferenceable(1) %[[CONTENTS_PTR]])
-// OGCG:   call void @_ZdlPvm(ptr noundef %[[CONTENTS_PTR]], i64 noundef 1)
+// OGCG:   call void @_ZdlPvm(ptr allocptr noundef %[[CONTENTS_PTR]], i64 
noundef 1)
 
 // Contents::~Contents()
 // CIR: cir.func {{.*}} @_ZN8ContentsD2Ev
@@ -117,7 +117,7 @@ Container::~Container() { delete contents; }
 // operator delete(void*, unsigned long)
 // CIR: cir.func {{.*}} @_ZdlPvm(!cir.ptr<!void> {llvm.noundef}, !u64i 
{llvm.noundef})
 // LLVM: declare void @_ZdlPvm(ptr noundef, i64 noundef)
-// OGCG: declare void @_ZdlPvm(ptr noundef, i64 noundef)
+// OGCG: declare void @_ZdlPvm(ptr allocptr noundef, i64 noundef)
 
 struct StructWithVirtualDestructor {
   virtual ~StructWithVirtualDestructor();
diff --git a/clang/test/CIR/CodeGen/new-delete-deactivation.cpp 
b/clang/test/CIR/CodeGen/new-delete-deactivation.cpp
index b1d58a2278d8e6..6e2d2bd553d359 100644
--- a/clang/test/CIR/CodeGen/new-delete-deactivation.cpp
+++ b/clang/test/CIR/CodeGen/new-delete-deactivation.cpp
@@ -95,7 +95,7 @@ A *deact_simple() { return new A(makeB()); }
 // OGCG:   %[[IS_ACTIVE:.*]] = load i1, ptr %[[ACTIVE]]
 // OGCG:   br i1 %[[IS_ACTIVE]], label %[[DO_DELETE:.*]], label 
%[[SKIP_DELETE:.*]]
 // OGCG: [[DO_DELETE]]:
-// OGCG:   call void @_ZdlPv(ptr %[[PTR]]) #[[OGCG_ATTR_BUILTIN_DEL:.*]]
+// OGCG:   call void @_ZdlPv(ptr allocptr %[[PTR]]) 
#[[OGCG_ATTR_BUILTIN_DEL:.*]]
 
 A *deact_if(bool cond) {
   if (cond)
@@ -156,7 +156,7 @@ A *deact_if(bool cond) {
 // OGCG:   %[[IS_ACTIVE:.*]] = load i1, ptr %[[ACTIVE]]
 // OGCG:   br i1 %[[IS_ACTIVE]], label %[[DO_DELETE:.*]], label 
%[[SKIP_DELETE:.*]]
 // OGCG: [[DO_DELETE]]:
-// OGCG:   call void @_ZdlPv(ptr %[[PTR]])
+// OGCG:   call void @_ZdlPv(ptr allocptr %[[PTR]])
 
 A *deact_ternary(bool cond) { return (new A(makeB()), cond) ? nullptr : 
nullptr; }
 
@@ -208,7 +208,7 @@ A *deact_ternary(bool cond) { return (new A(makeB()), cond) 
? nullptr : nullptr;
 // OGCG:   %[[IS_ACTIVE:.*]] = load i1, ptr %[[ACTIVE]]
 // OGCG:   br i1 %[[IS_ACTIVE]], label %[[DO_DELETE:.*]], label 
%[[SKIP_DELETE:.*]]
 // OGCG: [[DO_DELETE]]:
-// OGCG:   call void @_ZdlPv(ptr %[[PTR]])
+// OGCG:   call void @_ZdlPv(ptr allocptr %[[PTR]])
 
 A *deact_while_cond(int n) {
   while ((new A(makeB()), n > 0))
@@ -284,7 +284,7 @@ A *deact_while_cond(int n) {
 // OGCG:   %[[IS_ACTIVE:.*]] = load i1, ptr %[[ACTIVE]]
 // OGCG:   br i1 %[[IS_ACTIVE]], label %[[DO_DELETE:.*]], label 
%[[SKIP_DELETE:.*]]
 // OGCG: [[DO_DELETE]]:
-// OGCG:   call void @_ZdlPv(ptr %[[PTR]])
+// OGCG:   call void @_ZdlPv(ptr allocptr %[[PTR]])
 
 A *deact_switch(int kind) {
   switch (kind) {
@@ -356,7 +356,7 @@ A *deact_switch(int kind) {
 // OGCG:   %[[IS_ACTIVE:.*]] = load i1, ptr %[[ACTIVE]]
 // OGCG:   br i1 %[[IS_ACTIVE]], label %[[DO_DELETE:.*]], label 
%[[SKIP_DELETE:.*]]
 // OGCG: [[DO_DELETE]]:
-// OGCG:   call void @_ZdlPv(ptr %[[PTR]])
+// OGCG:   call void @_ZdlPv(ptr allocptr %[[PTR]])
 
 // LLVM-DAG: attributes #[[ATTR_BUILTIN_NEW]] = 
{{{.*}}builtin{{.*}}memory(inaccessiblemem: readwrite, errnomem: write){{.*}}}
 // LLVM-DAG: attributes #[[ATTR_BUILTIN_DEL]] = {{{.*}}builtin{{.*}}}
diff --git a/clang/test/CIR/CodeGen/new-delete.cpp 
b/clang/test/CIR/CodeGen/new-delete.cpp
index da453049aeaa15..4aa19334533cd4 100644
--- a/clang/test/CIR/CodeGen/new-delete.cpp
+++ b/clang/test/CIR/CodeGen/new-delete.cpp
@@ -73,7 +73,7 @@ A *a() {
 // OGCG:   store ptr %[[EXN_PTR]], ptr %[[EXN_SLOT]]
 // OGCG:   %[[TYPEID:.*]] = extractvalue { ptr, i32 } %[[EXN]], 1
 // OGCG:   store i32 %[[TYPEID]], ptr %[[EHSELECTOR_SLOT]]
-// OGCG:   call void @_ZdlPv(ptr %[[PTR]]) #[[OGCG_ATTR_BUILTIN_DEL:.*]]
+// OGCG:   call void @_ZdlPv(ptr allocptr %[[PTR]]) 
#[[OGCG_ATTR_BUILTIN_DEL:.*]]
 // OGCG:   br label %[[EH_RESUME:.*]]
 // OGCG: [[EH_RESUME]]:
 // OGCG:   %[[EXN_PTR:.*]] = load ptr, ptr %[[EXN_SLOT]]
@@ -154,7 +154,7 @@ A *b() {
 // OGCG:   store ptr %[[EXN_PTR]], ptr %[[EXN_SLOT]]
 // OGCG:   %[[TYPEID:.*]] = extractvalue { ptr, i32 } %[[EXN]], 1
 // OGCG:   store i32 %[[TYPEID]], ptr %[[EHSELECTOR_SLOT]]
-// OGCG:   call void @_ZdlPv(ptr %[[PTR]]) #[[OGCG_ATTR_BUILTIN_DEL]]
+// OGCG:   call void @_ZdlPv(ptr allocptr %[[PTR]]) #[[OGCG_ATTR_BUILTIN_DEL]]
 // OGCG:   br label %[[EH_RESUME:.*]]
 // OGCG: [[EH_RESUME]]:
 // OGCG:   %[[EXN_PTR:.*]] = load ptr, ptr %[[EXN_SLOT]]
@@ -325,7 +325,7 @@ C *test_new_delete_conditional(bool cond) {
 // OGCG:   br i1 %[[OG_ACTIVE]], label %[[OG_DO_DEL:.*]], label 
%[[OG_SKIP_DEL:.*]]
 // OGCG: [[OG_DO_DEL]]:
 // OGCG:   %[[OG_LOAD:.*]] = load ptr, ptr %[[OG_SAVE]], align 8
-// OGCG:   call void @_ZdlPv(ptr %[[OG_LOAD]]) #[[OGCG_ATTR_BUILTIN_DEL]]
+// OGCG:   call void @_ZdlPv(ptr allocptr %[[OG_LOAD]]) 
#[[OGCG_ATTR_BUILTIN_DEL]]
 // OGCG:   resume
 
 void *operator new(unsigned long, int);
diff --git a/clang/test/CIR/CodeGen/nobuiltin-replaceable-allocation.cpp 
b/clang/test/CIR/CodeGen/nobuiltin-replaceable-allocation.cpp
index 68f849299ddc3f..6449913732f9b8 100644
--- a/clang/test/CIR/CodeGen/nobuiltin-replaceable-allocation.cpp
+++ b/clang/test/CIR/CodeGen/nobuiltin-replaceable-allocation.cpp
@@ -20,6 +20,6 @@ void operator delete(void *p) noexcept {
 // CIR: cir.func {{.*}}@_ZdlPv{{.*}} attributes {{.*}}nobuiltin{{.*}} {
 
 // LLVM: define dso_local noundef nonnull ptr @_Znwm(i64 noundef %{{.*}}) 
#[[OGCG_NEW_ATTRS:[0-9]+]]
-// LLVM: define dso_local void @_ZdlPv(ptr noundef %{{.*}}) 
#[[OGCG_DEL_ATTRS:[0-9]+]]
+// LLVM: define dso_local void @_ZdlPv(ptr {{(allocptr )?}}noundef %{{.*}}) 
#[[OGCG_DEL_ATTRS:[0-9]+]]
 // LLVM: attributes #[[OGCG_NEW_ATTRS]] = { {{.*}}nobuiltin{{.*}} }
 // LLVM: attributes #[[OGCG_DEL_ATTRS]] = { {{.*}}nobuiltin{{.*}} }
diff --git a/clang/test/CIR/CodeGenCXX/new-array-init-list-non-trivial-dtor.cpp 
b/clang/test/CIR/CodeGenCXX/new-array-init-list-non-trivial-dtor.cpp
index 5d7e5f54b4b796..ea8cec786bd6b0 100644
--- a/clang/test/CIR/CodeGenCXX/new-array-init-list-non-trivial-dtor.cpp
+++ b/clang/test/CIR/CodeGenCXX/new-array-init-list-non-trivial-dtor.cpp
@@ -111,7 +111,7 @@ void cleanup_const_exact() { new Throws[3]{1, 2, 3}; }
 // OGCG-SAME: , [ %[[ELT:.*]], %[[DTOR_BODY]] ]
 // OGCG:   %[[ELT]] = getelementptr inbounds %struct.Throws, ptr %[[PAST]], 
i64 -1
 // OGCG:   call void @_ZN6ThrowsD1Ev(ptr {{[^,]*}} %[[ELT]])
-// OGCG:   call void @_ZdaPv(ptr noundef %[[ALLOC]])
+// OGCG:   call void @_ZdaPv(ptr allocptr noundef %[[ALLOC]])
 // OGCG:   resume { ptr, i32 }
 
 // Constant-bound array new where the bound (5) is larger than the number of
@@ -263,5 +263,5 @@ void cleanup_const_partial() { new Throws[5]{1, 2, 3}; }
 // OGCG:   %[[INIT_PAST:.*]] = phi ptr
 // OGCG:   %[[INIT_ELT:.*]] = getelementptr inbounds %struct.Throws, ptr 
%[[INIT_PAST]], i64 -1
 // OGCG:   call void @_ZN6ThrowsD1Ev(ptr {{[^,]*}} %[[INIT_ELT]])
-// OGCG:   call void @_ZdaPv(ptr noundef %[[ALLOC]])
+// OGCG:   call void @_ZdaPv(ptr allocptr noundef %[[ALLOC]])
 // OGCG:   resume { ptr, i32 }
diff --git a/clang/test/CIR/CodeGenHIP/array-structor-addrspace.hip 
b/clang/test/CIR/CodeGenHIP/array-structor-addrspace.hip
index c5f9e41a1da7e2..4240682d95704e 100644
--- a/clang/test/CIR/CodeGenHIP/array-structor-addrspace.hip
+++ b/clang/test/CIR/CodeGenHIP/array-structor-addrspace.hip
@@ -92,7 +92,7 @@ __device__ void delete_array(S *p) { delete[] p; }
 // OGCG: %[[ALLOC:.*]] = getelementptr inbounds i8, ptr addrspace(4) %{{.*}}, 
i64 -8
 // OGCG: load i64, ptr addrspace(4) %[[ALLOC]], align 4
 // OGCG: call spir_func addrspace(4) void @_ZN1SD1Ev(ptr addrspace(4) {{.*}})
-// OGCG: call spir_func addrspace(4) void @_ZdaPvm(ptr addrspace(4) noundef 
%[[ALLOC]], i64 noundef %{{.*}})
+// OGCG: call spir_func addrspace(4) void @_ZdaPvm(ptr addrspace(4) allocptr 
noundef %[[ALLOC]], i64 noundef %{{.*}})
 
 #else
 
diff --git a/clang/test/CodeGen/pr53127.cpp b/clang/test/CodeGen/pr53127.cpp
index 4fd6c0c95e7677..8a4c3a9b53d9a9 100644
--- a/clang/test/CodeGen/pr53127.cpp
+++ b/clang/test/CodeGen/pr53127.cpp
@@ -71,7 +71,7 @@ void operator delete(void*);
 // CHECK-NEXT:    [[CALL24:%.*]] = call noundef zeroext i1 @_Z1ev()
 // CHECK-NEXT:    [[TMP3:%.*]] = zext i1 [[CALL24]] to i64
 // CHECK-NEXT:    [[TMP4:%.*]] = load ptr, ptr [[P_ADDR]], align 8
-// CHECK-NEXT:    call void @_ZdlPv(ptr noundef [[TMP4]]) #[[ATTR8:[0-9]+]]
+// CHECK-NEXT:    call void @_ZdlPv(ptr allocptr noundef [[TMP4]]) 
#[[ATTR8:[0-9]+]]
 // CHECK-NEXT:    ret void
 //
 void f(int* p, ...)
diff --git a/clang/test/CodeGenCXX/builtin-operator-new-delete.cpp 
b/clang/test/CodeGenCXX/builtin-operator-new-delete.cpp
index 2138e1f724972c..a44926e43b5e22 100644
--- a/clang/test/CodeGenCXX/builtin-operator-new-delete.cpp
+++ b/clang/test/CodeGenCXX/builtin-operator-new-delete.cpp
@@ -43,7 +43,7 @@ extern "C" void test_basic() {
   __builtin_operator_delete(__builtin_operator_new(4));
 }
 // CHECK: declare noundef nonnull ptr @_Znwm(i64 noundef) [[ATTR_NOBUILTIN:#[^ 
]*]]
-// CHECK: declare void @_ZdlPv(ptr noundef) [[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
+// CHECK: declare void @_ZdlPv(ptr allocptr noundef) 
[[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
 
 // CHECK-LABEL: define{{.*}} void @test_aligned_alloc(
 extern "C" void test_aligned_alloc() {
@@ -52,7 +52,7 @@ extern "C" void test_aligned_alloc() {
   __builtin_operator_delete(__builtin_operator_new(4, std::align_val_t(4)), 
std::align_val_t(4));
 }
 // CHECK: declare noundef nonnull ptr @_ZnwmSt11align_val_t(i64 noundef, i64 
noundef) [[ATTR_NOBUILTIN:#[^ ]*]]
-// CHECK: declare void @_ZdlPvSt11align_val_t(ptr noundef, i64 noundef) 
[[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
+// CHECK: declare void @_ZdlPvSt11align_val_t(ptr allocptr noundef, i64 
noundef) [[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
 
 // CHECK-LABEL: define{{.*}} void @test_sized_delete(
 extern "C" void test_sized_delete() {
@@ -60,7 +60,7 @@ extern "C" void test_sized_delete() {
   // CHECK: call void @_ZdlPvm({{.*}}, i64 noundef 4) 
[[ATTR_BUILTIN_DELETE:#[^ ]*]]
   __builtin_operator_delete(__builtin_operator_new(4), 4);
 }
-// CHECK: declare void @_ZdlPvm(ptr noundef, i64 noundef) 
[[ATTR_NOBUILTIN_UNWIND:#[^ ]*]]
+// CHECK: declare void @_ZdlPvm(ptr allocptr noundef, i64 noundef) 
[[ATTR_NOBUILTIN_UNWIND:#[^ ]*]]
 
 
 // CHECK-DAG: attributes [[ATTR_NOBUILTIN]] = {{[{].*}} nobuiltin {{.*[}]}}
diff --git a/clang/test/CodeGenCXX/cxx1y-sized-deallocation.cpp 
b/clang/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
index 55913aff9c19b9..8bbbaa3a2b7199 100644
--- a/clang/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
+++ b/clang/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
@@ -50,59 +50,59 @@ template void del<F>();
 D::D() {}
 
 // CHECK-LABEL: define weak_odr void @_Z3delIiEvv()
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 4)
-// CHECK: call void @_ZdaPv(ptr noundef %{{[^ ]*}})
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 4)
+// CHECK: call void @_ZdaPv(ptr allocptr noundef %{{[^ ]*}})
 //
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 4)
-// CHECK: call void @_ZdaPv(ptr noundef %{{[^ ]*}})
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 4)
+// CHECK: call void @_ZdaPv(ptr allocptr noundef %{{[^ ]*}})
 
 // CHECK-LABEL: declare void @_ZdlPvm(ptr
 
 // CHECK-LABEL: define weak_odr void @_Z3delI1BEvv()
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 4)
-// CHECK: call void @_ZdaPv(ptr noundef %{{[^ ]*}})
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 4)
+// CHECK: call void @_ZdaPv(ptr allocptr noundef %{{[^ ]*}})
 //
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 4)
-// CHECK: call void @_ZdaPv(ptr noundef %{{[^ ]*}})
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 4)
+// CHECK: call void @_ZdaPv(ptr allocptr noundef %{{[^ ]*}})
 
 // CHECK-LABEL: define weak_odr void @_Z3delI1CEvv()
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 1)
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 1)
 // CHECK: mul i64 1, %{{[^ ]*}}
 // CHECK: add i64 %{{[^ ]*}}, 8
-// CHECK: call void @_ZdaPvm(ptr noundef %{{[^ ]*}}, i64 noundef %{{[^ ]*}})
+// CHECK: call void @_ZdaPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 
%{{[^ ]*}})
 //
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 1)
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 1)
 // CHECK: mul i64 1, %{{[^ ]*}}
 // CHECK: add i64 %{{[^ ]*}}, 8
-// CHECK: call void @_ZdaPvm(ptr noundef %{{[^ ]*}}, i64 noundef %{{[^ ]*}})
+// CHECK: call void @_ZdaPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 
%{{[^ ]*}})
 
 // CHECK-LABEL: declare void @_ZdaPvm(ptr
 
 // CHECK-LABEL: define weak_odr void @_Z3delI1DEvv()
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 8)
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 8)
 // CHECK: mul i64 8, %{{[^ ]*}}
 // CHECK: add i64 %{{[^ ]*}}, 8
-// CHECK: call void @_ZdaPvm(ptr noundef %{{[^ ]*}}, i64 noundef %{{[^ ]*}})
+// CHECK: call void @_ZdaPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 
%{{[^ ]*}})
 //
 // CHECK-NOT: Zdl
 // CHECK: call void %{{.*}}
 // CHECK-NOT: Zdl
 // CHECK: mul i64 8, %{{[^ ]*}}
 // CHECK: add i64 %{{[^ ]*}}, 8
-// CHECK: call void @_ZdaPvm(ptr noundef %{{[^ ]*}}, i64 noundef %{{[^ ]*}})
+// CHECK: call void @_ZdaPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 
%{{[^ ]*}})
 
 // CHECK-LABEL: define weak_odr void @_Z3delI1EEvv()
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 1)
-// CHECK: call void @_ZdaPv(ptr noundef %{{[^ ]*}})
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 1)
+// CHECK: call void @_ZdaPv(ptr allocptr noundef %{{[^ ]*}})
 //
 // CHECK: call void @_ZN1EdlEPv(ptr noundef %{{[^ ]*}})
 // CHECK: call void @_ZN1EdaEPv(ptr noundef %{{[^ ]*}})
 
 // CHECK-LABEL: define weak_odr void @_Z3delI1FEvv()
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 1)
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 1)
 // CHECK: mul i64 1, %{{[^ ]*}}
 // CHECK: add i64 %{{[^ ]*}}, 8
-// CHECK: call void @_ZdaPvm(ptr noundef %{{[^ ]*}}, i64 noundef %{{[^ ]*}})
+// CHECK: call void @_ZdaPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 
%{{[^ ]*}})
 //
 // CHECK: call void @_ZN1FdlEPvm(ptr noundef %{{[^ ]*}}, i64 noundef 1)
 // CHECK: mul i64 1, %{{[^ ]*}}
@@ -111,4 +111,4 @@ D::D() {}
 
 
 // CHECK-LABEL: define linkonce_odr void @_ZN1DD0Ev(ptr {{[^,]*}} %this)
-// CHECK: call void @_ZdlPvm(ptr noundef %{{[^ ]*}}, i64 noundef 8)
+// CHECK: call void @_ZdlPvm(ptr allocptr noundef %{{[^ ]*}}, i64 noundef 8)
diff --git a/clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp 
b/clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp
index 8823bc64a4368b..03f4920c4baebc 100644
--- a/clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp
+++ b/clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp
@@ -28,11 +28,11 @@ struct OVERALIGNED A { A(); int n[128]; };
 
 // CHECK-LABEL: define {{.*}} @_Z2a0v()
 // CHECK: %[[ALLOC:.*]] = call noalias noundef nonnull align 32 ptr 
@_ZnwmSt11align_val_t(i64 noundef 512, i64 noundef 32)
-// CHECK: call void @_ZdlPvSt11align_val_t(ptr noundef %[[ALLOC]], i64 noundef 
32)
+// CHECK: call void @_ZdlPvSt11align_val_t(ptr allocptr noundef %[[ALLOC]], 
i64 noundef 32)
 // CHECK-MS-LABEL: define {{.*}} @"?a0@@YAPEAXXZ"()
 // CHECK-MS: %[[ALLOC:.*]] = call noalias noundef nonnull align 32 ptr 
@"??2@YAPEAX_KW4align_val_t@std@@@Z"(i64 noundef 512, i64 noundef 32)
 // CHECK-MS: cleanuppad
-// CHECK-MS: call void @"??3@YAXPEAXW4align_val_t@std@@@Z"(ptr noundef 
%[[ALLOC]], i64 noundef 32)
+// CHECK-MS: call void @"??3@YAXPEAXW4align_val_t@std@@@Z"(ptr allocptr 
noundef %[[ALLOC]], i64 noundef 32)
 void *a0() { return new A; }
 
 // FIXME: Why don't we call the sized array deallocation overload in this case?
@@ -43,22 +43,22 @@ void *a0() { return new A; }
 // No array cookie.
 // CHECK-NOT: store
 // CHECK: invoke void @_ZN1AC1Ev(
-// CHECK: call void @_ZdaPvSt11align_val_t(ptr noundef %[[ALLOC]], i64 noundef 
32)
+// CHECK: call void @_ZdaPvSt11align_val_t(ptr allocptr noundef %[[ALLOC]], 
i64 noundef 32)
 // CHECK-MS-LABEL: define {{.*}} @"?a1@@YAPEAXJ@Z"(
 // CHECK-MS: %[[ALLOC:.*]] = call noalias noundef nonnull align 32 ptr 
@"??_U@YAPEAX_KW4align_val_t@std@@@Z"(i64 noundef %{{.*}}, i64 noundef 32)
 // No array cookie.
 // CHECK-MS-NOT: store
 // CHECK-MS: invoke noundef ptr @"??0A@@QEAA@XZ"(
 // CHECK-MS: cleanuppad
-// CHECK-MS: call void @"??_V@YAXPEAXW4align_val_t@std@@@Z"(ptr noundef 
%[[ALLOC]], i64 noundef 32)
+// CHECK-MS: call void @"??_V@YAXPEAXW4align_val_t@std@@@Z"(ptr allocptr 
noundef %[[ALLOC]], i64 noundef 32)
 void *a1(long n) { return new A[n]; }
 
 // CHECK-LABEL: define {{.*}} @_Z2a2P1A(
-// CHECK: call void @_ZdlPvmSt11align_val_t(ptr noundef %{{.*}}, i64 noundef 
512, i64 noundef 32) #9
+// CHECK: call void @_ZdlPvmSt11align_val_t(ptr allocptr noundef %{{.*}}, i64 
noundef 512, i64 noundef 32) #9
 void a2(A *p) { delete p; }
 
 // CHECK-LABEL: define {{.*}} @_Z2a3P1A(
-// CHECK: call void @_ZdaPvSt11align_val_t(ptr noundef %{{.*}}, i64 noundef 
32) #9
+// CHECK: call void @_ZdaPvSt11align_val_t(ptr allocptr noundef %{{.*}}, i64 
noundef 32) #9
 void a3(A *p) { delete[] p; }
 
 
@@ -170,7 +170,7 @@ void *d0() { return new (q) D; }
 #ifndef UNALIGNED
 // CHECK-LABEL: define {{.*}} @_Z2e0v(
 // CHECK: %[[ALLOC:.*]] = call noalias noundef nonnull align 4 ptr 
@_ZnwmSt11align_val_t(i64 noundef 512, i64 noundef 4)
-// CHECK: call void @_ZdlPvSt11align_val_t(ptr noundef %[[ALLOC]], i64 noundef 
4)
+// CHECK: call void @_ZdlPvSt11align_val_t(ptr allocptr noundef %[[ALLOC]], 
i64 noundef 4)
 void *e0() { return new (std::align_val_t(4)) A; }
 
 // CHECK-LABEL: define {{.*}} @_Z2e1v(
diff --git a/clang/test/CodeGenCXX/cxx2a-destroying-delete.cpp 
b/clang/test/CodeGenCXX/cxx2a-destroying-delete.cpp
index 97ed0c57e8f68b..db61ad8ba0f808 100644
--- a/clang/test/CodeGenCXX/cxx2a-destroying-delete.cpp
+++ b/clang/test/CodeGenCXX/cxx2a-destroying-delete.cpp
@@ -42,11 +42,11 @@ void glob_delete_A(A *a) { ::delete a; }
 // CHECK: br i1
 
 // CHECK-ITANIUM: call void @_ZN1AD1Ev(ptr noundef nonnull align 8 
dead_on_return(8) dereferenceable(8) %[[a]])
-// CHECK-ITANIUM-NEXT: call void @_ZdlPvm(ptr noundef %[[a]], i64 noundef 8)
+// CHECK-ITANIUM-NEXT: call void @_ZdlPvm(ptr allocptr noundef %[[a]], i64 
noundef 8)
 // CHECK-MSABI64: call void @"??1A@@QEAA@XZ"(ptr noundef nonnull align 8 
dead_on_return(8) dereferenceable(8) %[[a]])
-// CHECK-MSABI64-NEXT: call void @"??3@YAXPEAX_K@Z"(ptr noundef %[[a]], i64 
noundef 8)
+// CHECK-MSABI64-NEXT: call void @"??3@YAXPEAX_K@Z"(ptr allocptr noundef 
%[[a]], i64 noundef 8)
 // CHECK-MSABI32: call x86_thiscallcc void @"??1A@@QAE@XZ"(ptr noundef nonnull 
align 4 dead_on_return(4) dereferenceable(4) %[[a]])
-// CHECK-MSABI32-NEXT: call void @"??3@YAXPAXI@Z"(ptr noundef %[[a]], i32 
noundef 4)
+// CHECK-MSABI32-NEXT: call void @"??3@YAXPAXI@Z"(ptr allocptr noundef %[[a]], 
i32 noundef 4)
 
 struct B {
   virtual ~B();
@@ -229,8 +229,8 @@ H::~H() { call_in_dtor(); }
 // CLANG22-MSABI-NEXT: br i1 %[[CHCK2]], label %dtor.call_class_delete, label 
%dtor.call_glob_delete
 //
 // CLANG22-MSABI-LABEL: dtor.call_glob_delete:
-// CLANG22-MSABI64: call void @"?__global_delete@@YAXPEAX_K@Z"(ptr noundef 
%{{.*}}, i64 noundef 48)
-// CLANG22-MSABI32: call void 
@"?__global_delete@@YAXPAXIW4align_val_t@std@@@Z"(ptr noundef %{{.*}}, i32 
noundef 32, i32 noundef 16)
+// CLANG22-MSABI64: call void @"?__global_delete@@YAXPEAX_K@Z"(ptr allocptr 
noundef %{{.*}}, i64 noundef 48)
+// CLANG22-MSABI32: call void 
@"?__global_delete@@YAXPAXIW4align_val_t@std@@@Z"(ptr allocptr noundef %{{.*}}, 
i32 noundef 32, i32 noundef 16)
 // CLANG22-MSABI-NEXT: br label %[[RETURN:.*]]
 //
 // CLANG21-MSABI: dtor.call_delete:
@@ -284,8 +284,8 @@ I::~I() { call_in_dtor(); }
 // CLANG22-MSABI-NEXT: br i1 %[[CHCK2]], label %dtor.call_class_delete, label 
%dtor.call_glob_delete
 //
 // CLANG22-MSABI: dtor.call_glob_delete:
-// CLANG22-MSABI64: call void 
@"?__global_delete@@YAXPEAX_KW4align_val_t@std@@@Z"(ptr noundef %{{.*}}, i64 
noundef 96, i64 noundef 32)
-// CLANG22-MSABI32: call void 
@"?__global_delete@@YAXPAXIW4align_val_t@std@@@Z"(ptr noundef %{{.*}}, i32 
noundef 64, i32 noundef 32)
+// CLANG22-MSABI64: call void 
@"?__global_delete@@YAXPEAX_KW4align_val_t@std@@@Z"(ptr allocptr noundef 
%{{.*}}, i64 noundef 96, i64 noundef 32)
+// CLANG22-MSABI32: call void 
@"?__global_delete@@YAXPAXIW4align_val_t@std@@@Z"(ptr allocptr noundef %{{.*}}, 
i32 noundef 64, i32 noundef 32)
 // CLANG22-MSABI-NEXT: br label %[[RETURN:.*]]
 //
 // CLANG21-MSABI: dtor.call_delete:
diff --git a/clang/test/CodeGenCXX/delete-two-arg.cpp 
b/clang/test/CodeGenCXX/delete-two-arg.cpp
index a0dcd03bc5a92d..f3145485ea279b 100644
--- a/clang/test/CodeGenCXX/delete-two-arg.cpp
+++ b/clang/test/CodeGenCXX/delete-two-arg.cpp
@@ -45,7 +45,7 @@ namespace test2 {
     // CHECK-NEXT: [[T5:%.*]] = load i32, ptr [[T3]]
     // CHECK-NEXT: [[T6:%.*]] = mul i32 4, [[T5]]
     // CHECK-NEXT: [[T7:%.*]] = add i32 [[T6]], 4
-    // CHECK-NEXT: call void @_ZdaPvj(ptr noundef [[T3]], i32 noundef [[T7]])
+    // CHECK-NEXT: call void @_ZdaPvj(ptr allocptr noundef [[T3]], i32 noundef 
[[T7]])
     // CHECK-NEXT: br label
     ::delete[] p;
   }
diff --git a/clang/test/CodeGenCXX/delete.cpp b/clang/test/CodeGenCXX/delete.cpp
index 21b9f8c2fcc2c9..f6d23557c374bc 100644
--- a/clang/test/CodeGenCXX/delete.cpp
+++ b/clang/test/CodeGenCXX/delete.cpp
@@ -94,7 +94,7 @@ namespace test1 {
     // CHECK-NEXT: br i1 [[ISDONE]]
     // CHECK:      [[MUL:%.*]] = mul i64 4, [[COUNT]]
     // CHECK-NEXT: [[SIZE:%.*]] = add i64 [[MUL]], 8
-    // CHECK-NEXT: call void @_ZdaPvm(ptr noundef [[ALLOC]], i64 noundef 
[[SIZE]])
+    // CHECK-NEXT: call void @_ZdaPvm(ptr allocptr noundef [[ALLOC]], i64 
noundef [[SIZE]])
   }
 
   // CHECK-LABEL: define{{.*}} void @_ZN5test11gEPA_NS_1AE(
@@ -113,7 +113,7 @@ namespace test1 {
     // CHECK-NEXT: call void @_ZN5test11AD1Ev(ptr {{[^,]*}} [[CUR]])
     // CHECK-NEXT: [[ISDONE:%.*]] = icmp eq ptr [[CUR]], [[PTR]]
     // CHECK-NEXT: br i1 [[ISDONE]]
-    // CHECK:      call void @_ZdaPv(ptr noundef [[ALLOC]])
+    // CHECK:      call void @_ZdaPv(ptr allocptr noundef [[ALLOC]])
   }
 }
 
@@ -157,7 +157,7 @@ namespace test4 {
     // CHECK-NEXT: [[DTOR:%.*]] = load ptr, ptr [[T0]]
     // CHECK-NEXT: call void [[DTOR]](ptr {{[^,]*}} [[OBJ:%.*]])
     //   Call the global operator delete.
-    // CHECK-NEXT: call void @_ZdlPvm(ptr noundef [[ALLOCATED]], i64 noundef 
8) [[NUW:#[0-9]+]]
+    // CHECK-NEXT: call void @_ZdlPvm(ptr allocptr noundef [[ALLOCATED]], i64 
noundef 8) [[NUW:#[0-9]+]]
     ::delete xp;
   }
 }
diff --git a/clang/test/CodeGenCXX/dllimport.cpp 
b/clang/test/CodeGenCXX/dllimport.cpp
index ed1c72c5185d3c..e63c29b0045f1b 100644
--- a/clang/test/CodeGenCXX/dllimport.cpp
+++ b/clang/test/CodeGenCXX/dllimport.cpp
@@ -208,7 +208,7 @@ USEVAR(VarTmpl<ExplicitSpec_Imported>)
 // Functions
 
//===----------------------------------------------------------------------===//
 
-// GNU-DAG: declare dso_local void @_ZdlPv{{[jym]}}(ptr, i{{32|64}})
+// GNU-DAG: declare dso_local void @_ZdlPv{{[jym]}}(ptr allocptr, i{{32|64}})
 
 // Import function declaration.
 // MSC-DAG: declare dllimport void @"?decl@@YAXXZ"()
diff --git a/clang/test/CodeGenCXX/exceptions.cpp 
b/clang/test/CodeGenCXX/exceptions.cpp
index 8fbb056e746540..ca88e91157c263 100644
--- a/clang/test/CodeGenCXX/exceptions.cpp
+++ b/clang/test/CodeGenCXX/exceptions.cpp
@@ -37,7 +37,7 @@ namespace test1 {
     // CHECK:      [[NEW:%.*]] = call noalias nonnull ptr @_Znwm(i64 8)
     // CHECK-NEXT: invoke void @_ZN5test11AC1Ei(ptr {{[^,]*}} [[NEW]], i32 5)
     // CHECK:      ret ptr [[NEW]]
-    // CHECK:      call void @_ZdlPv(ptr [[NEW]])
+    // CHECK:      call void @_ZdlPv(ptr allocptr [[NEW]])
     return new A(5);
   }
 
@@ -47,7 +47,7 @@ namespace test1 {
     // CHECK-NEXT: [[FOO:%.*]] = invoke i32 @_ZN5test13fooEv()
     // CHECK:      invoke void @_ZN5test11AC1Ei(ptr {{[^,]*}} [[NEW]], i32 
[[FOO]])
     // CHECK:      ret ptr [[NEW]]
-    // CHECK:      call void @_ZdlPv(ptr [[NEW]])
+    // CHECK:      call void @_ZdlPv(ptr allocptr [[NEW]])
     extern int foo();
     return new A(foo());
   }
@@ -72,7 +72,7 @@ namespace test1 {
     // CHECK:      ret ptr [[NEW]]
     // CHECK:      [[ISACTIVE:%.*]] = load i1, ptr [[ACTIVE]]
     // CHECK-NEXT: br i1 [[ISACTIVE]]
-    // CHECK:      call void @_ZdlPv(ptr [[NEW]])
+    // CHECK:      call void @_ZdlPv(ptr allocptr [[NEW]])
     return new A(B().x);
   }
 
@@ -98,7 +98,7 @@ namespace test1 {
     // CHECK:      ret ptr [[NEW]]
     // CHECK:      [[ISACTIVE:%.*]] = load i1, ptr [[ACTIVE]]
     // CHECK-NEXT: br i1 [[ISACTIVE]]
-    // CHECK:      call void @_ZdlPv(ptr [[NEW]])
+    // CHECK:      call void @_ZdlPv(ptr allocptr [[NEW]])
     return new A(B());
   }
 
@@ -123,7 +123,7 @@ namespace test1 {
     // CHECK:      ret ptr [[NEW]]
     // CHECK:      [[ISACTIVE:%.*]] = load i1, ptr [[ACTIVE]]
     // CHECK-NEXT: br i1 [[ISACTIVE]]
-    // CHECK:      call void @_ZdlPv(ptr [[NEW]])
+    // CHECK:      call void @_ZdlPv(ptr allocptr [[NEW]])
     return new A(B(), B());
   }
   A *f() {
@@ -159,7 +159,7 @@ namespace test1 {
     // CHECK:      ret ptr [[RET]]
     // CHECK:      [[ISACTIVE:%.*]] = load i1, ptr [[ACTIVE]]
     // CHECK-NEXT: br i1 [[ISACTIVE]]
-    // CHECK:      call void @_ZdlPv(ptr [[NEW]])
+    // CHECK:      call void @_ZdlPv(ptr allocptr [[NEW]])
     A *x;
     return (x = new A(makeB()), makeB(), x);
   }
@@ -444,7 +444,7 @@ namespace test9 {
   }
   // CHECK: define{{.*}} ptr @_ZN5test94testEv
   // CHECK: [[TEST9_NEW:%.*]] = call noalias nonnull ptr @_Znam
-  // CHECK: call void @_ZdaPv(ptr [[TEST9_NEW]])
+  // CHECK: call void @_ZdaPv(ptr allocptr [[TEST9_NEW]])
 }
 
 // In a destructor with a function-try-block, a return statement in a
diff --git a/clang/test/CodeGenCXX/microsoft-abi-structors.cpp 
b/clang/test/CodeGenCXX/microsoft-abi-structors.cpp
index 1a4a291e28c0a2..e0cc9f082fcc80 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-structors.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-structors.cpp
@@ -58,7 +58,7 @@ struct C {
 // DTORS-NEXT:   br i1 %[[CONDITION]], label %[[CONTINUE_LABEL:[0-9a-z._]+]], 
label %[[CALL_DELETE_LABEL:[0-9a-z._]+]]
 //
 // DTORS:      [[CALL_DELETE_LABEL]]
-// DTORS-NEXT:   call void @"??3@YAXPAX@Z"(ptr %[[THIS]])
+// DTORS-NEXT:   call void @"??3@YAXPAX@Z"(ptr allocptr %[[THIS]])
 // DTORS-NEXT:   br label %[[CONTINUE_LABEL]]
 //
 // DTORS:      [[CONTINUE_LABEL]]
@@ -117,7 +117,7 @@ void call_deleting_dtor_and_global_delete(C *obj_ptr) {
 // CHECK-NEXT:   %[[VDTOR:.*]] = load ptr, ptr %[[PVDTOR]]
 // CLANG22-NEXT:   %[[CALL:.*]] = call x86_thiscallcc ptr %[[VDTOR]](ptr 
{{[^,]*}} %[[OBJ_PTR_VALUE]], i32 5)
 // CLANG21-NEXT:   %[[CALL:.*]] = call x86_thiscallcc ptr %[[VDTOR]](ptr 
{{[^,]*}} %[[OBJ_PTR_VALUE]], i32 0)
-// CLANG21-NEXT: call void @"??3@YAXPAX@Z"(ptr %[[CALL]])
+// CLANG21-NEXT: call void @"??3@YAXPAX@Z"(ptr allocptr %[[CALL]])
 // CHECK:      ret void
 }
 
@@ -487,7 +487,7 @@ void checkH() {
 // DTORS-NEXT:   br i1 %[[CONDITION1]], label 
%[[CALL_CLASS_DELETE:[0-9a-z._]+]], label %[[CALL_GLOB_DELETE:[0-9a-z._]+]]
 //
 // DTORS:      [[CALL_GLOB_DELETE]]
-// DTORS-NEXT:   call void @"?__global_delete@@YAXPAX@Z"(ptr %[[THIS]])
+// DTORS-NEXT:   call void @"?__global_delete@@YAXPAX@Z"(ptr allocptr 
%[[THIS]])
 // DTORS-NEXT:   br label %[[CONTINUE_LABEL]]
 //
 // DTORS:      [[CALL_CLASS_DELETE]]
diff --git a/clang/test/CodeGenCXX/microsoft-vector-deleting-dtors.cpp 
b/clang/test/CodeGenCXX/microsoft-vector-deleting-dtors.cpp
index ba1760b49f2c90..314486d18bbfc3 100644
--- a/clang/test/CodeGenCXX/microsoft-vector-deleting-dtors.cpp
+++ b/clang/test/CodeGenCXX/microsoft-vector-deleting-dtors.cpp
@@ -123,8 +123,8 @@ void kernelTest() {
 // X86-NEXT:   %[[HOWMANYBYTES:.*]] = mul i32 4, %[[HOWMANY]]
 // X64-NEXT:   %[[ADDCOOKIESIZE:.*]] = add i64 %[[HOWMANYBYTES]], 8
 // X86-NEXT:   %[[ADDCOOKIESIZE:.*]] = add i32 %[[HOWMANYBYTES]], 4
-// X64-NEXT:   call void @"??_V@YAXPEAX_K@Z"(ptr noundef %[[COOKIEGEP]], i64 
noundef %[[ADDCOOKIESIZE]])
-// X86-NEXT:   call void @"??_V@YAXPAXI@Z"(ptr noundef %[[COOKIEGEP]], i32 
noundef %[[ADDCOOKIESIZE]])
+// X64-NEXT:   call void @"??_V@YAXPEAX_K@Z"(ptr allocptr noundef 
%[[COOKIEGEP]], i64 noundef %[[ADDCOOKIESIZE]])
+// X86-NEXT:   call void @"??_V@YAXPAXI@Z"(ptr allocptr noundef 
%[[COOKIEGEP]], i32 noundef %[[ADDCOOKIESIZE]])
 // CHECK-NEXT:   br label %delete.end
 // CHECK: vdtor.call:
 // CHECK-NEXT:   %[[VTABLE:.*]] = load ptr, ptr %[[LPTR]]
@@ -158,7 +158,7 @@ void kernelTest() {
 // CLANG21: arraydestroy.done1:
 // CLANG21-NEXT:   %3 = mul i64 8, %2
 // CLANG21-NEXT:   %4 = add i64 %3, 8
-// CLANG21-NEXT:   call void @"??_V@YAXPEAX_K@Z"(ptr noundef %1, i64 noundef 
%4)
+// CLANG21-NEXT:   call void @"??_V@YAXPEAX_K@Z"(ptr allocptr noundef %1, i64 
noundef %4)
 // CLANG21-NEXT:   br label %delete.end2
 
 // Definition of S::foo, check that it has vector deleting destructor call
@@ -183,8 +183,8 @@ void kernelTest() {
 // X86-NEXT:   %[[HOWMANYBYTES:.*]] = mul i32 4, %[[HOWMANY]]
 // X64-NEXT:   %[[ADDCOOKIESIZE:.*]] = add i64 %[[HOWMANYBYTES]], 8
 // X86-NEXT:   %[[ADDCOOKIESIZE:.*]] = add i32 %[[HOWMANYBYTES]], 4
-// X64-NEXT:   call void @"??_V@YAXPEAX_K@Z"(ptr noundef %[[COOKIEGEP]], i64 
noundef %[[ADDCOOKIESIZE]])
-// X86-NEXT:   call void @"??_V@YAXPAXI@Z"(ptr noundef %[[COOKIEGEP]], i32 
noundef %[[ADDCOOKIESIZE]])
+// X64-NEXT:   call void @"??_V@YAXPEAX_K@Z"(ptr allocptr noundef 
%[[COOKIEGEP]], i64 noundef %[[ADDCOOKIESIZE]])
+// X86-NEXT:   call void @"??_V@YAXPAXI@Z"(ptr allocptr noundef 
%[[COOKIEGEP]], i32 noundef %[[ADDCOOKIESIZE]])
 // CHECK-NEXT:   br label %delete.end
 // CHECK: vdtor.call:                                       ; preds = 
%delete.notnull
 // CHECK-NEXT:   %[[VTABLE:.*]] = load ptr, ptr %[[DEL_PTR]]
@@ -200,7 +200,7 @@ void kernelTest() {
 // which here lands before the deleting-destructor helpers. Verify it traps
 // (the fallback path is unreachable at runtime once a real forwarding body is
 // linked in).
-// X64: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// X64: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // X64-NEXT: call void @llvm.trap()
 // X64-NEXT: unreachable
 
@@ -248,8 +248,8 @@ void kernelTest() {
 // X86-NEXT:  %[[ARRSZ:.*]] = mul i32 4, %[[HOWMANY]]
 // X64-NEXT:  %[[TOTALSZ:.*]] = add i64 %[[ARRSZ]], 8
 // X86-NEXT:  %[[TOTALSZ:.*]] = add i32 %[[ARRSZ]], 4
-// X64-NEXT:  call void @"??_V@YAXPEAX_K@Z"(ptr noundef %[[COOKIEGEP]], i64 
noundef %[[TOTALSZ]])
-// X86-NEXT:  call void @"??_V@YAXPAXI@Z"(ptr noundef %[[COOKIEGEP]], i32 
noundef %[[TOTALSZ]])
+// X64-NEXT:  call void @"??_V@YAXPEAX_K@Z"(ptr allocptr noundef 
%[[COOKIEGEP]], i64 noundef %[[TOTALSZ]])
+// X86-NEXT:  call void @"??_V@YAXPAXI@Z"(ptr allocptr noundef %[[COOKIEGEP]], 
i32 noundef %[[TOTALSZ]])
 // CHECK-NEXT:  br label %dtor.continue
 // CHECK: dtor.scalar:
 // X64-NEXT:   call void @"??1Parrot@@UEAA@XZ"(ptr noundef nonnull align 8 
dead_on_return(8) dereferenceable(8) %[[LTHIS]])
@@ -258,8 +258,8 @@ void kernelTest() {
 // CHECK-NEXT:   %[[ISFIRSTBITZERO:.*]] = icmp eq i32 %[[FIRSTBIT]], 0
 // CHECK-NEXT:   br i1 %[[ISFIRSTBITZERO]], label %dtor.continue, label 
%dtor.call_delete
 // CHECK: dtor.call_delete:
-// X64-NEXT:     call void @"??3@YAXPEAX_K@Z"(ptr noundef %[[LTHIS]], i64 
noundef 8)
-// X86-NEXT:     call void @"??3@YAXPAXI@Z"(ptr noundef %[[LTHIS]], i32 
noundef 4)
+// X64-NEXT:     call void @"??3@YAXPEAX_K@Z"(ptr allocptr noundef %[[LTHIS]], 
i64 noundef 8)
+// X86-NEXT:     call void @"??3@YAXPAXI@Z"(ptr allocptr noundef %[[LTHIS]], 
i32 noundef 4)
 // CHECK-NEXT:   br label %dtor.continue
 // CHECK: dtor.continue:
 // CHECK-NEXT:   %[[LOADRET:.*]] = load ptr, ptr %[[RET]]
@@ -287,8 +287,8 @@ void kernelTest() {
 // X86-NEXT: %[[ARRSZ:.*]] = mul i32 4, %[[COOKIE:.*]]
 // X64-NEXT: %[[TOTALSZ:.*]] = add i64 %[[ARRSZ]], 8
 // X86-NEXT: %[[TOTALSZ:.*]] = add i32 %[[ARRSZ]], 4
-// X64-NEXT: call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr noundef %2, 
i64 noundef %[[TOTALSZ]])
-// X86-NEXT: call void @"?__global_array_delete@@YAXPAXI@Z"(ptr noundef %2, 
i32 noundef %[[TOTALSZ]])
+// X64-NEXT: call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr allocptr 
noundef %2, i64 noundef %[[TOTALSZ]])
+// X86-NEXT: call void @"?__global_array_delete@@YAXPAXI@Z"(ptr allocptr 
noundef %2, i32 noundef %[[TOTALSZ]])
 // CHECK-NEXT:   br label %dtor.continue
 
 // Test that when a class provides its own operator delete, the deleting
@@ -299,14 +299,14 @@ void kernelTest() {
 // X64-LABEL: define weak dso_local noundef ptr 
@"??_EKernelDerived@@UEAAPEAXI@Z"
 // Verify the array delete path in the VDD uses __global_array_delete.
 // X64: dtor.call_glob_delete_after_array_destroy:
-// X64: call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr noundef %{{.*}}, 
i64 noundef %{{.*}})
+// X64: call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr allocptr noundef 
%{{.*}}, i64 noundef %{{.*}})
 // Verify the scalar deleting dtor uses __global_delete, not ::operator delete.
 // X64: dtor.call_delete:
 // X64-NEXT:  %[[FLAGCHECK:.*]] = and i32 %should_call_delete2, 4
 // X64-NEXT:  %[[ISGLOB:.*]] = icmp eq i32 %[[FLAGCHECK]], 0
 // X64-NEXT:  br i1 %[[ISGLOB]], label %dtor.call_class_delete, label 
%dtor.call_glob_delete
 // X64: dtor.call_glob_delete:
-// X64-NEXT:  call void @"?__global_delete@@YAXPEAX_K@Z"(ptr noundef %{{.*}}, 
i64 noundef 8)
+// X64-NEXT:  call void @"?__global_delete@@YAXPEAX_K@Z"(ptr allocptr noundef 
%{{.*}}, i64 noundef 8)
 // X64: dtor.call_class_delete:
 // X64-NEXT:  call void @"??3KernelBase@@SAXPEAX@Z"(ptr noundef %{{.*}})
 
@@ -371,8 +371,8 @@ void foobartest() {
 // X86-NEXT: %[[ARRSZ:.*]] = mul i32 8, %[[COOKIE:.*]]
 // X64-NEXT: %[[TOTALSZ:.*]] = add i64 %[[ARRSZ]], 8
 // X86-NEXT: %[[TOTALSZ:.*]] = add i32 %[[ARRSZ]], 4
-// X64-NEXT:  call void @"??_V@YAXPEAX_K@Z"(ptr noundef %2, i64 noundef 
%[[TOTALSZ]])
-// X86-NEXT:  call void @"??_V@YAXPAXI@Z"(ptr noundef %2, i32 noundef 
%[[TOTALSZ]])
+// X64-NEXT:  call void @"??_V@YAXPEAX_K@Z"(ptr allocptr noundef %2, i64 
noundef %[[TOTALSZ]])
+// X86-NEXT:  call void @"??_V@YAXPAXI@Z"(ptr allocptr noundef %2, i32 noundef 
%[[TOTALSZ]])
 // CHECK-NEXT:  br label %dtor.continue
 // CHECK: dtor.scalar:
 // X64-NEXT:  call void @"??1Derived@@UEAA@XZ"(ptr noundef nonnull align 8 
dead_on_return(16) dereferenceable(16) %this1)
@@ -381,8 +381,8 @@ void foobartest() {
 // CHECK-NEXT:  %9 = icmp eq i32 %8, 0
 // CHECK-NEXT:  br i1 %9, label %dtor.continue, label %dtor.call_delete
 // CHECK: dtor.call_delete:
-// X64-NEXT:  call void @"??3@YAXPEAX_K@Z"(ptr noundef %this1, i64 noundef 16)
-// X86-NEXT:  call void @"??3@YAXPAXI@Z"(ptr noundef %this1, i32 noundef 8)
+// X64-NEXT:  call void @"??3@YAXPEAX_K@Z"(ptr allocptr noundef %this1, i64 
noundef 16)
+// X86-NEXT:  call void @"??3@YAXPAXI@Z"(ptr allocptr noundef %this1, i32 
noundef 8)
 // CHECK-NEXT:  br label %dtor.continue
 // CHECK: dtor.continue:
 // CHECK-NEXT:  %10 = load ptr, ptr %retval
@@ -397,9 +397,9 @@ void foobartest() {
 // is used in the TU, both wrappers get real forwarding bodies: the array
 // __global_array_delete forwards to ::operator delete[] (??_V@) and the scalar
 // __global_delete forwards to ::operator delete (??3@).
-// X64: define linkonce_odr void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// X64: define linkonce_odr void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // X64-NEXT: call void @"??_V@YAXPEAX_K@Z"(ptr %0, i64 %1)
-// X64: define linkonce_odr void @"?__global_delete@@YAXPEAX_K@Z"(ptr noundef 
%0, i64 noundef %1)
+// X64: define linkonce_odr void @"?__global_delete@@YAXPEAX_K@Z"(ptr allocptr 
noundef %0, i64 noundef %1)
 // X64-NEXT: call void @"??3@YAXPEAX_K@Z"(ptr %0, i64 %1)
 
 // CLANG21-NOT: __global_delete
diff --git a/clang/test/CodeGenCXX/microsoft-vector-deleting-dtors2.cpp 
b/clang/test/CodeGenCXX/microsoft-vector-deleting-dtors2.cpp
index fc6ce1763c86c3..206f00d98dc130 100644
--- a/clang/test/CodeGenCXX/microsoft-vector-deleting-dtors2.cpp
+++ b/clang/test/CodeGenCXX/microsoft-vector-deleting-dtors2.cpp
@@ -52,27 +52,27 @@ void TesttheTest() {
   Test *a = new Test[30];
 }
 
-// X64: define dso_local void @"??3@YAXPEAX_K@Z"(ptr noundef %0, i64 noundef 
%1)
-// X64: define dso_local void @"??_V@YAXPEAX_K@Z"(ptr noundef %0, i64 noundef 
%1)
+// X64: define dso_local void @"??3@YAXPEAX_K@Z"(ptr allocptr noundef %0, i64 
noundef %1)
+// X64: define dso_local void @"??_V@YAXPEAX_K@Z"(ptr allocptr noundef %0, i64 
noundef %1)
 // X64: define dso_local dllexport void @"??1DrawingBuffer@@UEAA@XZ"(ptr 
noundef nonnull align 8 dead_on_return(8) dereferenceable(8) %this)
 
 // X64: define weak dso_local noundef ptr @"??_EDrawingBuffer@@UEAAPEAXI@Z"
 // X64: call void @"??1DrawingBuffer@@UEAA@XZ"(ptr noundef nonnull align 8 
dead_on_return(8) dereferenceable(8) %arraydestroy.element)
 // X64: call void @"??_V?$RefCounted@UDrawingBuffer@@@@SAXPEAX@Z"(ptr noundef 
%2)
-// X64: call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr noundef %2, i64 
noundef %{{.*}})
+// X64: call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr allocptr noundef 
%2, i64 noundef %{{.*}})
 // X64: call void @"??1DrawingBuffer@@UEAA@XZ"(ptr noundef nonnull align 8 
dead_on_return(8) dereferenceable(8) %this1)
-// X64: call void @"??3@YAXPEAX_K@Z"(ptr noundef %this1, i64 noundef {{.*}})
+// X64: call void @"??3@YAXPEAX_K@Z"(ptr allocptr noundef %this1, i64 noundef 
{{.*}})
 
 
-// X86: define dso_local void @"??3@YAXPAXI@Z"(ptr noundef %0, i32 noundef %1)
-// X86: define dso_local void @"??_V@YAXPAXI@Z"(ptr noundef %0, i32 noundef %1)
+// X86: define dso_local void @"??3@YAXPAXI@Z"(ptr allocptr noundef %0, i32 
noundef %1)
+// X86: define dso_local void @"??_V@YAXPAXI@Z"(ptr allocptr noundef %0, i32 
noundef %1)
 
 // X86: define weak dso_local x86_thiscallcc noundef ptr 
@"??_EDrawingBuffer@@UAEPAXI@Z"
 // X86: call x86_thiscallcc void @"??1DrawingBuffer@@UAE@XZ"(ptr noundef 
nonnull align 4 dead_on_return(4) dereferenceable(4) %arraydestroy.element)
 // X86: call void @"??_V?$RefCounted@UDrawingBuffer@@@@SAXPAX@Z"(ptr noundef 
%2)
-// X86: call void @"?__global_array_delete@@YAXPAXI@Z"(ptr noundef %2, i32 
noundef {{.*}})
+// X86: call void @"?__global_array_delete@@YAXPAXI@Z"(ptr allocptr noundef 
%2, i32 noundef {{.*}})
 // X86  call x86_thiscallcc void @"??1DrawingBuffer@@UAE@XZ"(ptr noundef 
nonnull align 4 dereferenceable(4) %this1)
-// X86: call void @"??3@YAXPAXI@Z"(ptr noundef %this1, i32 noundef {{.*}})
+// X86: call void @"??3@YAXPAXI@Z"(ptr allocptr noundef %this1, i32 noundef 
{{.*}})
 
 
 // X64: define weak dso_local noundef ptr @"??_ETest@@UEAAPEAXI@Z"(ptr noundef 
nonnull align 8 dereferenceable(8) %this, i32 noundef %should_call_delete)
@@ -100,7 +100,7 @@ void TesttheTest() {
 // The wrapper forwarding bodies are emitted at end-of-module. Verify that the
 // dllexport class triggers __global_array_delete forwarding body emission even
 // without a ::delete expression in the TU.
-// X64: define linkonce_odr void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// X64: define linkonce_odr void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // X64-NEXT: call void @"??_V@YAXPEAX_K@Z"(ptr %0, i64 %1)
 // X64-NEXT: ret void
 
diff --git a/clang/test/CodeGenCXX/ms-vdtors-devirtualization.cpp 
b/clang/test/CodeGenCXX/ms-vdtors-devirtualization.cpp
index 1c0147e108febf..d1900a2df2c94a 100644
--- a/clang/test/CodeGenCXX/ms-vdtors-devirtualization.cpp
+++ b/clang/test/CodeGenCXX/ms-vdtors-devirtualization.cpp
@@ -48,8 +48,8 @@ void case1(A *arg) {
 // X86-NEXT:  %[[HOWMANYELEMS:.*]] = mul i32 4, %[[COOKIE]]
 // X64-NEXT:  %[[SIZEPLUSCOOKIE:.*]] = add i64 %[[HOWMANYELEMS]], 8
 // X86-NEXT:  %[[SIZEPLUSCOOKIE:.*]] = add i32 %[[HOWMANYELEMS]], 4
-// X64-NEXT:  call void @"??_V@YAXPEAX_K@Z"(ptr noundef %[[COOKIEADDR]], i64 
noundef %[[SIZEPLUSCOOKIE]])
-// X86-NEXT:  call void @"??_V@YAXPAXI@Z"(ptr noundef %[[COOKIEADDR]], i32 
noundef %[[SIZEPLUSCOOKIE]])
+// X64-NEXT:  call void @"??_V@YAXPEAX_K@Z"(ptr allocptr noundef 
%[[COOKIEADDR]], i64 noundef %[[SIZEPLUSCOOKIE]])
+// X86-NEXT:  call void @"??_V@YAXPAXI@Z"(ptr allocptr noundef 
%[[COOKIEADDR]], i32 noundef %[[SIZEPLUSCOOKIE]])
 // CHECK-NEXT:  br label %delete.end2
 
 void case2(B *arg) {
@@ -88,8 +88,8 @@ void case2(B *arg) {
 // X86-NEXT:  %[[HOWMANYELEMS:.*]] = mul i32 4, %[[COOKIE]]
 // X64-NEXT:  %[[SIZEPLUSCOOKIE:.*]] = add i64 %[[HOWMANYELEMS]], 8
 // X86-NEXT:  %[[SIZEPLUSCOOKIE:.*]] = add i32 %[[HOWMANYELEMS]], 4
-// X64-NEXT:  call void @"??_V@YAXPEAX_K@Z"(ptr noundef %[[COOKIEADDR]], i64 
noundef %[[SIZEPLUSCOOKIE]])
-// X86-NEXT:  call void @"??_V@YAXPAXI@Z"(ptr noundef %[[COOKIEADDR]], i32 
noundef %[[SIZEPLUSCOOKIE]])
+// X64-NEXT:  call void @"??_V@YAXPEAX_K@Z"(ptr allocptr noundef 
%[[COOKIEADDR]], i64 noundef %[[SIZEPLUSCOOKIE]])
+// X86-NEXT:  call void @"??_V@YAXPAXI@Z"(ptr allocptr noundef 
%[[COOKIEADDR]], i32 noundef %[[SIZEPLUSCOOKIE]])
 // CHECK-NEXT:  br label %delete.end2
 
 
diff --git 
a/clang/test/CodeGenCXX/msvc-global-delete-forwarding-at-delete-site.cpp 
b/clang/test/CodeGenCXX/msvc-global-delete-forwarding-at-delete-site.cpp
index e4a254f6d2ae8e..087e44c6ca5193 100644
--- a/clang/test/CodeGenCXX/msvc-global-delete-forwarding-at-delete-site.cpp
+++ b/clang/test/CodeGenCXX/msvc-global-delete-forwarding-at-delete-site.cpp
@@ -20,14 +20,14 @@ struct W {
 void sink(W *p) { ::delete p; }
 
 // The shared trapping fallback is emitted (kept alive via llvm.used).
-// CHECK: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// CHECK: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // CHECK-NEXT: call void @llvm.trap()
 // CHECK-NEXT: unreachable
 
 // The scalar wrapper gets a real forwarding body that calls the global
 // ::operator delete (??3@), even though no deleting destructor in this TU
 // references the wrapper.
-// CHECK: define linkonce_odr void @"?__global_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// CHECK: define linkonce_odr void @"?__global_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // CHECK-NEXT: call void @"??3@YAXPEAX_K@Z"(ptr %0, i64 %1)
 
 // No vector deleting destructor for W is emitted in this TU.
diff --git a/clang/test/CodeGenCXX/msvc-global-delete-scalar-array-split.cpp 
b/clang/test/CodeGenCXX/msvc-global-delete-scalar-array-split.cpp
index b558b2e6c78d0d..f7390423d7fa48 100644
--- a/clang/test/CodeGenCXX/msvc-global-delete-scalar-array-split.cpp
+++ b/clang/test/CodeGenCXX/msvc-global-delete-scalar-array-split.cpp
@@ -46,7 +46,7 @@ void test() {
 // The shared __empty_global_delete fallback is emitted with a trapping body
 // (kept alive via llvm.used) even though both wrappers have real forwarding
 // bodies here.
-// CHECK: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// CHECK: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // CHECK-NEXT: call void @llvm.trap()
 
 // The scalar deleting destructor's global path calls __global_delete.
@@ -58,7 +58,7 @@ void test() {
 // The forwarding bodies are emitted at end-of-module. Each wrapper forwards to
 // its OWN global operator delete: __global_delete to the scalar ??3@,
 // __global_array_delete to the array ??_V@.
-// CHECK: define linkonce_odr void @"?__global_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// CHECK: define linkonce_odr void @"?__global_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // CHECK-NEXT: call void @"??3@YAXPEAX_K@Z"(ptr %0, i64 %1)
-// CHECK: define linkonce_odr void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// CHECK: define linkonce_odr void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // CHECK-NEXT: call void @"??_V@YAXPEAX_K@Z"(ptr %0, i64 %1)
diff --git a/clang/test/CodeGenCXX/msvc-global-delete-scope-no-dtor.cpp 
b/clang/test/CodeGenCXX/msvc-global-delete-scope-no-dtor.cpp
index 09941600defa95..31a6a12b9591bb 100644
--- a/clang/test/CodeGenCXX/msvc-global-delete-scope-no-dtor.cpp
+++ b/clang/test/CodeGenCXX/msvc-global-delete-scope-no-dtor.cpp
@@ -62,6 +62,6 @@ void scopeTrivial(Trivial *q) {
 
 // __empty_global_delete is emitted as the trapping fallback (shared by the
 // scalar and array wrappers of this signature).
-// CHECK: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// CHECK: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // CHECK-NEXT: call void @llvm.trap()
 // CHECK-NEXT: unreachable
diff --git a/clang/test/CodeGenCXX/msvc-no-global-delete-forwarding.cpp 
b/clang/test/CodeGenCXX/msvc-no-global-delete-forwarding.cpp
index 1703b81c7f7f76..ba13498a582df5 100644
--- a/clang/test/CodeGenCXX/msvc-no-global-delete-forwarding.cpp
+++ b/clang/test/CodeGenCXX/msvc-no-global-delete-forwarding.cpp
@@ -35,14 +35,14 @@ void test() {
 // __global_array_delete wrapper, the scalar path uses __global_delete.
 // CHECK-LABEL: define weak dso_local noundef ptr @"??_EDerived@@UEAAPEAXI@Z"
 // CHECK: dtor.call_glob_delete_after_array_destroy:
-// CHECK: call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr noundef 
%{{.*}}, i64 noundef %{{.*}})
+// CHECK: call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr allocptr 
noundef %{{.*}}, i64 noundef %{{.*}})
 // CHECK: dtor.call_glob_delete:
-// CHECK-NEXT: call void @"?__global_delete@@YAXPEAX_K@Z"(ptr noundef %{{.*}}, 
i64 noundef 8)
+// CHECK-NEXT: call void @"?__global_delete@@YAXPEAX_K@Z"(ptr allocptr noundef 
%{{.*}}, i64 noundef 8)
 // CHECK: dtor.call_class_delete:
 // CHECK-NEXT: call void @"??3Base@@SAXPEAX@Z"(ptr noundef %{{.*}})
 
 // __empty_global_delete should be emitted with a trap.
-// CHECK: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
noundef %0, i64 noundef %1)
+// CHECK: define linkonce_odr void @"?__empty_global_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %0, i64 noundef %1)
 // CHECK-NEXT: call void @llvm.trap()
 // CHECK-NEXT: unreachable
 
diff --git a/clang/test/CodeGenCXX/msvc-vector-deleting-dtors-sized-delete.cpp 
b/clang/test/CodeGenCXX/msvc-vector-deleting-dtors-sized-delete.cpp
index 55ca315a8fb4b1..8fad2bb52a6211 100644
--- a/clang/test/CodeGenCXX/msvc-vector-deleting-dtors-sized-delete.cpp
+++ b/clang/test/CodeGenCXX/msvc-vector-deleting-dtors-sized-delete.cpp
@@ -50,5 +50,5 @@ void test() {
 // X86-NEXT:  %[[ARRSZ1:.*]] = mul i32 12, %[[HOWMANY]]
 // X64-NEXT:  %[[TOTALSZ1:.*]] = add i64 %[[ARRSZ1]], 8
 // X86-NEXT:  %[[TOTALSZ1:.*]] = add i32 %[[ARRSZ1]], 4
-// X64-NEXT:   call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr noundef 
%2, i64 noundef %[[TOTALSZ1]])
-// X86-NEXT:   call void @"?__global_array_delete@@YAXPAXI@Z"(ptr noundef %2, 
i32 noundef %[[TOTALSZ1]])
+// X64-NEXT:   call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr allocptr 
noundef %2, i64 noundef %[[TOTALSZ1]])
+// X86-NEXT:   call void @"?__global_array_delete@@YAXPAXI@Z"(ptr allocptr 
noundef %2, i32 noundef %[[TOTALSZ1]])
diff --git a/clang/test/CodeGenCXX/new-init-stmt-expr.cpp 
b/clang/test/CodeGenCXX/new-init-stmt-expr.cpp
index 08f58f090308c2..921ac1d41d4923 100644
--- a/clang/test/CodeGenCXX/new-init-stmt-expr.cpp
+++ b/clang/test/CodeGenCXX/new-init-stmt-expr.cpp
@@ -123,7 +123,7 @@ void ClassType() {
   // EH:            invoke void @_ZN8GH1754271SC1Ei(ptr {{.*}}[[CALL]], i32 
{{.*}})
   // EH-NEXT:       to label %invoke.cont unwind label %lpad
   // EH:          lpad:
-  // EH:            call void @_ZdlPvm(ptr noundef [[CALL]], i64 noundef 1)
+  // EH:            call void @_ZdlPvm(ptr allocptr noundef [[CALL]], i64 
noundef 1)
   new S(({
     while (true)
       ;
@@ -185,7 +185,7 @@ void NoreturnFirst() {
   // EH:          invoke.cont:
   // EH-NEXT:       unreachable
   // EH:          lpad:
-  // EH:            call void @_ZdlPvm(ptr noundef [[CALL]], i64 noundef 4)
+  // EH:            call void @_ZdlPvm(ptr allocptr noundef [[CALL]], i64 
noundef 4)
   // NOEH-NEXT:     call void @_ZN8GH1754272nrEv()
   // NOEH-NEXT:     unreachable
   new int(({
diff --git a/clang/test/CodeGenCXX/new.cpp b/clang/test/CodeGenCXX/new.cpp
index af225529c494e6..172ecbf13b373f 100644
--- a/clang/test/CodeGenCXX/new.cpp
+++ b/clang/test/CodeGenCXX/new.cpp
@@ -15,9 +15,9 @@ void t1() {
 }
 
 // CHECK: declare noundef nonnull ptr @_Znwm(i64 noundef) [[ATTR_NOBUILTIN:#[^ 
]*]]
-// CHECK: declare void @_ZdlPvm(ptr noundef, i64 noundef) 
[[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
+// CHECK: declare void @_ZdlPvm(ptr allocptr noundef, i64 noundef) 
[[ATTR_NOBUILTIN_NOUNWIND:#[^ ]*]]
 // CHECK: declare noundef nonnull ptr @_Znam(i64 noundef) [[ATTR_NOBUILTIN]]
-// CHECK: declare void @_ZdaPv(ptr noundef) [[ATTR_NOBUILTIN_NOUNWIND]]
+// CHECK: declare void @_ZdaPv(ptr allocptr noundef) 
[[ATTR_NOBUILTIN_NOUNWIND]]
 
 namespace std {
   struct nothrow_t {};
@@ -192,7 +192,7 @@ void f() {
   // CHECK: store i64 200
   delete[] new (nothrow) Alloc[10][20];
   // CHECK: call noalias noundef nonnull ptr @_Znwm
-  // CHECK: call void @_ZdlPvm(ptr noundef {{%.*}}, i64 noundef 1)
+  // CHECK: call void @_ZdlPvm(ptr allocptr noundef {{%.*}}, i64 noundef 1)
   delete new bool;
   // CHECK: ret void
 }
diff --git a/clang/test/CodeGenCXX/ptrauth-virtual-function.cpp 
b/clang/test/CodeGenCXX/ptrauth-virtual-function.cpp
index 70bd59716bb5b9..e646febce3914e 100644
--- a/clang/test/CodeGenCXX/ptrauth-virtual-function.cpp
+++ b/clang/test/CodeGenCXX/ptrauth-virtual-function.cpp
@@ -496,7 +496,7 @@ void testD3Destructor0(D3 *a) {
 // CHECK: %[[T14:[0-9]+]] = call i64 @llvm.ptrauth.blend(i64 %[[T13]], i64 
57279)
 // DARWIN: %call = call noundef ptr %[[T12]](ptr noundef nonnull align 
{{[0-9]+}} dereferenceable(32) %{{.*}}) #{{.*}} [ "ptrauth"(i32 0, i64 
%[[T14]]) ]
 // ELF:    call void %[[T12]](ptr noundef nonnull align {{[0-9]+}} 
dereferenceable(32) %{{.*}}) #{{.*}} [ "ptrauth"(i32 0, i64 %[[T14]]) ]
-// CHECK: call void @_ZdlPv(ptr noundef %[[T7]])
+// CHECK: call void @_ZdlPv(ptr allocptr noundef %[[T7]])
 
 void testD3Destructor1(D3 *a) {
   ::delete a;
diff --git a/clang/test/CodeGenCoroutines/coro-alloc.cpp 
b/clang/test/CodeGenCoroutines/coro-alloc.cpp
index 7b3be7e0b7f98d..c83f082425d0c1 100644
--- a/clang/test/CodeGenCoroutines/coro-alloc.cpp
+++ b/clang/test/CodeGenCoroutines/coro-alloc.cpp
@@ -71,7 +71,7 @@ extern "C" void f0(global_new_delete_tag) {
 
   // CHECK: [[FreeBB]]:
   // CHECK: %[[SIZE:.+]] = call i64 @llvm.coro.size.i64()
-  // CHECK: call void @_ZdlPvm(ptr noundef %[[MEM]], i64 noundef %[[SIZE]])
+  // CHECK: call void @_ZdlPvm(ptr allocptr noundef %[[MEM]], i64 noundef 
%[[SIZE]])
   // CHECK: br label %[[Afterwards]]
 
   // CHECK: [[Afterwards]]:
@@ -101,7 +101,7 @@ extern "C" void f1(promise_new_tag ) {
   // CHECK: %[[FRAME:.+]] = call ptr @llvm.coro.begin(
   // CHECK: %[[MEM:.+]] = call ptr @llvm.coro.free(token %[[ID]], ptr 
%[[FRAME]])
   // CHECK: %[[SIZE:.+]] = call i64 @llvm.coro.size.i64()
-  // CHECK: call void @_ZdlPvm(ptr noundef %[[MEM]], i64 noundef %[[SIZE]])
+  // CHECK: call void @_ZdlPvm(ptr allocptr noundef %[[MEM]], i64 noundef 
%[[SIZE]])
   co_return;
 }
 
diff --git a/clang/test/CodeGenCoroutines/coro-cleanup.cpp 
b/clang/test/CodeGenCoroutines/coro-cleanup.cpp
index 4e77ac25af1bf2..4dff36f389c038 100644
--- a/clang/test/CodeGenCoroutines/coro-cleanup.cpp
+++ b/clang/test/CodeGenCoroutines/coro-cleanup.cpp
@@ -85,12 +85,12 @@ void f() {
   // CHECK: call void @_ZNSt16coroutine_traitsIJvEE12promise_typeD1Ev(
   // CHECK: %[[Mem0:.+]] = call ptr @llvm.coro.free(
   // CHECK: %[[SIZE:.+]] = call i64 @llvm.coro.size.i64()
-  // CHECK: call void @_ZdlPvm(ptr noundef %[[Mem0]], i64 noundef %[[SIZE]])
+  // CHECK: call void @_ZdlPvm(ptr allocptr noundef %[[Mem0]], i64 noundef 
%[[SIZE]])
 
   // CHECK: [[Dealloc]]:
   // THROWEND:   %[[Mem:.+]] = call ptr @llvm.coro.free(
   // THROWEND:   %[[SIZE:.+]] = call i64 @llvm.coro.size.i64()
-  // THROWEND:   call void @_ZdlPvm(ptr noundef %[[Mem]], i64 noundef 
%[[SIZE]])
+  // THROWEND:   call void @_ZdlPvm(ptr allocptr noundef %[[Mem]], i64 noundef 
%[[SIZE]])
 
   co_return;
 }
diff --git a/clang/test/CodeGenCoroutines/coro-gro.cpp 
b/clang/test/CodeGenCoroutines/coro-gro.cpp
index c4c93a94570106..bccdfbeea084f5 100644
--- a/clang/test/CodeGenCoroutines/coro-gro.cpp
+++ b/clang/test/CodeGenCoroutines/coro-gro.cpp
@@ -85,7 +85,7 @@ int f() {
   // CHECK-NEXT: %[[Mem:.+]] = call ptr @llvm.coro.free(
 
   // CHECK: %[[SIZE:.+]] = call i64 @llvm.coro.size.i64()
-  // CHECK-NEXT: call void @_ZdlPvm(ptr noundef %[[Mem]], i64 noundef 
%[[SIZE]])
+  // CHECK-NEXT: call void @_ZdlPvm(ptr allocptr noundef %[[Mem]], i64 noundef 
%[[SIZE]])
 
   // CHECK: [[CoroRet]]:
   // CHECK-NEXT: call void @llvm.coro.end(
diff --git a/clang/test/Headers/openmp_new_nothrow.cpp 
b/clang/test/Headers/openmp_new_nothrow.cpp
index 8a26cd93d565c6..bb1a8319569554 100644
--- a/clang/test/Headers/openmp_new_nothrow.cpp
+++ b/clang/test/Headers/openmp_new_nothrow.cpp
@@ -70,7 +70,7 @@ int* new_array_stuff_nothrow() {
 // NVPTX-CXX11-NEXT:    [[PTR_ADDR:%.*]] = alloca ptr, align 8
 // NVPTX-CXX11-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR]], align 8
 // NVPTX-CXX11-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR]], align 8
-// NVPTX-CXX11-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr noundef [[TMP0]], 
ptr noundef nonnull align 1 dereferenceable(1) @nothrow) #[[ATTR8:[0-9]+]]
+// NVPTX-CXX11-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr allocptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) @nothrow) 
#[[ATTR8:[0-9]+]]
 // NVPTX-CXX11-NEXT:    ret void
 // NVPTX-CXX03-LABEL: define hidden void @_Z20delete_stuff_nothrowPi
 // NVPTX-CXX03-SAME: (ptr noundef [[PTR:%.*]]) #[[ATTR0]] {
@@ -78,7 +78,7 @@ int* new_array_stuff_nothrow() {
 // NVPTX-CXX03-NEXT:    [[PTR_ADDR:%.*]] = alloca ptr, align 8
 // NVPTX-CXX03-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR]], align 8
 // NVPTX-CXX03-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR]], align 8
-// NVPTX-CXX03-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr noundef [[TMP0]], 
ptr noundef nonnull align 1 dereferenceable(1) @nothrow) #[[ATTR6:[0-9]+]]
+// NVPTX-CXX03-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr allocptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) @nothrow) 
#[[ATTR6:[0-9]+]]
 // NVPTX-CXX03-NEXT:    ret void
 //
 // NVPTX-NVPTX-CXX11-LABEL: define hidden void @_Z20delete_stuff_nothrowPi
@@ -87,7 +87,7 @@ int* new_array_stuff_nothrow() {
 // NVPTX-NVPTX-CXX11-NEXT:    [[PTR_ADDR:%.*]] = alloca ptr, align 8
 // NVPTX-NVPTX-CXX11-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR]], align 8
 // NVPTX-NVPTX-CXX11-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR]], align 
8
-// NVPTX-NVPTX-CXX11-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) @nothrow) 
#[[ATTR8:[0-9]+]]
+// NVPTX-NVPTX-CXX11-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr allocptr 
noundef [[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) @nothrow) 
#[[ATTR8:[0-9]+]]
 // NVPTX-NVPTX-CXX11-NEXT:    ret void
 //
 // AMDGPU-CXX03-LABEL: define hidden void @_Z20delete_stuff_nothrowPi
@@ -97,7 +97,7 @@ int* new_array_stuff_nothrow() {
 // AMDGPU-CXX03-NEXT:    [[PTR_ADDR_ASCAST:%.*]] = addrspacecast ptr 
addrspace(5) [[PTR_ADDR]] to ptr
 // AMDGPU-CXX03-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR_ASCAST]], align 8
 // AMDGPU-CXX03-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR_ASCAST]], 
align 8
-// AMDGPU-CXX03-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr noundef [[TMP0]], 
ptr noundef nonnull align 1 dereferenceable(1) addrspacecast (ptr addrspace(1) 
@nothrow to ptr)) #[[ATTR6:[0-9]+]]
+// AMDGPU-CXX03-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr allocptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) addrspacecast (ptr 
addrspace(1) @nothrow to ptr)) #[[ATTR6:[0-9]+]]
 // AMDGPU-CXX03-NEXT:    ret void
 //
 // AMDGPU-CXX11-LABEL: define hidden void @_Z20delete_stuff_nothrowPi
@@ -107,7 +107,7 @@ int* new_array_stuff_nothrow() {
 // AMDGPU-CXX11-NEXT:    [[PTR_ADDR_ASCAST:%.*]] = addrspacecast ptr 
addrspace(5) [[PTR_ADDR]] to ptr
 // AMDGPU-CXX11-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR_ASCAST]], align 8
 // AMDGPU-CXX11-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR_ASCAST]], 
align 8
-// AMDGPU-CXX11-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr noundef [[TMP0]], 
ptr noundef nonnull align 1 dereferenceable(1) addrspacecast (ptr addrspace(1) 
@nothrow to ptr)) #[[ATTR8:[0-9]+]]
+// AMDGPU-CXX11-NEXT:    call void @_ZdlPvRKSt9nothrow_t(ptr allocptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) addrspacecast (ptr 
addrspace(1) @nothrow to ptr)) #[[ATTR8:[0-9]+]]
 // AMDGPU-CXX11-NEXT:    ret void
 //
 void delete_stuff_nothrow(int* ptr) {
@@ -121,7 +121,7 @@ void delete_stuff_nothrow(int* ptr) {
 // NVPTX-CXX11-NEXT:    [[PTR_ADDR:%.*]] = alloca ptr, align 8
 // NVPTX-CXX11-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR]], align 8
 // NVPTX-CXX11-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR]], align 8
-// NVPTX-CXX11-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr noundef [[TMP0]], 
ptr noundef nonnull align 1 dereferenceable(1) @nothrow) #[[ATTR8]]
+// NVPTX-CXX11-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr allocptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) @nothrow) #[[ATTR8]]
 // NVPTX-CXX11-NEXT:    ret void
 // NVPTX-CXX03-LABEL: define hidden void @_Z26delete_array_stuff_nothrowPi
 // NVPTX-CXX03-SAME: (ptr noundef [[PTR:%.*]]) #[[ATTR0]] {
@@ -129,7 +129,7 @@ void delete_stuff_nothrow(int* ptr) {
 // NVPTX-CXX03-NEXT:    [[PTR_ADDR:%.*]] = alloca ptr, align 8
 // NVPTX-CXX03-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR]], align 8
 // NVPTX-CXX03-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR]], align 8
-// NVPTX-CXX03-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr noundef [[TMP0]], 
ptr noundef nonnull align 1 dereferenceable(1) @nothrow) #[[ATTR6]]
+// NVPTX-CXX03-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr allocptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) @nothrow) #[[ATTR6]]
 // NVPTX-CXX03-NEXT:    ret void
 //
 // NVPTX-NVPTX-CXX11-LABEL: define hidden void 
@_Z26delete_array_stuff_nothrowPi
@@ -138,7 +138,7 @@ void delete_stuff_nothrow(int* ptr) {
 // NVPTX-NVPTX-CXX11-NEXT:    [[PTR_ADDR:%.*]] = alloca ptr, align 8
 // NVPTX-NVPTX-CXX11-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR]], align 8
 // NVPTX-NVPTX-CXX11-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR]], align 
8
-// NVPTX-NVPTX-CXX11-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) @nothrow) #[[ATTR8]]
+// NVPTX-NVPTX-CXX11-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr allocptr 
noundef [[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) @nothrow) 
#[[ATTR8]]
 // NVPTX-NVPTX-CXX11-NEXT:    ret void
 //
 // AMDGPU-CXX03-LABEL: define hidden void @_Z26delete_array_stuff_nothrowPi
@@ -148,7 +148,7 @@ void delete_stuff_nothrow(int* ptr) {
 // AMDGPU-CXX03-NEXT:    [[PTR_ADDR_ASCAST:%.*]] = addrspacecast ptr 
addrspace(5) [[PTR_ADDR]] to ptr
 // AMDGPU-CXX03-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR_ASCAST]], align 8
 // AMDGPU-CXX03-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR_ASCAST]], 
align 8
-// AMDGPU-CXX03-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr noundef [[TMP0]], 
ptr noundef nonnull align 1 dereferenceable(1) addrspacecast (ptr addrspace(1) 
@nothrow to ptr)) #[[ATTR6]]
+// AMDGPU-CXX03-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr allocptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) addrspacecast (ptr 
addrspace(1) @nothrow to ptr)) #[[ATTR6]]
 // AMDGPU-CXX03-NEXT:    ret void
 //
 // AMDGPU-CXX11-LABEL: define hidden void @_Z26delete_array_stuff_nothrowPi
@@ -158,7 +158,7 @@ void delete_stuff_nothrow(int* ptr) {
 // AMDGPU-CXX11-NEXT:    [[PTR_ADDR_ASCAST:%.*]] = addrspacecast ptr 
addrspace(5) [[PTR_ADDR]] to ptr
 // AMDGPU-CXX11-NEXT:    store ptr [[PTR]], ptr [[PTR_ADDR_ASCAST]], align 8
 // AMDGPU-CXX11-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[PTR_ADDR_ASCAST]], 
align 8
-// AMDGPU-CXX11-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr noundef [[TMP0]], 
ptr noundef nonnull align 1 dereferenceable(1) addrspacecast (ptr addrspace(1) 
@nothrow to ptr)) #[[ATTR8]]
+// AMDGPU-CXX11-NEXT:    call void @_ZdaPvRKSt9nothrow_t(ptr allocptr noundef 
[[TMP0]], ptr noundef nonnull align 1 dereferenceable(1) addrspacecast (ptr 
addrspace(1) @nothrow to ptr)) #[[ATTR8]]
 // AMDGPU-CXX11-NEXT:    ret void
 //
 void delete_array_stuff_nothrow(int* ptr) {
diff --git a/clang/test/Modules/msvc-vector-deleting-destructors.cpp 
b/clang/test/Modules/msvc-vector-deleting-destructors.cpp
index d6ccaf866db889..63b6fa5ea3b9b2 100644
--- a/clang/test/Modules/msvc-vector-deleting-destructors.cpp
+++ b/clang/test/Modules/msvc-vector-deleting-destructors.cpp
@@ -24,11 +24,11 @@ void out_of_module_tests(Derived *p, Derived *p1) {
 // CHECK32-NEXT: %[[ARRSZ:.*]] = mul i32 8, %[[COOKIE:.*]]
 // CHECK64-NEXT: %[[TOTALSZ:.*]] = add i64 %[[ARRSZ]], 8
 // CHECK32-NEXT: %[[TOTALSZ:.*]] = add i32 %[[ARRSZ]], 4
-// CHECK32-NEXT:   call void @"?__global_array_delete@@YAXPAXI@Z"(ptr noundef 
%2, i32 noundef %[[TOTALSZ]])
-// CHECK64-NEXT:   call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
noundef %2, i64 noundef %[[TOTALSZ]])
+// CHECK32-NEXT:   call void @"?__global_array_delete@@YAXPAXI@Z"(ptr allocptr 
noundef %2, i32 noundef %[[TOTALSZ]])
+// CHECK64-NEXT:   call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %2, i64 noundef %[[TOTALSZ]])
 // CHECK: dtor.call_glob_delete:
-// CHECK32-NEXT:   call void @"?__global_delete@@YAXPAXI@Z"(ptr noundef 
%this1, i32 noundef 8)
-// CHECK64-NEXT:   call void @"?__global_delete@@YAXPEAX_K@Z"(ptr noundef 
%this1, i64 noundef 16)
+// CHECK32-NEXT:   call void @"?__global_delete@@YAXPAXI@Z"(ptr allocptr 
noundef %this1, i32 noundef 8)
+// CHECK64-NEXT:   call void @"?__global_delete@@YAXPEAX_K@Z"(ptr allocptr 
noundef %this1, i64 noundef 16)
 // CHECK: dtor.call_class_delete:
 // CHECK32-NEXT:   call void @"??3Base2@@SAXPAX@Z"(ptr noundef %this1)
 // CHECK64-NEXT:   call void @"??3Base2@@SAXPEAX@Z"(ptr noundef %this1)
diff --git a/clang/test/OpenMP/structured-bindings-codegen.cpp 
b/clang/test/OpenMP/structured-bindings-codegen.cpp
index 67361fbe230ac4..1341e8e5b41f92 100644
--- a/clang/test/OpenMP/structured-bindings-codegen.cpp
+++ b/clang/test/OpenMP/structured-bindings-codegen.cpp
@@ -3512,7 +3512,7 @@ void test_target_map_orig_use_binding() {
 // CHECK:    [[ISNULL:%.*]] = icmp eq ptr [[TMP0]], null
 // CHECK:    br i1 [[ISNULL]], label %[[DELETE_END:.*]], label 
%[[DELETE_NOTNULL:.*]]
 // CHECK:       [[DELETE_NOTNULL]]:
-// CHECK:    call void @_ZdlPvm(ptr noundef [[TMP0]], i64 noundef 4) 
#[[ATTR15:[0-9]+]]
+// CHECK:    call void @_ZdlPvm(ptr allocptr noundef [[TMP0]], i64 noundef 4) 
#[[ATTR15:[0-9]+]]
 // CHECK:    br label %[[DELETE_END]]
 // CHECK:       [[DELETE_END]]:
 // CHECK:    ret void
diff --git a/clang/test/PCH/msvc-vector-deleting-destructors.cpp 
b/clang/test/PCH/msvc-vector-deleting-destructors.cpp
index 845fe4b246892c..4d60974f887c60 100644
--- a/clang/test/PCH/msvc-vector-deleting-destructors.cpp
+++ b/clang/test/PCH/msvc-vector-deleting-destructors.cpp
@@ -28,11 +28,11 @@ void out_of_module_tests(Derived *p, Derived *p1) {
 // CHECK32-NEXT: %[[ARRSZ:.*]] = mul i32 8, %[[COOKIE:.*]]
 // CHECK64-NEXT: %[[TOTALSZ:.*]] = add i64 %[[ARRSZ]], 8
 // CHECK32-NEXT: %[[TOTALSZ:.*]] = add i32 %[[ARRSZ]], 4
-// CHECK32-NEXT:   call void @"?__global_array_delete@@YAXPAXI@Z"(ptr noundef 
%2, i32 noundef %[[TOTALSZ]])
-// CHECK64-NEXT:   call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
noundef %2, i64 noundef %[[TOTALSZ]])
+// CHECK32-NEXT:   call void @"?__global_array_delete@@YAXPAXI@Z"(ptr allocptr 
noundef %2, i32 noundef %[[TOTALSZ]])
+// CHECK64-NEXT:   call void @"?__global_array_delete@@YAXPEAX_K@Z"(ptr 
allocptr noundef %2, i64 noundef %[[TOTALSZ]])
 // CHECK: dtor.call_glob_delete:
-// CHECK32-NEXT:   call void @"?__global_delete@@YAXPAXI@Z"(ptr noundef 
%this1, i32 noundef 8)
-// CHECK64-NEXT:   call void @"?__global_delete@@YAXPEAX_K@Z"(ptr noundef 
%this1, i64 noundef 16)
+// CHECK32-NEXT:   call void @"?__global_delete@@YAXPAXI@Z"(ptr allocptr 
noundef %this1, i32 noundef 8)
+// CHECK64-NEXT:   call void @"?__global_delete@@YAXPEAX_K@Z"(ptr allocptr 
noundef %this1, i64 noundef 16)
 // CHECK: dtor.call_class_delete:
 // CHECK32-NEXT:   call void @"??3Base2@@SAXPAX@Z"(ptr noundef %this1)
 // CHECK64-NEXT:   call void @"??3Base2@@SAXPEAX@Z"(ptr noundef %this1)

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to