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

This patch implements the setDSOLocal and protectedVisibility missing features. 
These are both required to get the 'dso_local' to show up correctly on RTTI 
members and to get their visibility correct. Previously, we approximated it 
based on the MLIR public/private-ness, but this doesn't take into account the 
visibility attribute, nor RTTI correctly.

This patch adds that, and adds testing for all of the places this changes. 
However, note that LLVM-IR will not print dso_local if it is 'implied' so it 
wasn't as obvious that it was not correctly marked in CIR (but LLVM-IR 
effectively 'got it right').

Additionally, mlir default-sets declarations as 'private', so we were missing a 
few cases where the linkage wasn't being set properly.  This patch ALSO updates 
those. This again is something that doesn't really end up in the LLVM-IR, just 
in the MLIR types however, so it isn't really visible, just another 
'correctness' fix.

>From 17b13b34990b0c2edff37c6cddcda356db3b5b82 Mon Sep 17 00:00:00 2001
From: erichkeane <[email protected]>
Date: Tue, 10 Nov 2026 10:55:39 -0800
Subject: [PATCH] [CIR] Implement 'dsoLocal and 'protected visibility'

This patch implements the setDSOLocal and protectedVisibility missing
features. These are both required to get the 'dso_local' to show up
correctly on RTTI members and to get their visibility correct.
Previously, we approximated it based on the MLIR public/private-ness,
but this doesn't take into account the visibility attribute, nor RTTI
correctly.

This patch adds that, and adds testing for all of the places this
changes. However, note that LLVM-IR will not print dso_local if it is
'implied' so it wasn't as obvious that it was not correctly marked in
CIR (but LLVM-IR effectively 'got it right').

Additionally, mlir default-sets declarations as 'private', so we were
missing a few cases where the linkage wasn't being set properly.  This
patch ALSO updates those. This again is something that doesn't really
end up in the LLVM-IR, just in the MLIR types however, so it isn't
really visible, just another 'correctness' fix.
---
 .../clang/CIR/Interfaces/CIROpInterfaces.td   |  6 +++
 clang/include/clang/CIR/MissingFeatures.h     |  2 -
 clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp | 32 ++++++-----
 clang/lib/CIR/Interfaces/CIROpInterfaces.cpp  |  4 +-
 clang/test/CIR/CodeGen/attribute-visibility.c | 15 ++----
 clang/test/CIR/CodeGen/rtti-visibility.cpp    | 53 +++++++++++++++++++
 clang/test/CIR/CodeGen/static-local.cpp       |  4 +-
 clang/test/CIR/CodeGenCXX/vtable-linkage.cpp  |  4 +-
 .../CIR/CodeGenHIP/kernel-handle-linkage.hip  |  4 +-
 clang/test/CIR/CodeGenOpenMP/weak-alias.c     |  4 +-
 10 files changed, 92 insertions(+), 36 deletions(-)
 create mode 100644 clang/test/CIR/CodeGen/rtti-visibility.cpp

diff --git a/clang/include/clang/CIR/Interfaces/CIROpInterfaces.td 
b/clang/include/clang/CIR/Interfaces/CIROpInterfaces.td
index 1563fc5aa00da3..ba172abcc5ec63 100644
--- a/clang/include/clang/CIR/Interfaces/CIROpInterfaces.td
+++ b/clang/include/clang/CIR/Interfaces/CIROpInterfaces.td
@@ -198,6 +198,12 @@ let cppNamespace = "::cir" in {
       }]
       >,
       InterfaceMethod<"",
+      "cir::VisibilityKind", "getGlobalVisibility", (ins), [{}],
+      /*defaultImplementation=*/[{
+        return $_op.getGlobalVisibility();
+      }]
+      >,
+      InterfaceMethod<"",
       "void", "setGlobalVisibility", (ins "cir::VisibilityKind":$val), [{}],
       /*defaultImplementation=*/[{
         $_op.setGlobalVisibility(val);
diff --git a/clang/include/clang/CIR/MissingFeatures.h 
b/clang/include/clang/CIR/MissingFeatures.h
index 8986da21542da7..47d77e5f3b7abe 100644
--- a/clang/include/clang/CIR/MissingFeatures.h
+++ b/clang/include/clang/CIR/MissingFeatures.h
@@ -38,11 +38,9 @@ struct MissingFeatures {
   static bool opGlobalAnnotations() { return false; }
   static bool opGlobalCtorPriority() { return false; }
   static bool emitNVVMMetadata() { return false; }
-  static bool setDSOLocal() { return false; }
 
   static bool supportIFuncAttr() { return false; }
   static bool hiddenVisibility() { return false; }
-  static bool protectedVisibility() { return false; }
   static bool defaultVisibility() { return false; }
 
   // Load/store attributes
diff --git a/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp 
b/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
index f70e6e7cd2da09..8e47a77ce92d95 100644
--- a/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
@@ -641,7 +641,8 @@ class CIRGenItaniumRTTIBuilder {
   /// Build the RTTI type info struct for the given type.
   mlir::Attribute buildTypeInfo(mlir::Location loc, QualType ty,
                                 cir::GlobalLinkageKind linkage,
-                                mlir::SymbolTable::Visibility visibility);
+                                mlir::SymbolTable::Visibility visibility,
+                                cir::VisibilityKind globalVisibility);
 };
 
 /// ShouldUseExternalRTTIDescriptor - Returns whether the type information for
@@ -1141,27 +1142,30 @@ mlir::Attribute 
CIRGenItaniumRTTIBuilder::buildTypeInfo(mlir::Location loc,
 
   // Give the type_info object and name the formal visibility of the
   // type itself.
-  assert(!cir::MissingFeatures::hiddenVisibility());
-  assert(!cir::MissingFeatures::protectedVisibility());
-
   mlir::SymbolTable::Visibility symVisibility;
-  if (cir::isLocalLinkage(linkage))
+  cir::VisibilityKind globalVisibility;
+  if (cir::isLocalLinkage(linkage)) {
     // If the linkage is local, only default visibility makes sense.
     symVisibility = mlir::SymbolTable::Visibility::Public;
-  else if (cxxABI.classifyRTTIUniqueness(ty, linkage) ==
-           CIRGenItaniumCXXABI::RUK_NonUniqueHidden) {
+    globalVisibility = cir::VisibilityKind::Default;
+  } else if (cxxABI.classifyRTTIUniqueness(ty, linkage) ==
+             CIRGenItaniumCXXABI::RUK_NonUniqueHidden) {
     cgm.errorNYI(
         "buildTypeInfo: classifyRTTIUniqueness == RUK_NonUniqueHidden");
+    symVisibility = CIRGenModule::getMLIRVisibility(HiddenVisibility);
+    globalVisibility = cir::VisibilityKind::Hidden;
+  } else {
     symVisibility = CIRGenModule::getMLIRVisibility(ty->getVisibility());
-  } else
-    symVisibility = CIRGenModule::getMLIRVisibility(ty->getVisibility());
+    globalVisibility = CIRGenModule::getCIRVisibilityKind(ty->getVisibility());
+  }
 
-  return buildTypeInfo(loc, ty, linkage, symVisibility);
+  return buildTypeInfo(loc, ty, linkage, symVisibility, globalVisibility);
 }
 
 mlir::Attribute CIRGenItaniumRTTIBuilder::buildTypeInfo(
     mlir::Location loc, QualType ty, cir::GlobalLinkageKind linkage,
-    mlir::SymbolTable::Visibility visibility) {
+    mlir::SymbolTable::Visibility visibility,
+    cir::VisibilityKind globalVisibility) {
   CIRGenBuilderTy &builder = cgm.getBuilder();
 
   assert(!cir::MissingFeatures::setDLLStorageClass());
@@ -1345,14 +1349,16 @@ mlir::Attribute CIRGenItaniumRTTIBuilder::buildTypeInfo(
   // object and the type_info name be uniqued when weakly emitted.
 
   mlir::SymbolTable::setSymbolVisibility(typeName, visibility);
+  typeName.setGlobalVisibility(globalVisibility);
   assert(!cir::MissingFeatures::setDLLStorageClass());
   assert(!cir::MissingFeatures::opGlobalPartition());
-  assert(!cir::MissingFeatures::setDSOLocal());
+  cgm.setDSOLocal(static_cast<mlir::Operation *>(typeName));
 
   mlir::SymbolTable::setSymbolVisibility(gv, visibility);
+  gv.setGlobalVisibility(globalVisibility);
   assert(!cir::MissingFeatures::setDLLStorageClass());
   assert(!cir::MissingFeatures::opGlobalPartition());
-  assert(!cir::MissingFeatures::setDSOLocal());
+  cgm.setDSOLocal(static_cast<mlir::Operation *>(gv));
 
   CIRGenModule::setInitializer(gv, init);
   return builder.getGlobalViewAttr(builder.getUInt8PtrTy(), gv);
diff --git a/clang/lib/CIR/Interfaces/CIROpInterfaces.cpp 
b/clang/lib/CIR/Interfaces/CIROpInterfaces.cpp
index 82427e2c122221..7a5745977fc56a 100644
--- a/clang/lib/CIR/Interfaces/CIROpInterfaces.cpp
+++ b/clang/lib/CIR/Interfaces/CIROpInterfaces.cpp
@@ -19,9 +19,7 @@ using namespace cir;
 #include "clang/CIR/MissingFeatures.h"
 
 bool CIRGlobalValueInterface::hasDefaultVisibility() {
-  assert(!cir::MissingFeatures::hiddenVisibility());
-  assert(!cir::MissingFeatures::protectedVisibility());
-  return isPublic() || isPrivate();
+  return getGlobalVisibility() == cir::VisibilityKind::Default;
 }
 
 bool CIRGlobalValueInterface::canBenefitFromLocalAlias() {
diff --git a/clang/test/CIR/CodeGen/attribute-visibility.c 
b/clang/test/CIR/CodeGen/attribute-visibility.c
index 7d3ecd37ce2483..e6fcca67547b81 100644
--- a/clang/test/CIR/CodeGen/attribute-visibility.c
+++ b/clang/test/CIR/CodeGen/attribute-visibility.c
@@ -3,23 +3,20 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o 
%t-cir.ll
 // RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s
 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s
+// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
 
 int normal_var = 10;
 // CIR: cir.global external @normal_var {{.*}}
-// LLVM: @normal_var = global {{.*}}
-// OGCG: @normal_var = global {{.*}}
+// LLVM: @normal_var = global i32 {{.*}}
 
 __attribute__((visibility("hidden")))
 int hidden_var = 10;
-// CIR: cir.global hidden external @hidden_var {{.*}}
-// LLVM: @hidden_var = hidden global {{.*}}
-// OGCG: @hidden_var = hidden global {{.*}}
+// CIR: cir.global hidden external dso_local @hidden_var {{.*}}
+// LLVM: @hidden_var = hidden global i32 {{.*}}
 
 static int normal_static_var = 10;
 // CIR: cir.global "private" internal dso_local @normal_static_var {{.*}}
-// LLVM: @normal_static_var = internal global {{.*}}
-// OGCG: @normal_static_var = internal global {{.*}}
+// LLVM: @normal_static_var = internal global i32 {{.*}}
 
 void normal_func() {
     normal_var = 0;
@@ -27,7 +24,6 @@ void normal_func() {
 }
 // CIR: cir.func no_inline no_proto dso_local @normal_func() {{.*}} {
 // LLVM: define dso_local void @normal_func() {{.*}}
-// OGCG: define dso_local void @normal_func() {{.*}}
 
 __attribute__((visibility("hidden")))
 void hidden_func() {
@@ -35,4 +31,3 @@ void hidden_func() {
 }
 // CIR: cir.func no_inline no_proto hidden dso_local @hidden_func() {{.*}} {
 // LLVM: define hidden void @hidden_func() {{.*}}
-// OGCG: define hidden void @hidden_func() {{.*}}
diff --git a/clang/test/CIR/CodeGen/rtti-visibility.cpp 
b/clang/test/CIR/CodeGen/rtti-visibility.cpp
new file mode 100644
index 00000000000000..2e3df848451bc0
--- /dev/null
+++ b/clang/test/CIR/CodeGen/rtti-visibility.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o 
%t.cir
+// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o 
%t-cir.ll
+// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
+// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
+
+namespace std {
+class type_info {
+public:
+  virtual ~type_info();
+};
+} // namespace std
+
+struct __attribute__((visibility("hidden"))) Hidden {
+  virtual void f();
+};
+struct __attribute__((visibility("protected"))) Protected {
+  virtual void f();
+};
+struct Default {
+  virtual void f();
+};
+
+const void *hidden = &typeid(Hidden);
+const void *prot = &typeid(Protected);
+const void *def = &typeid(Default);
+
+void Hidden::f() {}
+// CIR-DAG: cir.global "private" hidden constant external dso_local 
@_ZTV6Hidden =
+// CIR-DAG: cir.global "private" hidden constant external dso_local 
@_ZTS6Hidden =
+// CIR-DAG: cir.global "private" hidden constant external dso_local 
@_ZTI6Hidden =
+
+// LLVM-DAG: @_ZTV6Hidden = hidden constant { [3 x ptr] }
+// LLVM-DAG: @_ZTS6Hidden = hidden constant [8 x i8]
+// LLVM-DAG: @_ZTI6Hidden = hidden constant { ptr, ptr }
+void Protected::f() {}
+// CIR-DAG: cir.global "private" protected constant external dso_local 
@_ZTV9Protected =
+// CIR-DAG: cir.global protected constant external dso_local @_ZTS9Protected =
+// CIR-DAG: cir.global protected constant external dso_local @_ZTI9Protected =
+
+// LLVM-DAG: @_ZTV9Protected = protected constant { [3 x ptr] }
+// LLVM-DAG: @_ZTS9Protected = protected constant [11 x i8]
+// LLVM-DAG: @_ZTI9Protected = protected constant { ptr, ptr }
+void Default::f() {}
+// CIR-DAG: cir.global "private" constant external @_ZTV7Default =
+// CIR-DAG: cir.global constant external @_ZTS7Default =
+// CIR-DAG: cir.global constant external @_ZTI7Default =
+
+// LLVM-DAG: @_ZTV7Default = constant { [3 x ptr] }
+// LLVM-DAG: @_ZTS7Default = constant [9 x i8]
+// LLVM-DAG: @_ZTI7Default = constant { ptr, ptr }
+
diff --git a/clang/test/CIR/CodeGen/static-local.cpp 
b/clang/test/CIR/CodeGen/static-local.cpp
index 69390fb82701f6..5b07cd43dcf9ee 100644
--- a/clang/test/CIR/CodeGen/static-local.cpp
+++ b/clang/test/CIR/CodeGen/static-local.cpp
@@ -26,7 +26,7 @@
 // LLVM-DAG: @_ZGVZ1fvE1a = internal global i64 0
 // CIR-DAG: cir.global "private" linkonce_odr comdat @_ZGVZ10getInlineAvE1a = 
#cir.int<0> : !s64i
 // LLVM-DAG: @_ZGVZ10getInlineAvE1a = linkonce_odr global i64 0, comdat
-// CIR-DAG: cir.global "private" hidden linkonce_odr comdat 
@_ZGVZ16getHiddenInlineAvE1a = #cir.int<0> : !s64i
+// CIR-DAG: cir.global "private" hidden linkonce_odr comdat dso_local 
@_ZGVZ16getHiddenInlineAvE1a = #cir.int<0> : !s64i
 // LLVM-DAG: @_ZGVZ16getHiddenInlineAvE1a = linkonce_odr hidden global i64 0, 
comdat
 // CIR-DAG: cir.global "private" internal dso_local @_ZGVZ8ref_initvE1y = 
#cir.int<0> : !s64i
 // LLVM-DAG: @_ZGVZ8ref_initvE1y = internal global i64 0
@@ -201,7 +201,7 @@ void call_hidden_inline() {
   use(&getHiddenInlineA());
 }
 
-// CIR-BOTH-LABEL: cir.func no_inline comdat linkonce_odr hidden 
@_Z16getHiddenInlineAv()
+// CIR-BOTH-LABEL: cir.func no_inline comdat linkonce_odr hidden dso_local 
@_Z16getHiddenInlineAv()
 
 int bar();
 
diff --git a/clang/test/CIR/CodeGenCXX/vtable-linkage.cpp 
b/clang/test/CIR/CodeGenCXX/vtable-linkage.cpp
index 2ff709f9f81522..f3561ad57ccee6 100644
--- a/clang/test/CIR/CodeGenCXX/vtable-linkage.cpp
+++ b/clang/test/CIR/CodeGenCXX/vtable-linkage.cpp
@@ -198,7 +198,7 @@ void use_F() {
 // internal linkage.
 // CIR-DAG: cir.global "private" constant internal dso_local @_ZTV3$_0 = 
#cir.vtable<{#cir.const_array<[#cir.ptr<null> : !cir.ptr<!u8i>, 
#cir.global_view<@_ZTI3$_0> : !cir.ptr<!u8i>, #cir.global_view<@_ZN1D1fEv> : 
!cir.ptr<!u8i>]> : !cir.array<!cir.ptr<!u8i> x 3>}> : !{{.*}}align(8)
 // CIR-DAG: cir.global constant internal dso_local @_ZTS3$_0 = 
#cir.const_array<"3$_0" : !cir.array<!s8i x 4>, trailing_zeros> : 
!cir.array<!s8i x 5> align(1)
-// CIR-DAG: cir.global constant internal @_ZTI3$_0 = 
#cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv120__si_class_type_infoE, [2 : 
i32]> : !cir.ptr<!u8i>, #cir.global_view<@_ZTS3$_0> : !cir.ptr<!u8i>, 
#cir.global_view<@_ZTI1D> : !cir.ptr<!u8i>}> : !{{.*}}align(8)
+// CIR-DAG: cir.global constant internal dso_local @_ZTI3$_0 = 
#cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv120__si_class_type_infoE, [2 : 
i32]> : !cir.ptr<!u8i>, #cir.global_view<@_ZTS3$_0> : !cir.ptr<!u8i>, 
#cir.global_view<@_ZTI1D> : !cir.ptr<!u8i>}> : !{{.*}}align(8)
 // LLVM-DAG: @"_ZTV3$_0" = internal constant { [3 x ptr] } { [3 x ptr] [ptr 
null, ptr @"_ZTI3$_0", ptr @_ZN1D1fEv] }, align 8
 // LLVM-DAG: @"_ZTS3$_0" = internal constant [5 x i8] c"3$_0\00", align 1
 // LLVM-DAG: @"_ZTI3$_0" = internal constant { ptr, ptr, ptr } { ptr 
getelementptr {{.*}}({{.*}}, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 
{{.*}}), ptr @"_ZTS3$_0", ptr @_ZTI1D }, align 8
@@ -207,7 +207,7 @@ void use_F() {
 // namespace.
 // CIR-DAG: cir.global "private" constant internal dso_local 
@_ZTVN12_GLOBAL__N_11AE = #cir.vtable<{#cir.const_array<[#cir.ptr<null> : 
!cir.ptr<!u8i>, #cir.global_view<@_ZTIN12_GLOBAL__N_11AE> : !cir.ptr<!u8i>, 
#cir.global_view<@_ZN12_GLOBAL__N_11A1fEv> : !cir.ptr<!u8i>]> : 
!cir.array<!cir.ptr<!u8i> x 3>}> : !{{.*}}align(8)
 // CIR-DAG: cir.global constant internal dso_local @_ZTSN12_GLOBAL__N_11AE = 
#cir.const_array<"N12_GLOBAL__N_11AE" : !cir.array<!s8i x 18>, trailing_zeros> 
: !cir.array<!s8i x 19> align(1)
-// CIR-DAG: cir.global constant internal @_ZTIN12_GLOBAL__N_11AE = 
#cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : 
i32]> : !cir.ptr<!u8i>, #cir.global_view<@_ZTSN12_GLOBAL__N_11AE> : 
!cir.ptr<!u8i>}> : !{{.*}}align(8)
+// CIR-DAG: cir.global constant internal dso_local @_ZTIN12_GLOBAL__N_11AE = 
#cir.typeinfo<{#cir.global_view<@_ZTVN10__cxxabiv117__class_type_infoE, [2 : 
i32]> : !cir.ptr<!u8i>, #cir.global_view<@_ZTSN12_GLOBAL__N_11AE> : 
!cir.ptr<!u8i>}> : !{{.*}}align(8)
 // LLVM-DAG: @_ZTVN12_GLOBAL__N_11AE = internal constant { [3 x ptr] } { [3 x 
ptr] [ptr null, ptr @_ZTIN12_GLOBAL__N_11AE, ptr @_ZN12_GLOBAL__N_11A1fEv] }, 
align 8
 // LLVM-DAG: @_ZTSN12_GLOBAL__N_11AE = internal constant [19 x i8] 
c"N12_GLOBAL__N_11AE\00", align 1
 // LLVM-DAG: @_ZTIN12_GLOBAL__N_11AE = internal constant { ptr, ptr } { ptr 
getelementptr {{.*}}({{.*}}, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 
{{.*}}), ptr @_ZTSN12_GLOBAL__N_11AE }, align 8
diff --git a/clang/test/CIR/CodeGenHIP/kernel-handle-linkage.hip 
b/clang/test/CIR/CodeGenHIP/kernel-handle-linkage.hip
index c518a0f7feb7de..16bf211ed021ac 100644
--- a/clang/test/CIR/CodeGenHIP/kernel-handle-linkage.hip
+++ b/clang/test/CIR/CodeGenHIP/kernel-handle-linkage.hip
@@ -81,7 +81,7 @@ void launch(int *p) {
 static __global__ void fwd_kernel(int *p) {}
 
 // CIR-DAG: cir.global constant external @_Z10ext_kernelPi = 
#cir.global_view<@_Z25__device_stub__ext_kernelPi>
-// CIR-DAG: cir.global hidden constant external @_Z13hidden_kernelPi = 
#cir.global_view<@_Z28__device_stub__hidden_kernelPi>
+// CIR-DAG: cir.global hidden constant external dso_local @_Z13hidden_kernelPi 
= #cir.global_view<@_Z28__device_stub__hidden_kernelPi>
 // CIR-DAG: cir.global "private" constant internal dso_local 
@_ZL11static_tmplIiEvPT_ = 
#cir.global_view<@_ZL26__device_stub__static_tmplIiEvPT_>
 // CIR-DAG: cir.global constant linkonce_odr comdat @_Z4tmplIiEvPT_ = 
#cir.global_view<@_Z19__device_stub__tmplIiEvPT_>
 // CIR-DAG: cir.global "private" constant internal dso_local 
@_ZL13static_kernelPi = #cir.global_view<@_ZL28__device_stub__static_kernelPi>
@@ -89,7 +89,7 @@ static __global__ void fwd_kernel(int *p) {}
 // CIR-DAG: cir.global "private" constant internal dso_local 
@_ZL10fwd_kernelPi = #cir.global_view<@_ZL25__device_stub__fwd_kernelPi>
 // CIR-DAG: cir.global constant weak_odr comdat @_Z4instIfEvPT_ = 
#cir.global_view<@_Z19__device_stub__instIfEvPT_>
 // CIR-DAG: cir.global constant external @_Z9decl_onlyIiEvPT_ = 
#cir.global_view<@_Z24__device_stub__decl_onlyIiEvPT_>
-// CIR-DAG: cir.global "private" hidden constant external 
@_Z17hidden_ext_kernelPi :
+// CIR-DAG: cir.global "private" hidden constant external dso_local 
@_Z17hidden_ext_kernelPi :
 // CIR-DAG: cir.global "private" constant external @_Z15ext_decl_kernelPi :
 // CIR-DAG: cir.global "private" constant internal dso_local 
@_ZL20static_hidden_kernelPi = 
#cir.global_view<@_ZL35__device_stub__static_hidden_kernelPi>
 
diff --git a/clang/test/CIR/CodeGenOpenMP/weak-alias.c 
b/clang/test/CIR/CodeGenOpenMP/weak-alias.c
index e9f96e9d4b98df..aabca6010fc1ba 100644
--- a/clang/test/CIR/CodeGenOpenMP/weak-alias.c
+++ b/clang/test/CIR/CodeGenOpenMP/weak-alias.c
@@ -14,8 +14,8 @@ int One(void) __attribute__((weak, alias("__One")));
 int One_(void) __attribute__((alias("__One")));
 
 // Declare target aliasee: emitted on the device.
-// CIR-DAG: cir.func weak hidden @Two() -> !s32i alias(@__Two)
-// CIR-DAG: cir.func hidden @Two_() -> !s32i alias(@__Two)
+// CIR-DAG: cir.func weak hidden dso_local @Two() -> !s32i alias(@__Two)
+// CIR-DAG: cir.func hidden dso_local @Two_() -> !s32i alias(@__Two)
 // LLVM-DAG: @Two = weak hidden alias i32 (), ptr @__Two
 // LLVM-DAG: @Two_ = hidden alias i32 (), ptr @__Two
 // OGCG-DAG: @Two = weak hidden alias i32 (), ptr @__Two

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

Reply via email to