ChuanqiXu created this revision.
ChuanqiXu added reviewers: nhaehnle, jyknight, nikic, rjmccall, efriedma, 
fhahn, ychen, jdoerfert.
ChuanqiXu added a project: clang.
Herald added subscribers: jeroen.dobbelaere, wenlei, okura, kuter, arichardson.
Herald added a project: All.
ChuanqiXu requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added subscribers: llvm-commits, cfe-commits, sstefan1.
Herald added a project: LLVM.

Successor of D132352 <https://reviews.llvm.org/D132352>

This revision adds `noread_thread_id` attribute to intrinsics, including:
(1) DefaultAttributeIntrinsics
(2) memset, memcpy, ... 
(3) debugging intrinsics

Also the patch removes `llvm.threadlocal.address(ptr)` and 
`llvm.thread.pointer()` from DefaultAttributeIntrinsics since they may access 
the thread identification.

I am not 100% sure I added `noread_thread_id ` attribute for all the proper 
intrinsics. But I think it is not bad to add them in an iterative fashion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132434

Files:
  clang/test/CodeGen/builtin-sqrt.c
  clang/test/CodeGen/libcalls.c
  llvm/include/llvm/IR/Intrinsics.td
  llvm/test/Analysis/BasicAA/cs-cs.ll
  llvm/test/Analysis/BasicAA/intrinsics.ll
  llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
  llvm/test/Analysis/TypeBasedAliasAnalysis/intrinsics.ll
  llvm/test/Assembler/aarch64-intrinsics-attributes.ll
  llvm/test/Bindings/llvm-c/debug_info.ll
  llvm/test/Bitcode/compatibility-3.6.ll
  llvm/test/Bitcode/compatibility-3.7.ll
  llvm/test/Bitcode/compatibility-3.8.ll
  llvm/test/Bitcode/compatibility-3.9.ll
  llvm/test/Bitcode/compatibility-4.0.ll
  llvm/test/Bitcode/compatibility-5.0.ll
  llvm/test/Bitcode/compatibility-6.0.ll
  llvm/test/Bitcode/compatibility.ll
  llvm/test/Bitcode/upgrade-invariant-group-barrier.ll
  llvm/test/Feature/intrinsics.ll
  llvm/test/Instrumentation/MemorySanitizer/attributes.ll
  llvm/test/Other/invariant.group.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
  
llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
  
llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll
  llvm/test/Transforms/Attributor/dereferenceable-1.ll
  llvm/test/Transforms/Attributor/heap_to_stack.ll
  llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
  llvm/test/Transforms/Attributor/liveness.ll
  llvm/test/Transforms/Attributor/lowerheap.ll
  llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll
  llvm/test/Transforms/Attributor/memory_locations.ll
  llvm/test/Transforms/Attributor/noalias.ll
  llvm/test/Transforms/Attributor/nocapture-1.ll
  llvm/test/Transforms/Attributor/nofree.ll
  llvm/test/Transforms/Attributor/nonnull.ll
  llvm/test/Transforms/Attributor/norecurse.ll
  llvm/test/Transforms/Attributor/nosync.ll
  llvm/test/Transforms/Attributor/openmp_parallel.ll
  llvm/test/Transforms/Attributor/readattrs.ll
  llvm/test/Transforms/Attributor/value-simplify-assume.ll
  llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
  llvm/test/Transforms/Attributor/value-simplify.ll
  llvm/test/Transforms/Attributor/willreturn.ll
  llvm/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
  llvm/test/Transforms/DeadArgElim/keepalive.ll
  llvm/test/Transforms/GlobalOpt/ctor-memset.ll
  llvm/test/Transforms/GlobalOpt/pr54572.ll
  llvm/test/Transforms/Inline/inline_invoke.ll
  llvm/test/Transforms/InstCombine/AArch64/2012-04-23-Neon-Intrinsics.ll
  llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll
  llvm/test/Transforms/ObjCARC/basic.ll
  llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
  llvm/test/Transforms/ObjCARC/nested.ll
  llvm/test/Transforms/OpenMP/replace_globalization.ll
  llvm/test/Transforms/OpenMP/spmdization.ll
  llvm/test/Transforms/OpenMP/spmdization_guarding.ll
  llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
  
llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad-debuginfo.ll
  llvm/test/Verifier/fp-intrinsics.ll
  
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.globals.expected
  llvm/test/tools/llvm-reduce/remove-attributes-from-intrinsics.ll
  llvm/utils/TableGen/CodeGenIntrinsics.h
  llvm/utils/TableGen/CodeGenTarget.cpp
  llvm/utils/TableGen/IntrinsicEmitter.cpp

Index: llvm/utils/TableGen/IntrinsicEmitter.cpp
===================================================================
--- llvm/utils/TableGen/IntrinsicEmitter.cpp
+++ llvm/utils/TableGen/IntrinsicEmitter.cpp
@@ -640,6 +640,9 @@
     if (L->hasSideEffects != R->hasSideEffects)
       return R->hasSideEffects;
 
+    if (L->isNoReadThreadID != R->isNoReadThreadID)
+      return R->isNoReadThreadID;
+
     // Try to order by readonly/readnone attribute.
     CodeGenIntrinsic::ModRefBehavior LK = L->ModRef;
     CodeGenIntrinsic::ModRefBehavior RK = R->ModRef;
@@ -777,13 +780,16 @@
         Intrinsic.isNoReturn || Intrinsic.isNoCallback || Intrinsic.isNoSync ||
         Intrinsic.isNoFree || Intrinsic.isWillReturn || Intrinsic.isCold ||
         Intrinsic.isNoDuplicate || Intrinsic.isNoMerge ||
-        Intrinsic.isConvergent || Intrinsic.isSpeculatable) {
+        Intrinsic.isConvergent || Intrinsic.isSpeculatable ||
+        Intrinsic.isNoReadThreadID) {
       OS << "      const Attribute::AttrKind Atts[] = {";
       ListSeparator LS(",");
       if (!Intrinsic.canThrow)
         OS << LS << "Attribute::NoUnwind";
       if (Intrinsic.isNoReturn)
         OS << LS << "Attribute::NoReturn";
+      if (Intrinsic.isNoReadThreadID)
+        OS << LS << "Attribute::NoReadThreadID";
       if (Intrinsic.isNoCallback)
         OS << LS << "Attribute::NoCallback";
       if (Intrinsic.isNoSync)
Index: llvm/utils/TableGen/CodeGenTarget.cpp
===================================================================
--- llvm/utils/TableGen/CodeGenTarget.cpp
+++ llvm/utils/TableGen/CodeGenTarget.cpp
@@ -671,6 +671,7 @@
   isCommutative = false;
   canThrow = false;
   isNoReturn = false;
+  isNoReadThreadID = false;
   isNoCallback = false;
   isNoSync = false;
   isNoFree = false;
@@ -870,6 +871,8 @@
     isConvergent = true;
   else if (R->getName() == "IntrNoReturn")
     isNoReturn = true;
+  else if (R->getName() == "IntrNoReadThreadID")
+    isNoReadThreadID = true;
   else if (R->getName() == "IntrNoCallback")
     isNoCallback = true;
   else if (R->getName() == "IntrNoSync")
Index: llvm/utils/TableGen/CodeGenIntrinsics.h
===================================================================
--- llvm/utils/TableGen/CodeGenIntrinsics.h
+++ llvm/utils/TableGen/CodeGenIntrinsics.h
@@ -125,6 +125,9 @@
   /// True if the intrinsic is no-return.
   bool isNoReturn;
 
+  /// True if the intrinsic is no-read-thread-id.
+  bool isNoReadThreadID;
+
   /// True if the intrinsic is no-callback.
   bool isNoCallback;
 
Index: llvm/test/tools/llvm-reduce/remove-attributes-from-intrinsics.ll
===================================================================
--- llvm/test/tools/llvm-reduce/remove-attributes-from-intrinsics.ll
+++ llvm/test/tools/llvm-reduce/remove-attributes-from-intrinsics.ll
@@ -26,7 +26,7 @@
 ; CHECK-ALL: declare i32 @llvm.uadd.sat.i32(i32, i32) #0
 declare i32 @llvm.uadd.sat.i32(i32, i32) #0
 
-; CHECK-ALL: attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; CHECK-ALL: attributes #0 = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 
 ; CHECK-INTERESTINGNESS: attributes #1 = {
 ; CHECK-INTERESTINGNESS-SAME: "arg4"
Index: llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.globals.expected
===================================================================
--- llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.globals.expected
+++ llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/various_ir_values.ll.funcsig.globals.expected
@@ -249,8 +249,8 @@
 !61 = !{!"branch_weights", i32 1, i32 1048575}
 ;.
 ; CHECK: attributes #[[ATTR0]] = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="ieee,ieee" "denormal-fp-math-f32"="ieee,ieee" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
-; CHECK: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
+; CHECK: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #[[ATTR3]] = { nounwind }
 ;.
 ; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0 (g...@github.com:llvm/llvm-project.git 1d5da8cd30fce1c0a2c2fa6ba656dbfaa36192c8)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
Index: llvm/test/Verifier/fp-intrinsics.ll
===================================================================
--- llvm/test/Verifier/fp-intrinsics.ll
+++ llvm/test/Verifier/fp-intrinsics.ll
@@ -12,7 +12,7 @@
 ; attached to the FP intrinsic.
 ; CHECK1: declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata) #[[ATTR:[0-9]+]]
 ; CHECK1: declare double @llvm.experimental.constrained.sqrt.f64(double, metadata, metadata) #[[ATTR]]
-; CHECK1: attributes #[[ATTR]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; CHECK1: attributes #[[ATTR]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; Note: FP exceptions aren't usually caught through normal unwind mechanisms,
 ;       but we may want to revisit this for asynchronous exception handling.
 define double @f1(double %a, double %b) #0 {
Index: llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad-debuginfo.ll
===================================================================
--- llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad-debuginfo.ll
+++ llvm/test/Transforms/SimplifyCFG/X86/merge-compatible-invokes-of-landingpad-debuginfo.ll
@@ -68,7 +68,7 @@
 declare dso_local i32 @__gxx_personality_v0(...)
 ;.
 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { noreturn }
-; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ;.
 ; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
 ; CHECK: [[META1:![0-9]+]] = !DIFile(filename: "<stdin>", directory: "/")
Index: llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
===================================================================
--- llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
+++ llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
@@ -64,7 +64,7 @@
   ret void
 }
 
-; CHECK-IL: Function Attrs: inaccessiblememonly nocallback nofree nosync nounwind willreturn
+; CHECK-IL: Function Attrs: inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn
 ; CHECK-IL-NEXT: declare void @llvm.pseudoprobe(i64, i64, i32, i64)
 
 ; CHECK-IL: ![[#FOO:]] = distinct !DISubprogram(name: "foo"
Index: llvm/test/Transforms/OpenMP/spmdization_guarding.ll
===================================================================
--- llvm/test/Transforms/OpenMP/spmdization_guarding.ll
+++ llvm/test/Transforms/OpenMP/spmdization_guarding.ll
@@ -397,7 +397,7 @@
 ; CHECK: attributes #[[ATTR4:[0-9]+]] = { nosync nounwind allocsize(0) }
 ; CHECK: attributes #[[ATTR5:[0-9]+]] = { nosync nounwind }
 ; CHECK: attributes #[[ATTR6]] = { nounwind }
-; CHECK: attributes #[[ATTR7:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #[[ATTR7:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #[[ATTR8:[0-9]+]] = { convergent nounwind }
 ; CHECK: attributes #[[ATTR9]] = { nounwind willreturn }
 ; CHECK: attributes #[[ATTR10]] = { convergent nounwind "llvm.assume"="omp_no_openmp,ompx_spmd_amenable" }
@@ -409,7 +409,7 @@
 ; CHECK-DISABLED: attributes #[[ATTR4:[0-9]+]] = { nosync nounwind allocsize(0) }
 ; CHECK-DISABLED: attributes #[[ATTR5:[0-9]+]] = { nosync nounwind }
 ; CHECK-DISABLED: attributes #[[ATTR6]] = { nounwind }
-; CHECK-DISABLED: attributes #[[ATTR7:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; CHECK-DISABLED: attributes #[[ATTR7:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK-DISABLED: attributes #[[ATTR8:[0-9]+]] = { convergent nounwind }
 ; CHECK-DISABLED: attributes #[[ATTR9]] = { nounwind willreturn }
 ; CHECK-DISABLED: attributes #[[ATTR10]] = { convergent nounwind "llvm.assume"="omp_no_openmp,ompx_spmd_amenable" }
Index: llvm/test/Transforms/OpenMP/spmdization.ll
===================================================================
--- llvm/test/Transforms/OpenMP/spmdization.ll
+++ llvm/test/Transforms/OpenMP/spmdization.ll
@@ -702,9 +702,9 @@
 ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__2
 ; AMDGPU-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] {
 ; AMDGPU-NEXT:  entry:
-; AMDGPU-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 4, addrspace(5)
+; AMDGPU-NEXT:    [[X_H2S:%.*]] = alloca i8, i64 4, align 4, addrspace(5)
 ; AMDGPU-NEXT:    [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8
-; AMDGPU-NEXT:    [[MALLOC_CAST:%.*]] = addrspacecast i8 addrspace(5)* [[TMP0]] to i8*
+; AMDGPU-NEXT:    [[MALLOC_CAST:%.*]] = addrspacecast i8 addrspace(5)* [[X_H2S]] to i8*
 ; AMDGPU-NEXT:    [[X_ON_STACK:%.*]] = bitcast i8* [[MALLOC_CAST]] to i32*
 ; AMDGPU-NEXT:    call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR7]]
 ; AMDGPU-NEXT:    br label [[FOR_COND:%.*]]
@@ -716,18 +716,18 @@
 ; AMDGPU-NEXT:    call void @spmd_amenable() #[[ATTR7]]
 ; AMDGPU-NEXT:    ret void
 ; AMDGPU:       for.body:
-; AMDGPU-NEXT:    [[TMP1:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]]
-; AMDGPU-NEXT:    [[TMP2:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8**
-; AMDGPU-NEXT:    call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__3 to i8*), i8* bitcast (void (i16, i32)* @__omp_outlined__3_wrapper to i8*), i8** [[TMP2]], i64 0)
+; AMDGPU-NEXT:    [[TMP0:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]]
+; AMDGPU-NEXT:    [[TMP1:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8**
+; AMDGPU-NEXT:    call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__3 to i8*), i8* bitcast (void (i16, i32)* @__omp_outlined__3_wrapper to i8*), i8** [[TMP1]], i64 0)
 ; AMDGPU-NEXT:    [[INC]] = add nsw i32 [[I_0]], 1
 ; AMDGPU-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]]
 ;
 ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__2
 ; NVPTX-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] {
 ; NVPTX-NEXT:  entry:
-; NVPTX-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 4
+; NVPTX-NEXT:    [[X_H2S:%.*]] = alloca i8, i64 4, align 4
 ; NVPTX-NEXT:    [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8
-; NVPTX-NEXT:    [[X_ON_STACK:%.*]] = bitcast i8* [[TMP0]] to i32*
+; NVPTX-NEXT:    [[X_ON_STACK:%.*]] = bitcast i8* [[X_H2S]] to i32*
 ; NVPTX-NEXT:    call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR7]]
 ; NVPTX-NEXT:    br label [[FOR_COND:%.*]]
 ; NVPTX:       for.cond:
@@ -738,18 +738,18 @@
 ; NVPTX-NEXT:    call void @spmd_amenable() #[[ATTR7]]
 ; NVPTX-NEXT:    ret void
 ; NVPTX:       for.body:
-; NVPTX-NEXT:    [[TMP1:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]]
-; NVPTX-NEXT:    [[TMP2:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8**
-; NVPTX-NEXT:    call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__3 to i8*), i8* bitcast (void (i16, i32)* @__omp_outlined__3_wrapper to i8*), i8** [[TMP2]], i64 0)
+; NVPTX-NEXT:    [[TMP0:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]]
+; NVPTX-NEXT:    [[TMP1:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8**
+; NVPTX-NEXT:    call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__3 to i8*), i8* bitcast (void (i16, i32)* @__omp_outlined__3_wrapper to i8*), i8** [[TMP1]], i64 0)
 ; NVPTX-NEXT:    [[INC]] = add nsw i32 [[I_0]], 1
 ; NVPTX-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]]
 ;
 ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__2
 ; AMDGPU-DISABLED-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] {
 ; AMDGPU-DISABLED-NEXT:  entry:
-; AMDGPU-DISABLED-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 4, addrspace(5)
+; AMDGPU-DISABLED-NEXT:    [[X_H2S:%.*]] = alloca i8, i64 4, align 4, addrspace(5)
 ; AMDGPU-DISABLED-NEXT:    [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8
-; AMDGPU-DISABLED-NEXT:    [[MALLOC_CAST:%.*]] = addrspacecast i8 addrspace(5)* [[TMP0]] to i8*
+; AMDGPU-DISABLED-NEXT:    [[MALLOC_CAST:%.*]] = addrspacecast i8 addrspace(5)* [[X_H2S]] to i8*
 ; AMDGPU-DISABLED-NEXT:    [[X_ON_STACK:%.*]] = bitcast i8* [[MALLOC_CAST]] to i32*
 ; AMDGPU-DISABLED-NEXT:    call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR7]]
 ; AMDGPU-DISABLED-NEXT:    br label [[FOR_COND:%.*]]
@@ -761,18 +761,18 @@
 ; AMDGPU-DISABLED-NEXT:    call void @spmd_amenable() #[[ATTR7]]
 ; AMDGPU-DISABLED-NEXT:    ret void
 ; AMDGPU-DISABLED:       for.body:
-; AMDGPU-DISABLED-NEXT:    [[TMP1:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]]
-; AMDGPU-DISABLED-NEXT:    [[TMP2:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8**
-; AMDGPU-DISABLED-NEXT:    call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__3 to i8*), i8* @__omp_outlined__3_wrapper.ID, i8** [[TMP2]], i64 0)
+; AMDGPU-DISABLED-NEXT:    [[TMP0:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]]
+; AMDGPU-DISABLED-NEXT:    [[TMP1:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8**
+; AMDGPU-DISABLED-NEXT:    call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__3 to i8*), i8* @__omp_outlined__3_wrapper.ID, i8** [[TMP1]], i64 0)
 ; AMDGPU-DISABLED-NEXT:    [[INC]] = add nsw i32 [[I_0]], 1
 ; AMDGPU-DISABLED-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]]
 ;
 ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__2
 ; NVPTX-DISABLED-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] {
 ; NVPTX-DISABLED-NEXT:  entry:
-; NVPTX-DISABLED-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 4
+; NVPTX-DISABLED-NEXT:    [[X_H2S:%.*]] = alloca i8, i64 4, align 4
 ; NVPTX-DISABLED-NEXT:    [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x i8*], align 8
-; NVPTX-DISABLED-NEXT:    [[X_ON_STACK:%.*]] = bitcast i8* [[TMP0]] to i32*
+; NVPTX-DISABLED-NEXT:    [[X_ON_STACK:%.*]] = bitcast i8* [[X_H2S]] to i32*
 ; NVPTX-DISABLED-NEXT:    call void @use(i32* nocapture [[X_ON_STACK]]) #[[ATTR7]]
 ; NVPTX-DISABLED-NEXT:    br label [[FOR_COND:%.*]]
 ; NVPTX-DISABLED:       for.cond:
@@ -783,9 +783,9 @@
 ; NVPTX-DISABLED-NEXT:    call void @spmd_amenable() #[[ATTR7]]
 ; NVPTX-DISABLED-NEXT:    ret void
 ; NVPTX-DISABLED:       for.body:
-; NVPTX-DISABLED-NEXT:    [[TMP1:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]]
-; NVPTX-DISABLED-NEXT:    [[TMP2:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8**
-; NVPTX-DISABLED-NEXT:    call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__3 to i8*), i8* @__omp_outlined__3_wrapper.ID, i8** [[TMP2]], i64 0)
+; NVPTX-DISABLED-NEXT:    [[TMP0:%.*]] = load i32, i32* [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]]
+; NVPTX-DISABLED-NEXT:    [[TMP1:%.*]] = bitcast [0 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8**
+; NVPTX-DISABLED-NEXT:    call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*)* @__omp_outlined__3 to i8*), i8* @__omp_outlined__3_wrapper.ID, i8** [[TMP1]], i64 0)
 ; NVPTX-DISABLED-NEXT:    [[INC]] = add nsw i32 [[I_0]], 1
 ; NVPTX-DISABLED-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]]
 ;
@@ -2423,7 +2423,7 @@
 ; AMDGPU: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind allocsize(0) }
 ; AMDGPU: attributes #[[ATTR7]] = { convergent "llvm.assume"="ompx_spmd_amenable" }
 ; AMDGPU: attributes #[[ATTR8]] = { convergent }
-; AMDGPU: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; AMDGPU: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; AMDGPU: attributes #[[ATTR10:[0-9]+]] = { alwaysinline }
 ; AMDGPU: attributes #[[ATTR11:[0-9]+]] = { convergent nounwind }
 ;.
@@ -2436,7 +2436,7 @@
 ; NVPTX: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind allocsize(0) }
 ; NVPTX: attributes #[[ATTR7]] = { convergent "llvm.assume"="ompx_spmd_amenable" }
 ; NVPTX: attributes #[[ATTR8]] = { convergent }
-; NVPTX: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; NVPTX: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; NVPTX: attributes #[[ATTR10:[0-9]+]] = { alwaysinline }
 ; NVPTX: attributes #[[ATTR11:[0-9]+]] = { convergent nounwind }
 ;.
@@ -2449,7 +2449,7 @@
 ; AMDGPU-DISABLED: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind allocsize(0) }
 ; AMDGPU-DISABLED: attributes #[[ATTR7]] = { convergent "llvm.assume"="ompx_spmd_amenable" }
 ; AMDGPU-DISABLED: attributes #[[ATTR8]] = { convergent }
-; AMDGPU-DISABLED: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; AMDGPU-DISABLED: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; AMDGPU-DISABLED: attributes #[[ATTR10:[0-9]+]] = { alwaysinline }
 ; AMDGPU-DISABLED: attributes #[[ATTR11:[0-9]+]] = { convergent nounwind }
 ;.
@@ -2462,7 +2462,7 @@
 ; NVPTX-DISABLED: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind allocsize(0) }
 ; NVPTX-DISABLED: attributes #[[ATTR7]] = { convergent "llvm.assume"="ompx_spmd_amenable" }
 ; NVPTX-DISABLED: attributes #[[ATTR8]] = { convergent }
-; NVPTX-DISABLED: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; NVPTX-DISABLED: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; NVPTX-DISABLED: attributes #[[ATTR10:[0-9]+]] = { alwaysinline }
 ; NVPTX-DISABLED: attributes #[[ATTR11:[0-9]+]] = { convergent nounwind }
 ;.
Index: llvm/test/Transforms/OpenMP/replace_globalization.ll
===================================================================
--- llvm/test/Transforms/OpenMP/replace_globalization.ll
+++ llvm/test/Transforms/OpenMP/replace_globalization.ll
@@ -216,7 +216,7 @@
 ; CHECK: attributes #[[ATTR1]] = { nofree norecurse nounwind writeonly }
 ; CHECK: attributes #[[ATTR2]] = { nosync nounwind readonly allocsize(0) }
 ; CHECK: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind }
-; CHECK: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; CHECK: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; CHECK: attributes #[[ATTR5:[0-9]+]] = { "llvm.assume"="omp_no_openmp" }
 ; CHECK: attributes #[[ATTR6]] = { nounwind readonly }
 ; CHECK: attributes #[[ATTR7]] = { nounwind writeonly }
Index: llvm/test/Transforms/ObjCARC/nested.ll
===================================================================
--- llvm/test/Transforms/ObjCARC/nested.ll
+++ llvm/test/Transforms/ObjCARC/nested.ll
@@ -821,5 +821,5 @@
 
 
 ; CHECK: attributes [[NUW]] = { nounwind }
-; CHECK: attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; CHECK: attributes #1 = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; CHECK: attributes #2 = { nonlazybind }
Index: llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
===================================================================
--- llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
+++ llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
@@ -105,7 +105,7 @@
 declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
 
 ; CHECK: attributes #0 = { ssp uwtable }
-; CHECK: attributes #1 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; CHECK: attributes #1 = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; CHECK: attributes #2 = { nonlazybind }
 ; CHECK: attributes [[NUW]] = { nounwind }
 ; CHECK: attributes #4 = { noinline ssp uwtable }
Index: llvm/test/Transforms/ObjCARC/basic.ll
===================================================================
--- llvm/test/Transforms/ObjCARC/basic.ll
+++ llvm/test/Transforms/ObjCARC/basic.ll
@@ -3074,5 +3074,5 @@
 !5 = !{i32 2, !"Debug Info Version", i32 3}
 
 ; CHECK: attributes [[NUW]] = { nounwind }
-; CHECK: attributes #1 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; CHECK: attributes #1 = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; CHECK: ![[RELEASE]] = !{}
Index: llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll
===================================================================
--- llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll
+++ llvm/test/Transforms/LowerMatrixIntrinsics/strided-store-double.ll
@@ -85,4 +85,4 @@
 
 ; CHECK: declare void @llvm.matrix.column.major.store.v6f64.i64(<6 x double>, double* nocapture writeonly, i64, i1 immarg, i32 immarg, i32 immarg) #0
 ; CHECK: declare void @llvm.matrix.column.major.store.v10f64.i64(<10 x double>, double* nocapture writeonly, i64, i1 immarg, i32 immarg, i32 immarg) #0
-; CHECK: attributes #0 = { argmemonly nocallback nofree nosync nounwind willreturn writeonly }
+; CHECK: attributes #0 = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn writeonly }
Index: llvm/test/Transforms/InstCombine/AArch64/2012-04-23-Neon-Intrinsics.ll
===================================================================
--- llvm/test/Transforms/InstCombine/AArch64/2012-04-23-Neon-Intrinsics.ll
+++ llvm/test/Transforms/InstCombine/AArch64/2012-04-23-Neon-Intrinsics.ll
@@ -66,5 +66,5 @@
 declare <4 x i32> @llvm.aarch64.neon.umull.v4i32(<4 x i16>, <4 x i16>) nounwind readnone
 
 ; CHECK: attributes #0 = { nounwind readnone ssp }
-; CHECK: attributes #1 = { nocallback nofree nosync nounwind readnone willreturn }
+; CHECK: attributes #1 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
 ; CHECK: attributes [[NUW]] = { nounwind }
Index: llvm/test/Transforms/Inline/inline_invoke.ll
===================================================================
--- llvm/test/Transforms/Inline/inline_invoke.ll
+++ llvm/test/Transforms/Inline/inline_invoke.ll
@@ -345,5 +345,5 @@
 ; CHECK: attributes [[NUW]] = { nounwind }
 ; CHECK: attributes #1 = { nounwind readnone }
 ; CHECK: attributes #2 = { ssp uwtable }
-; CHECK: attributes #3 = { argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #3 = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #4 = { noreturn nounwind }
Index: llvm/test/Transforms/GlobalOpt/pr54572.ll
===================================================================
--- llvm/test/Transforms/GlobalOpt/pr54572.ll
+++ llvm/test/Transforms/GlobalOpt/pr54572.ll
@@ -19,5 +19,5 @@
   ret void
 }
 ;.
-; CHECK: attributes #[[ATTR0:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
 ;.
Index: llvm/test/Transforms/GlobalOpt/ctor-memset.ll
===================================================================
--- llvm/test/Transforms/GlobalOpt/ctor-memset.ll
+++ llvm/test/Transforms/GlobalOpt/ctor-memset.ll
@@ -115,5 +115,5 @@
 
 declare void @llvm.memset.p0.i64(ptr, i8, i64, i1)
 ;.
-; CHECK: attributes #[[ATTR0:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ;.
Index: llvm/test/Transforms/DeadArgElim/keepalive.ll
===================================================================
--- llvm/test/Transforms/DeadArgElim/keepalive.ll
+++ llvm/test/Transforms/DeadArgElim/keepalive.ll
@@ -79,5 +79,5 @@
   ret i32 %v
 }
 
-; CHECK: attributes #0 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #0 = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #1 = { nounwind }
Index: llvm/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
===================================================================
--- llvm/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
+++ llvm/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
@@ -45,7 +45,7 @@
 declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
 
 ; CHECK: attributes #0 = { nounwind ssp }
-; CHECK: attributes #1 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; CHECK: attributes #1 = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; CHECK: attributes #2 = { noinline nounwind ssp }
 ; CHECK: attributes [[NUW]] = { nounwind }
 
Index: llvm/test/Transforms/Attributor/willreturn.ll
===================================================================
--- llvm/test/Transforms/Attributor/willreturn.ll
+++ llvm/test/Transforms/Attributor/willreturn.ll
@@ -342,7 +342,7 @@
 
 ; TEST 6 (positive case)
 ; Call intrinsic function
-; CHECK: Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
+; CHECK: Function Attrs: nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn
 ; CHECK-NEXT: declare float @llvm.floor.f32(float)
 declare float @llvm.floor.f32(float)
 
@@ -1653,7 +1653,7 @@
 ; IS__TUNIT_OPM: attributes #[[ATTR5]] = { noreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable }
 ; IS__TUNIT_OPM: attributes #[[ATTR7]] = { noinline nounwind uwtable }
-; IS__TUNIT_OPM: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__TUNIT_OPM: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR9:[0-9]+]] = { norecurse willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR10]] = { noinline nounwind willreturn uwtable }
 ; IS__TUNIT_OPM: attributes #[[ATTR11:[0-9]+]] = { noinline willreturn uwtable }
@@ -1683,7 +1683,7 @@
 ; IS__TUNIT_NPM: attributes #[[ATTR5]] = { noreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable }
 ; IS__TUNIT_NPM: attributes #[[ATTR7]] = { noinline nounwind uwtable }
-; IS__TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR9:[0-9]+]] = { norecurse willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR10]] = { noinline nounwind willreturn uwtable }
 ; IS__TUNIT_NPM: attributes #[[ATTR11:[0-9]+]] = { noinline willreturn uwtable }
@@ -1715,7 +1715,7 @@
 ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { noreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable }
 ; IS__CGSCC_OPM: attributes #[[ATTR7]] = { noinline nounwind uwtable }
-; IS__CGSCC_OPM: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR9:[0-9]+]] = { norecurse willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR10]] = { noinline nounwind willreturn uwtable }
 ; IS__CGSCC_OPM: attributes #[[ATTR11:[0-9]+]] = { noinline willreturn uwtable }
@@ -1746,7 +1746,7 @@
 ; IS__CGSCC_NPM: attributes #[[ATTR5]] = { noreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable }
 ; IS__CGSCC_NPM: attributes #[[ATTR7]] = { noinline nounwind uwtable }
-; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { norecurse willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR10]] = { noinline nounwind willreturn uwtable }
 ; IS__CGSCC_NPM: attributes #[[ATTR11:[0-9]+]] = { noinline willreturn uwtable }
Index: llvm/test/Transforms/Attributor/value-simplify.ll
===================================================================
--- llvm/test/Transforms/Attributor/value-simplify.ll
+++ llvm/test/Transforms/Attributor/value-simplify.ll
@@ -1693,7 +1693,7 @@
 
 
 ;.
-; IS__TUNIT_OPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT_OPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
@@ -1702,14 +1702,14 @@
 ; IS__TUNIT_OPM: attributes #[[ATTR6:[0-9]+]] = { readnone speculatable }
 ; IS__TUNIT_OPM: attributes #[[ATTR7]] = { norecurse nosync readnone }
 ; IS__TUNIT_OPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
-; IS__TUNIT_OPM: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
+; IS__TUNIT_OPM: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR10]] = { nofree nosync nounwind readnone willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR11]] = { willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR14]] = { nosync nounwind readonly }
 ;.
-; IS__TUNIT_NPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT_NPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
@@ -1717,14 +1717,14 @@
 ; IS__TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { readnone speculatable }
 ; IS__TUNIT_NPM: attributes #[[ATTR6]] = { norecurse nosync readnone }
 ; IS__TUNIT_NPM: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
-; IS__TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
+; IS__TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR10]] = { willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR13]] = { nosync nounwind readonly }
 ;.
-; IS__CGSCC_OPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
@@ -1736,14 +1736,14 @@
 ; IS__CGSCC_OPM: attributes #[[ATTR9:[0-9]+]] = { readnone speculatable }
 ; IS__CGSCC_OPM: attributes #[[ATTR10]] = { norecurse nosync readnone }
 ; IS__CGSCC_OPM: attributes #[[ATTR11]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readnone willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR14]] = { willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nounwind willreturn writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR16]] = { nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR17]] = { readonly }
 ;.
-; IS__CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
@@ -1754,7 +1754,7 @@
 ; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { readnone speculatable }
 ; IS__CGSCC_NPM: attributes #[[ATTR9]] = { norecurse nosync readnone }
 ; IS__CGSCC_NPM: attributes #[[ATTR10]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR11:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR11:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR12]] = { readnone willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR13]] = { willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR14]] = { nounwind willreturn writeonly }
Index: llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
===================================================================
--- llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+++ llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
@@ -4626,7 +4626,7 @@
 ;.
 ; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn }
-; IS__TUNIT_OPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT_OPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind }
 ; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn }
@@ -4640,7 +4640,7 @@
 ; IS__TUNIT_OPM: attributes #[[ATTR13]] = { argmemonly nofree norecurse nosync nounwind }
 ; IS__TUNIT_OPM: attributes #[[ATTR14]] = { argmemonly nofree nosync nounwind }
 ; IS__TUNIT_OPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone }
-; IS__TUNIT_OPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__TUNIT_OPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR17]] = { willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR18]] = { nofree nosync nounwind willreturn writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR19]] = { nofree nosync nounwind writeonly }
@@ -4652,7 +4652,7 @@
 ;.
 ; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind willreturn }
-; IS__TUNIT_NPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT_NPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn writeonly }
@@ -4664,7 +4664,7 @@
 ; IS__TUNIT_NPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind willreturn uwtable }
 ; IS__TUNIT_NPM: attributes #[[ATTR12]] = { argmemonly nofree nosync nounwind }
 ; IS__TUNIT_NPM: attributes #[[ATTR13]] = { nofree norecurse nosync nounwind readnone }
-; IS__TUNIT_NPM: attributes #[[ATTR14:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__TUNIT_NPM: attributes #[[ATTR14:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR15]] = { willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR16]] = { nofree nosync nounwind willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR17]] = { nocallback }
@@ -4675,7 +4675,7 @@
 ;.
 ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind }
 ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn }
@@ -4693,7 +4693,7 @@
 ; IS__CGSCC_OPM: attributes #[[ATTR17]] = { nofree nosync nounwind readnone }
 ; IS__CGSCC_OPM: attributes #[[ATTR18]] = { nofree nosync nounwind readnone willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR19]] = { argmemonly nofree norecurse nosync nounwind willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR20:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__CGSCC_OPM: attributes #[[ATTR20:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR21]] = { willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR22]] = { nounwind willreturn writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR23]] = { nounwind writeonly }
@@ -4704,7 +4704,7 @@
 ;.
 ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn }
@@ -4719,7 +4719,7 @@
 ; IS__CGSCC_NPM: attributes #[[ATTR14]] = { argmemonly nofree nosync nounwind }
 ; IS__CGSCC_NPM: attributes #[[ATTR15]] = { nofree nosync nounwind readnone }
 ; IS__CGSCC_NPM: attributes #[[ATTR16]] = { nofree nosync nounwind readnone willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__CGSCC_NPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR18]] = { willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR19]] = { nounwind willreturn writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR20]] = { nocallback }
Index: llvm/test/Transforms/Attributor/value-simplify-assume.ll
===================================================================
--- llvm/test/Transforms/Attributor/value-simplify-assume.ll
+++ llvm/test/Transforms/Attributor/value-simplify-assume.ll
@@ -1365,14 +1365,14 @@
 }
 
 ;.
-; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
 ; IS__TUNIT____: attributes #[[ATTR2]] = { norecurse }
 ; IS__TUNIT____: attributes #[[ATTR3]] = { inaccessiblememonly nofree norecurse nosync nounwind willreturn }
 ; IS__TUNIT____: attributes #[[ATTR4]] = { willreturn }
 ; IS__TUNIT____: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn }
 ;.
-; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
 ; IS__CGSCC____: attributes #[[ATTR2]] = { norecurse }
 ; IS__CGSCC____: attributes #[[ATTR3]] = { inaccessiblememonly nofree norecurse nosync nounwind willreturn }
Index: llvm/test/Transforms/Attributor/readattrs.ll
===================================================================
--- llvm/test/Transforms/Attributor/readattrs.ll
+++ llvm/test/Transforms/Attributor/readattrs.ll
@@ -426,8 +426,8 @@
 ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__TUNIT____: attributes #[[ATTR2]] = { readonly }
 ; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
-; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind willreturn writeonly }
-; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree nosync nounwind readonly willreturn }
+; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind willreturn writeonly }
+; IS__TUNIT____: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readonly willreturn }
 ; IS__TUNIT____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind readonly willreturn }
 ; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nounwind readonly }
 ; IS__TUNIT____: attributes #[[ATTR8]] = { argmemonly nounwind }
@@ -444,8 +444,8 @@
 ; IS__CGSCC____: attributes #[[ATTR2]] = { readonly }
 ; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC____: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly }
-; IS__CGSCC____: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree nosync nounwind willreturn writeonly }
-; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind readonly willreturn }
+; IS__CGSCC____: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind willreturn writeonly }
+; IS__CGSCC____: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readonly willreturn }
 ; IS__CGSCC____: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn }
 ; IS__CGSCC____: attributes #[[ATTR8]] = { argmemonly nounwind readonly }
 ; IS__CGSCC____: attributes #[[ATTR9]] = { argmemonly nounwind }
Index: llvm/test/Transforms/Attributor/openmp_parallel.ll
===================================================================
--- llvm/test/Transforms/Attributor/openmp_parallel.ll
+++ llvm/test/Transforms/Attributor/openmp_parallel.ll
@@ -395,7 +395,7 @@
 ;.
 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind uwtable }
 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { alwaysinline nofree norecurse nounwind uwtable }
-; CHECK: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ;.
 ; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50}
 ; CHECK: [[META1:![0-9]+]] = !{!2}
Index: llvm/test/Transforms/Attributor/nosync.ll
===================================================================
--- llvm/test/Transforms/Attributor/nosync.ll
+++ llvm/test/Transforms/Attributor/nosync.ll
@@ -486,9 +486,9 @@
 ; NOT_CGSCC_OPM: attributes #[[ATTR13]] = { readnone }
 ; NOT_CGSCC_OPM: attributes #[[ATTR14]] = { nounwind }
 ; NOT_CGSCC_OPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn }
-; NOT_CGSCC_OPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
-; NOT_CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
-; NOT_CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; NOT_CGSCC_OPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
+; NOT_CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
+; NOT_CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; NOT_CGSCC_OPM: attributes #[[ATTR19]] = { nofree nounwind }
 ; NOT_CGSCC_OPM: attributes #[[ATTR20]] = { willreturn }
 ; NOT_CGSCC_OPM: attributes #[[ATTR21]] = { willreturn writeonly }
@@ -510,9 +510,9 @@
 ; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readnone }
 ; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nounwind }
 ; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind readnone willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
-; IS__CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR16:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR17:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
+; IS__CGSCC_OPM: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR19]] = { nofree nounwind }
 ; IS__CGSCC_OPM: attributes #[[ATTR20]] = { nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR21]] = { willreturn }
Index: llvm/test/Transforms/Attributor/norecurse.ll
===================================================================
--- llvm/test/Transforms/Attributor/norecurse.ll
+++ llvm/test/Transforms/Attributor/norecurse.ll
@@ -314,7 +314,7 @@
 ; CHECK: attributes #[[ATTR2]] = { nosync readnone }
 ; CHECK: attributes #[[ATTR3:[0-9]+]] = { readnone }
 ; CHECK: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn }
-; CHECK: attributes #[[ATTR5:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
+; CHECK: attributes #[[ATTR5:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
 ; CHECK: attributes #[[ATTR6]] = { norecurse nosync readnone }
 ; CHECK: attributes #[[ATTR7]] = { null_pointer_is_valid }
 ; CHECK: attributes #[[ATTR8:[0-9]+]] = { norecurse }
Index: llvm/test/Transforms/Attributor/nonnull.ll
===================================================================
--- llvm/test/Transforms/Attributor/nonnull.ll
+++ llvm/test/Transforms/Attributor/nonnull.ll
@@ -1618,7 +1618,7 @@
 attributes #0 = { null_pointer_is_valid }
 attributes #1 = { nounwind willreturn}
 ;.
-; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__TUNIT____: attributes #[[ATTR2]] = { inaccessiblememonly nofree norecurse nosync nounwind willreturn }
 ; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn }
@@ -1635,7 +1635,7 @@
 ; IS__TUNIT____: attributes #[[ATTR14]] = { nofree nosync nounwind readonly }
 ; IS__TUNIT____: attributes #[[ATTR15]] = { readonly willreturn }
 ;.
-; IS__CGSCC_OPM: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { inaccessiblememonly nofree norecurse nosync nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn }
@@ -1653,7 +1653,7 @@
 ; IS__CGSCC_OPM: attributes #[[ATTR15]] = { readonly willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR16]] = { readnone willreturn }
 ;.
-; IS__CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { inaccessiblememonly nofree norecurse nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { noreturn }
Index: llvm/test/Transforms/Attributor/nofree.ll
===================================================================
--- llvm/test/Transforms/Attributor/nofree.ll
+++ llvm/test/Transforms/Attributor/nofree.ll
@@ -242,7 +242,7 @@
 
 ; TEST 10 (positive case)
 ; Call intrinsic function
-; CHECK: Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
+; CHECK: Function Attrs: nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn
 ; CHECK-NEXT: declare float @llvm.floor.f32(float)
 declare float @llvm.floor.f32(float)
 
@@ -445,10 +445,10 @@
 ; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone willreturn uwtable }
 ; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree noinline nosync nounwind readnone willreturn uwtable }
 ; NOT_CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind readnone uwtable }
-; NOT_CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; NOT_CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree nounwind }
 ; NOT_CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind }
-; NOT_CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; NOT_CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { readnone willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR12]] = { willreturn }
@@ -459,10 +459,10 @@
 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree noinline norecurse nosync nounwind readnone willreturn uwtable }
 ; IS__CGSCC_NPM: attributes #[[ATTR4:[0-9]+]] = { nofree noinline nounwind readnone uwtable }
 ; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree noinline nosync nounwind readnone willreturn uwtable }
-; IS__CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree nounwind }
 ; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind }
-; IS__CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR11]] = { readnone willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR12]] = { willreturn }
Index: llvm/test/Transforms/Attributor/nocapture-1.ll
===================================================================
--- llvm/test/Transforms/Attributor/nocapture-1.ll
+++ llvm/test/Transforms/Attributor/nocapture-1.ll
@@ -901,8 +901,8 @@
 ; IS__TUNIT____: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn }
 ; IS__TUNIT____: attributes #[[ATTR10:[0-9]+]] = { nounwind readonly willreturn }
 ; IS__TUNIT____: attributes #[[ATTR11]] = { nounwind willreturn }
-; IS__TUNIT____: attributes #[[ATTR12:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind speculatable willreturn }
-; IS__TUNIT____: attributes #[[ATTR13:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__TUNIT____: attributes #[[ATTR12:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind speculatable willreturn }
+; IS__TUNIT____: attributes #[[ATTR13:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__TUNIT____: attributes #[[ATTR14]] = { nofree nosync nounwind willreturn writeonly }
 ; IS__TUNIT____: attributes #[[ATTR15]] = { nofree nounwind readnone willreturn }
 ; IS__TUNIT____: attributes #[[ATTR16]] = { nofree nosync nounwind willreturn }
@@ -925,8 +925,8 @@
 ; IS__CGSCC____: attributes #[[ATTR12]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn }
 ; IS__CGSCC____: attributes #[[ATTR13:[0-9]+]] = { nounwind readonly willreturn }
 ; IS__CGSCC____: attributes #[[ATTR14]] = { nounwind willreturn }
-; IS__CGSCC____: attributes #[[ATTR15:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind speculatable willreturn }
-; IS__CGSCC____: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__CGSCC____: attributes #[[ATTR15:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind speculatable willreturn }
+; IS__CGSCC____: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__CGSCC____: attributes #[[ATTR17]] = { nounwind willreturn writeonly }
 ; IS__CGSCC____: attributes #[[ATTR18]] = { readnone willreturn }
 ; IS__CGSCC____: attributes #[[ATTR19]] = { nounwind }
Index: llvm/test/Transforms/Attributor/noalias.ll
===================================================================
--- llvm/test/Transforms/Attributor/noalias.ll
+++ llvm/test/Transforms/Attributor/noalias.ll
@@ -968,7 +968,7 @@
 ; NOT_CGSCC_NPM: attributes #[[ATTR3]] = { nounwind ssp uwtable }
 ; NOT_CGSCC_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind readonly willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
-; NOT_CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; NOT_CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn writeonly }
 ; NOT_CGSCC_NPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn }
@@ -983,7 +983,7 @@
 ; IS__CGSCC____: attributes #[[ATTR4]] = { nounwind ssp uwtable }
 ; IS__CGSCC____: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn }
 ; IS__CGSCC____: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
-; IS__CGSCC____: attributes #[[ATTR7:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC____: attributes #[[ATTR7:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC____: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC____: attributes #[[ATTR9]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC____: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn writeonly }
Index: llvm/test/Transforms/Attributor/memory_locations.ll
===================================================================
--- llvm/test/Transforms/Attributor/memory_locations.ll
+++ llvm/test/Transforms/Attributor/memory_locations.ll
@@ -715,7 +715,7 @@
 ; IS__TUNIT____: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly }
 ; IS__TUNIT____: attributes #[[ATTR2]] = { readnone }
 ; IS__TUNIT____: attributes #[[ATTR3]] = { argmemonly }
-; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__TUNIT____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
@@ -728,7 +728,7 @@
 ; IS__CGSCC____: attributes #[[ATTR1]] = { inaccessiblemem_or_argmemonly }
 ; IS__CGSCC____: attributes #[[ATTR2]] = { readnone }
 ; IS__CGSCC____: attributes #[[ATTR3]] = { argmemonly }
-; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC____: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC____: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
Index: llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll
===================================================================
--- llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll
+++ llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll
@@ -226,12 +226,12 @@
 declare void @llvm.experimental.guard(i1, ...)
 ;.
 ; IS________OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone }
-; IS________OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS________OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS________OPM: attributes #[[ATTR2]] = { nounwind }
-; IS________OPM: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync willreturn }
+; IS________OPM: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree noread_thread_id nosync willreturn }
 ;.
 ; IS________NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
-; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS________NPM: attributes #[[ATTR2]] = { nounwind }
-; IS________NPM: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync willreturn }
+; IS________NPM: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree noread_thread_id nosync willreturn }
 ;.
Index: llvm/test/Transforms/Attributor/lowerheap.ll
===================================================================
--- llvm/test/Transforms/Attributor/lowerheap.ll
+++ llvm/test/Transforms/Attributor/lowerheap.ll
@@ -71,6 +71,6 @@
 ; IS________NPM: attributes #[[ATTR1:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc" }
 ; IS________NPM: attributes #[[ATTR2:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" }
 ; IS________NPM: attributes #[[ATTR3:[0-9]+]] = { allockind("free") "alloc-family"="malloc" }
-; IS________NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS________NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS________NPM: attributes #[[ATTR5]] = { nounwind }
 ;.
Index: llvm/test/Transforms/Attributor/liveness.ll
===================================================================
--- llvm/test/Transforms/Attributor/liveness.ll
+++ llvm/test/Transforms/Attributor/liveness.ll
@@ -2663,7 +2663,7 @@
 ; NOT_CGSCC_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readnone willreturn }
-; NOT_CGSCC_NPM: attributes #[[ATTR12:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; NOT_CGSCC_NPM: attributes #[[ATTR12:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR13]] = { nounwind willreturn }
 ; NOT_CGSCC_NPM: attributes #[[ATTR14]] = { willreturn }
 ;.
@@ -2681,7 +2681,7 @@
 ; IS__CGSCC____: attributes #[[ATTR11]] = { nofree nosync nounwind readnone willreturn }
 ; IS__CGSCC____: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn }
 ; IS__CGSCC____: attributes #[[ATTR13]] = { nounwind readonly }
-; IS__CGSCC____: attributes #[[ATTR14:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC____: attributes #[[ATTR14:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC____: attributes #[[ATTR15]] = { nounwind willreturn }
 ; IS__CGSCC____: attributes #[[ATTR16]] = { readnone willreturn }
 ; IS__CGSCC____: attributes #[[ATTR17]] = { willreturn }
Index: llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
===================================================================
--- llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
+++ llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
@@ -739,7 +739,7 @@
 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { nofree nosync willreturn }
 ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind }
 ; CHECK: attributes #[[ATTR3]] = { noreturn }
-; CHECK: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #[[ATTR5]] = { nounwind }
 ; CHECK: attributes #[[ATTR6]] = { nosync nounwind willreturn }
 ;.
Index: llvm/test/Transforms/Attributor/heap_to_stack.ll
===================================================================
--- llvm/test/Transforms/Attributor/heap_to_stack.ll
+++ llvm/test/Transforms/Attributor/heap_to_stack.ll
@@ -831,7 +831,7 @@
 ; IS________OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nounwind }
 ; IS________OPM: attributes #[[ATTR4]] = { noreturn }
 ; IS________OPM: attributes #[[ATTR5:[0-9]+]] = { allockind("free") }
-; IS________OPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS________OPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS________OPM: attributes #[[ATTR7:[0-9]+]] = { allockind("alloc,uninitialized,aligned") allocsize(1) }
 ; IS________OPM: attributes #[[ATTR8:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) }
 ; IS________OPM: attributes #[[ATTR9]] = { nounwind }
@@ -842,9 +842,9 @@
 ; IS________NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nounwind }
 ; IS________NPM: attributes #[[ATTR4]] = { noreturn }
 ; IS________NPM: attributes #[[ATTR5:[0-9]+]] = { allockind("free") }
-; IS________NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nocallback nofree nosync nounwind willreturn }
+; IS________NPM: attributes #[[ATTR6:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS________NPM: attributes #[[ATTR7:[0-9]+]] = { allockind("alloc,uninitialized,aligned") allocsize(1) }
 ; IS________NPM: attributes #[[ATTR8:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) }
-; IS________NPM: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS________NPM: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS________NPM: attributes #[[ATTR10]] = { nounwind }
 ;.
Index: llvm/test/Transforms/Attributor/dereferenceable-1.ll
===================================================================
--- llvm/test/Transforms/Attributor/dereferenceable-1.ll
+++ llvm/test/Transforms/Attributor/dereferenceable-1.ll
@@ -973,7 +973,7 @@
 ; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind }
 ; IS__TUNIT_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind writeonly }
-; IS__TUNIT_OPM: attributes #[[ATTR6:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT_OPM: attributes #[[ATTR6:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR8]] = { willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR9]] = { nounwind }
@@ -983,7 +983,7 @@
 ; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly }
-; IS__TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR8]] = { willreturn }
@@ -995,7 +995,7 @@
 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind }
 ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind writeonly }
-; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nounwind writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR9]] = { willreturn }
@@ -1006,7 +1006,7 @@
 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly }
-; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nocallback nofree nosync nounwind willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR8]] = { willreturn }
Index: llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll
===================================================================
--- llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll
+++ llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll
@@ -55,10 +55,10 @@
 !6 = !DILocation(line: 1, column: 1, scope: !3)
 ;.
 ; NOT_CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
-; NOT_CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; NOT_CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ;.
 ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { readnone willreturn }
 ;.
 ; IS__TUNIT____: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
Index: llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
===================================================================
--- llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
+++ llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
@@ -64,6 +64,6 @@
 declare i8* @llvm.stacksave()
 declare void @llvm.stackrestore(i8*)
 ;.
-; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { willreturn }
 ;.
Index: llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
===================================================================
--- llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
+++ llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
@@ -767,7 +767,7 @@
 ; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" }
 ; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" }
 ; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" }
-; IS__TUNIT_OPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__TUNIT_OPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR6]] = { willreturn writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn }
 ;.
@@ -775,7 +775,7 @@
 ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" }
 ; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" }
 ; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" }
-; IS__TUNIT_NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__TUNIT_NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR5]] = { willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn }
 ;.
@@ -784,7 +784,7 @@
 ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" }
 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" }
 ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" }
-; IS__CGSCC_OPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__CGSCC_OPM: attributes #[[ATTR5:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR6]] = { willreturn writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nounwind willreturn }
 ;.
@@ -792,7 +792,7 @@
 ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" }
 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" }
 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" }
-; IS__CGSCC_NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__CGSCC_NPM: attributes #[[ATTR4:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR5]] = { willreturn writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn }
 ;.
Index: llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
===================================================================
--- llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
+++ llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
@@ -195,13 +195,13 @@
 ;.
 ; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "target-features"="+avx2" }
 ; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree norecurse nosync nounwind willreturn uwtable }
-; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { willreturn writeonly }
 ; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind willreturn }
 ;.
 ; IS__CGSCC____: attributes #[[ATTR0:[0-9]+]] = { argmemonly inlinehint nofree norecurse nosync nounwind willreturn uwtable "target-features"="+avx2" }
 ; IS__CGSCC____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn uwtable }
-; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn writeonly }
+; IS__CGSCC____: attributes #[[ATTR2:[0-9]+]] = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
 ; IS__CGSCC____: attributes #[[ATTR3:[0-9]+]] = { willreturn writeonly }
 ; IS__CGSCC____: attributes #[[ATTR4:[0-9]+]] = { nounwind willreturn }
 ;.
Index: llvm/test/Other/invariant.group.ll
===================================================================
--- llvm/test/Other/invariant.group.ll
+++ llvm/test/Other/invariant.group.ll
@@ -91,11 +91,11 @@
 declare void @useBool(i1)
 
 declare void @clobber(i8*)
-; CHECK: Function Attrs: inaccessiblememonly nocallback nofree nosync nounwind speculatable willreturn{{$}}
+; CHECK: Function Attrs: inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind speculatable willreturn{{$}}
 ; CHECK-NEXT: declare i8* @llvm.launder.invariant.group.p0i8(i8*)
 declare i8* @llvm.launder.invariant.group.p0i8(i8*)
 
-; CHECK: Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn{{$}}
+; CHECK: Function Attrs: nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn{{$}}
 ; CHECK-NEXT: declare i8* @llvm.strip.invariant.group.p0i8(i8*)
 declare i8* @llvm.strip.invariant.group.p0i8(i8*)
 
Index: llvm/test/Instrumentation/MemorySanitizer/attributes.ll
===================================================================
--- llvm/test/Instrumentation/MemorySanitizer/attributes.ll
+++ llvm/test/Instrumentation/MemorySanitizer/attributes.ll
@@ -50,5 +50,5 @@
 ; CHECK-NOT: argmemonly
 ; CHECK-NOT: speculatable
 
-; CHECK: Function Attrs: nocallback nofree nosync nounwind readnone willreturn
+; CHECK: Function Attrs: nocallback nofree noread_thread_id nosync nounwind readnone willreturn
 ; CHECK-NEXT: declare void @llvm.donothing
Index: llvm/test/Feature/intrinsics.ll
===================================================================
--- llvm/test/Feature/intrinsics.ll
+++ llvm/test/Feature/intrinsics.ll
@@ -69,5 +69,5 @@
   ret void
 }
 
-; CHECK: attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; CHECK: attributes #0 = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 ; CHECK: attributes #1 = { cold noreturn nounwind }
Index: llvm/test/Bitcode/upgrade-invariant-group-barrier.ll
===================================================================
--- llvm/test/Bitcode/upgrade-invariant-group-barrier.ll
+++ llvm/test/Bitcode/upgrade-invariant-group-barrier.ll
@@ -13,9 +13,9 @@
   ret void
 }
 
-; CHECK: Function Attrs: inaccessiblememonly nocallback nofree nosync nounwind speculatable willreturn
+; CHECK: Function Attrs: inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind speculatable willreturn
 ; CHECK: declare i8* @llvm.launder.invariant.group.p0i8(i8*)
-; CHECK: Function Attrs: inaccessiblememonly nocallback nofree nosync nounwind speculatable willreturn
+; CHECK: Function Attrs: inaccessiblememonly nocallback nofree noread_thread_id nosync nounwind speculatable willreturn
 ; CHECK: declare i16* @llvm.launder.invariant.group.p0i16(i16*)
 declare i8* @llvm.invariant.group.barrier(i8*)
 declare i8* @llvm.invariant.group.barrier.p0i8(i8*)
Index: llvm/test/Bitcode/compatibility.ll
===================================================================
--- llvm/test/Bitcode/compatibility.ll
+++ llvm/test/Bitcode/compatibility.ll
@@ -2001,12 +2001,12 @@
 ; CHECK: attributes #32 = { norecurse }
 ; CHECK: attributes #33 = { inaccessiblememonly }
 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
-; CHECK: attributes #35 = { nocallback nofree nosync nounwind readnone willreturn }
-; CHECK: attributes #36 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #35 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
+; CHECK: attributes #36 = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #37 = { argmemonly nounwind readonly }
 ; CHECK: attributes #38 = { argmemonly nounwind }
 ; CHECK: attributes #39 = { nounwind readonly }
-; CHECK: attributes #40 = { inaccessiblemem_or_argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #40 = { inaccessiblemem_or_argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #41 = { writeonly }
 ; CHECK: attributes #42 = { speculatable }
 ; CHECK: attributes #43 = { strictfp }
Index: llvm/test/Bitcode/compatibility-6.0.ll
===================================================================
--- llvm/test/Bitcode/compatibility-6.0.ll
+++ llvm/test/Bitcode/compatibility-6.0.ll
@@ -1676,14 +1676,14 @@
 ; CHECK: attributes #32 = { norecurse }
 ; CHECK: attributes #33 = { inaccessiblememonly }
 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
-; CHECK: attributes #35 = { nocallback nofree nosync nounwind readnone willreturn }
-; CHECK: attributes #36 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #35 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
+; CHECK: attributes #36 = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #37 = { argmemonly nounwind readonly }
 ; CHECK: attributes #38 = { argmemonly nounwind }
 ; CHECK: attributes #39 = { nounwind readonly }
 ; CHECK: attributes #40 = { writeonly }
 ; CHECK: attributes #41 = { speculatable }
-; CHECK: attributes #42 = { inaccessiblemem_or_argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #42 = { inaccessiblemem_or_argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #43 = { builtin }
 
 ;; Metadata
Index: llvm/test/Bitcode/compatibility-5.0.ll
===================================================================
--- llvm/test/Bitcode/compatibility-5.0.ll
+++ llvm/test/Bitcode/compatibility-5.0.ll
@@ -1665,14 +1665,14 @@
 ; CHECK: attributes #32 = { norecurse }
 ; CHECK: attributes #33 = { inaccessiblememonly }
 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
-; CHECK: attributes #35 = { nocallback nofree nosync nounwind readnone willreturn }
-; CHECK: attributes #36 = { nocallback nofree nosync  nounwind willreturn }
+; CHECK: attributes #35 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
+; CHECK: attributes #36 = { nocallback nofree noread_thread_id nosync  nounwind willreturn }
 ; CHECK: attributes #37 = { argmemonly nounwind readonly }
 ; CHECK: attributes #38 = { argmemonly nounwind }
 ; CHECK: attributes #39 = { nounwind readonly }
 ; CHECK: attributes #40 = { writeonly }
 ; CHECK: attributes #41 = { speculatable }
-; CHECK: attributes #42 = { inaccessiblemem_or_argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #42 = { inaccessiblemem_or_argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #43 = { builtin }
 
 ;; Metadata
Index: llvm/test/Bitcode/compatibility-4.0.ll
===================================================================
--- llvm/test/Bitcode/compatibility-4.0.ll
+++ llvm/test/Bitcode/compatibility-4.0.ll
@@ -1650,13 +1650,13 @@
 ; CHECK: attributes #32 = { norecurse }
 ; CHECK: attributes #33 = { inaccessiblememonly }
 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
-; CHECK: attributes #35 = { nocallback nofree nosync nounwind readnone willreturn }
-; CHECK: attributes #36 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #35 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
+; CHECK: attributes #36 = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #37 = { argmemonly nounwind readonly }
 ; CHECK: attributes #38 = { argmemonly nounwind }
 ; CHECK: attributes #39 = { nounwind readonly }
 ; CHECK: attributes #40 = { writeonly }
-; CHECK: attributes #41 = { inaccessiblemem_or_argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #41 = { inaccessiblemem_or_argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #42 = { builtin }
 
 ;; Metadata
Index: llvm/test/Bitcode/compatibility-3.9.ll
===================================================================
--- llvm/test/Bitcode/compatibility-3.9.ll
+++ llvm/test/Bitcode/compatibility-3.9.ll
@@ -1625,13 +1625,13 @@
 ; CHECK: attributes #32 = { norecurse }
 ; CHECK: attributes #33 = { inaccessiblememonly }
 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
-; CHECK: attributes #35 = { nocallback nofree nosync nounwind readnone willreturn }
-; CHECK: attributes #36 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #35 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
+; CHECK: attributes #36 = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #37 = { argmemonly nounwind readonly }
 ; CHECK: attributes #38 = { argmemonly nounwind }
 ; CHECK: attributes #39 = { nounwind readonly }
 ; CHECK: attributes #40 = { writeonly }
-; CHECK: attributes #41 = { inaccessiblemem_or_argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #41 = { inaccessiblemem_or_argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #42 = { builtin }
 
 ;; Metadata
Index: llvm/test/Bitcode/compatibility-3.8.ll
===================================================================
--- llvm/test/Bitcode/compatibility-3.8.ll
+++ llvm/test/Bitcode/compatibility-3.8.ll
@@ -1552,12 +1552,12 @@
 ; CHECK: attributes #32 = { norecurse }
 ; CHECK: attributes #33 = { inaccessiblememonly }
 ; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
-; CHECK: attributes #35 = { nocallback nofree nosync nounwind readnone willreturn }
-; CHECK: attributes #36 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #35 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
+; CHECK: attributes #36 = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #37 = { argmemonly nounwind readonly }
 ; CHECK: attributes #38 = { argmemonly nounwind }
 ; CHECK: attributes #39 = { nounwind readonly }
-; CHECK: attributes #40 = { inaccessiblemem_or_argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #40 = { inaccessiblemem_or_argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #41 = { builtin }
 
 ;; Metadata
Index: llvm/test/Bitcode/compatibility-3.7.ll
===================================================================
--- llvm/test/Bitcode/compatibility-3.7.ll
+++ llvm/test/Bitcode/compatibility-3.7.ll
@@ -1242,12 +1242,12 @@
 ; CHECK: attributes #29 = { "thunk" }
 ; CHECK: attributes #30 = { uwtable }
 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
-; CHECK: attributes #32 = { nocallback nofree nosync nounwind readnone willreturn }
-; CHECK: attributes #33 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #32 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
+; CHECK: attributes #33 = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #34 = { argmemonly nounwind readonly }
 ; CHECK: attributes #35 = { argmemonly nounwind }
 ; CHECK: attributes #36 = { nounwind readonly }
-; CHECK: attributes #37 = { inaccessiblemem_or_argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #37 = { inaccessiblemem_or_argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #38 = { builtin }
 
 ;; Metadata
Index: llvm/test/Bitcode/compatibility-3.6.ll
===================================================================
--- llvm/test/Bitcode/compatibility-3.6.ll
+++ llvm/test/Bitcode/compatibility-3.6.ll
@@ -1179,12 +1179,12 @@
 ; CHECK: attributes #26 = { sspstrong }
 ; CHECK: attributes #27 = { uwtable }
 ; CHECK: attributes #28 = { "cpu"="cortex-a8" }
-; CHECK: attributes #29 = { nocallback nofree nosync nounwind readnone willreturn }
-; CHECK: attributes #30 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #29 = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
+; CHECK: attributes #30 = { nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #31 = { argmemonly nounwind readonly }
 ; CHECK: attributes #32 = { argmemonly nounwind }
 ; CHECK: attributes #33 = { nounwind readonly }
-; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn }
 ; CHECK: attributes #35 = { builtin }
 
 ;; Metadata
Index: llvm/test/Bindings/llvm-c/debug_info.ll
===================================================================
--- llvm/test/Bindings/llvm-c/debug_info.ll
+++ llvm/test/Bindings/llvm-c/debug_info.ll
@@ -12,13 +12,13 @@
 ; CHECK-NEXT:   call void @llvm.dbg.value(metadata i64 0, metadata !41, metadata !DIExpression(DW_OP_constu, 0, DW_OP_stack_value)), !dbg !44
 ; CHECK-NEXT: }
 
-; CHECK:      ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
+; CHECK:      ; Function Attrs: nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn
 ; CHECK-NEXT: declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
 
-; CHECK:      ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
+; CHECK:      ; Function Attrs: nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn
 ; CHECK-NEXT: declare void @llvm.dbg.value(metadata, metadata, metadata) #0
 
-; CHECK:      attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+; CHECK:      attributes #0 = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
 
 ; CHECK:      !llvm.dbg.cu = !{!0}
 ; CHECK-NEXT: !FooType = !{!28}
Index: llvm/test/Assembler/aarch64-intrinsics-attributes.ll
===================================================================
--- llvm/test/Assembler/aarch64-intrinsics-attributes.ll
+++ llvm/test/Assembler/aarch64-intrinsics-attributes.ll
@@ -23,4 +23,4 @@
 declare <vscale x 4 x i32> @llvm.aarch64.sve.dup.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, i32)
 
 ; CHECK: attributes [[NOFREE_NOUNWIND_WILLRETURN]] = { nofree nounwind willreturn }
-; CHECK: attributes [[NO_CALLBACK_NOFREE_NOSYNC_NOUNWIND_READNONE_WILLRETURN]] = { nocallback nofree nosync nounwind readnone willreturn }
+; CHECK: attributes [[NO_CALLBACK_NOFREE_NOSYNC_NOUNWIND_READNONE_WILLRETURN]] = { nocallback nofree noread_thread_id nosync nounwind readnone willreturn }
Index: llvm/test/Analysis/TypeBasedAliasAnalysis/intrinsics.ll
===================================================================
--- llvm/test/Analysis/TypeBasedAliasAnalysis/intrinsics.ll
+++ llvm/test/Analysis/TypeBasedAliasAnalysis/intrinsics.ll
@@ -22,8 +22,8 @@
 declare <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>*, i32, <8 x i1>, <8 x i16>) nounwind readonly
 declare void @llvm.masked.store.v8i16.p0v8i16(<8 x i16>, <8 x i16>*, i32, <8 x i1>) nounwind
 
-; CHECK: attributes #0 = { argmemonly nocallback nofree nosync nounwind readonly willreturn }
-; CHECK: attributes #1 = { argmemonly nocallback nofree nosync nounwind willreturn writeonly }
+; CHECK: attributes #0 = { argmemonly nocallback nofree noread_thread_id nosync nounwind readonly willreturn }
+; CHECK: attributes #1 = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn writeonly }
 ; CHECK: attributes [[NUW]] = { nounwind }
 
 !0 = !{!"tbaa root"}
Index: llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
===================================================================
--- llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
+++ llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
@@ -79,7 +79,7 @@
 ; CHECK: attributes #4 = { mustprogress nofree nosync nounwind readnone willreturn }
 ; CHECK: attributes #5 = { argmemonly mustprogress nofree nosync nounwind willreturn }
 ; CHECK: attributes #6 = { argmemonly mustprogress nofree norecurse nosync nounwind willreturn }
-; CHECK: attributes #7 = { argmemonly nocallback nofree nounwind willreturn }
+; CHECK: attributes #7 = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
 
 ; Root note.
 !0 = !{ }
Index: llvm/test/Analysis/BasicAA/intrinsics.ll
===================================================================
--- llvm/test/Analysis/BasicAA/intrinsics.ll
+++ llvm/test/Analysis/BasicAA/intrinsics.ll
@@ -22,6 +22,6 @@
 declare <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>*, i32, <8 x i1>, <8 x i16>) nounwind readonly
 declare void @llvm.masked.store.v8i16.p0v8i16(<8 x i16>, <8 x i16>*, i32, <8 x i1>) nounwind
 
-; CHECK: attributes #0 = { argmemonly nocallback nofree nosync nounwind readonly willreturn }
-; CHECK: attributes #1 = { argmemonly nocallback nofree nosync nounwind willreturn writeonly }
+; CHECK: attributes #0 = { argmemonly nocallback nofree noread_thread_id nosync nounwind readonly willreturn }
+; CHECK: attributes #1 = { argmemonly nocallback nofree noread_thread_id nosync nounwind willreturn writeonly }
 ; CHECK: attributes [[ATTR]] = { nounwind }
Index: llvm/test/Analysis/BasicAA/cs-cs.ll
===================================================================
--- llvm/test/Analysis/BasicAA/cs-cs.ll
+++ llvm/test/Analysis/BasicAA/cs-cs.ll
@@ -429,9 +429,9 @@
 }
 
 
-; CHECK:      attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly }
-; CHECK-NEXT: attributes #1 = { argmemonly nocallback nofree nounwind willreturn }
-; CHECK-NEXT: attributes #2 = { argmemonly nosync nounwind willreturn }
+; CHECK:      attributes #0 = { argmemonly nocallback nofree noread_thread_id nounwind willreturn writeonly }
+; CHECK-NEXT: attributes #1 = { argmemonly nocallback nofree noread_thread_id nounwind willreturn }
+; CHECK-NEXT: attributes #2 = { argmemonly noread_thread_id nosync nounwind willreturn }
 ; CHECK-NEXT: attributes #3 = { noinline nounwind readonly }
 ; CHECK-NEXT: attributes #4 = { noinline nounwind writeonly }
 ; CHECK-NEXT: attributes #5 = { nounwind ssp }
Index: llvm/include/llvm/IR/Intrinsics.td
===================================================================
--- llvm/include/llvm/IR/Intrinsics.td
+++ llvm/include/llvm/IR/Intrinsics.td
@@ -123,6 +123,10 @@
   int ArgNo = idx.Value;
 }
 
+// NoReadThreadID - This intrinsic does not read thread ID.
+// Applied by default;
+def IntrNoReadThreadID : IntrinsicProperty<1>;
+
 def IntrNoReturn : IntrinsicProperty;
 
 // Applied by default.
@@ -556,7 +560,9 @@
 
 def int_get_dynamic_area_offset : DefaultAttrsIntrinsic<[llvm_anyint_ty]>;
 
-def int_thread_pointer : DefaultAttrsIntrinsic<[llvm_ptr_ty], [], [IntrNoMem]>,
+def int_thread_pointer : Intrinsic<[llvm_ptr_ty], [],
+                                   [IntrNoMem, IntrNoCallback, IntrNoSync,
+                                    IntrNoFree, IntrWillReturn]>,
                          ClangBuiltin<"__builtin_thread_pointer">;
 
 // IntrInaccessibleMemOrArgMemOnly is a little more pessimistic than strictly
@@ -628,7 +634,7 @@
                              NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>,
                              NoAlias<ArgIndex<0>>, NoAlias<ArgIndex<1>>,
                              WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>,
-                             ImmArg<ArgIndex<3>>]>;
+                             ImmArg<ArgIndex<3>>, IntrNoReadThreadID]>;
 
 // Memcpy semantic that is guaranteed to be inlined.
 // In particular this means that the generated code is not allowed to call any
@@ -641,7 +647,7 @@
        NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>,
        NoAlias<ArgIndex<0>>, NoAlias<ArgIndex<1>>,
        WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>,
-       ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>]>;
+       ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>, IntrNoReadThreadID]>;
 
 def int_memmove : Intrinsic<[],
                             [llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty,
@@ -650,14 +656,14 @@
                              IntrNoCallback,
                              NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>,
                              WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>,
-                             ImmArg<ArgIndex<3>>]>;
+                             ImmArg<ArgIndex<3>>, IntrNoReadThreadID]>;
 def int_memset  : Intrinsic<[],
                             [llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty,
                              llvm_i1_ty],
                             [IntrWriteMem, IntrArgMemOnly, IntrWillReturn,
                              IntrNoFree, IntrNoCallback,
                              NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>,
-                             ImmArg<ArgIndex<3>>]>;
+                             ImmArg<ArgIndex<3>>, IntrNoReadThreadID]>;
 
 // Memset version that is guaranteed to be inlined.
 // In particular this means that the generated code is not allowed to call any
@@ -668,7 +674,7 @@
       [llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty, llvm_i1_ty],
       [IntrWriteMem, IntrArgMemOnly, IntrWillReturn, IntrNoFree, IntrNoCallback,
        NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>, 
-       ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>]>;
+       ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>, IntrNoReadThreadID]>;
 
 // FIXME: Add version of these floating point intrinsics which allow non-default
 // rounding modes and FP exception handling.
@@ -1411,9 +1417,10 @@
                            [IntrNoMem, IntrSpeculatable, IntrWillReturn]>;
 
 // Intrinsic to wrap a thread local variable.
-def int_threadlocal_address : DefaultAttrsIntrinsic<[llvm_anyptr_ty], [LLVMMatchType<0>],
-                                                    [NonNull<RetIndex>, NonNull<ArgIndex<0>>,
-                                                     IntrNoMem, IntrSpeculatable, IntrWillReturn]>;
+def int_threadlocal_address : Intrinsic<[llvm_anyptr_ty], [LLVMMatchType<0>],
+                                        [NonNull<RetIndex>, NonNull<ArgIndex<0>>,
+                                         IntrNoMem, IntrSpeculatable, IntrNoCallback,
+                                         IntrNoSync, IntrNoFree, IntrWillReturn]>;
 
 def int_experimental_stepvector : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
                                                         [], [IntrNoMem]>;
@@ -1817,7 +1824,7 @@
                 [IntrArgMemOnly, IntrWillReturn, IntrNoSync,
                  NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>,
                  WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>,
-                 ImmArg<ArgIndex<3>>]>;
+                 ImmArg<ArgIndex<3>>, IntrNoReadThreadID]>;
 
 // @llvm.memmove.element.unordered.atomic.*(dest, src, length, elementsize)
 def int_memmove_element_unordered_atomic
@@ -1826,14 +1833,14 @@
                 [IntrArgMemOnly, IntrWillReturn, IntrNoSync,
                  NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>,
                  WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>,
-                 ImmArg<ArgIndex<3>>]>;
+                 ImmArg<ArgIndex<3>>, IntrNoReadThreadID]>;
 
 // @llvm.memset.element.unordered.atomic.*(dest, value, length, elementsize)
 def int_memset_element_unordered_atomic
     : Intrinsic<[], [llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty, llvm_i32_ty],
                 [IntrWriteMem, IntrArgMemOnly, IntrWillReturn, IntrNoSync,
                  NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>,
-                 ImmArg<ArgIndex<3>>]>;
+                 ImmArg<ArgIndex<3>>, IntrNoReadThreadID]>;
 
 //===------------------------ Reduction Intrinsics ------------------------===//
 //
Index: clang/test/CodeGen/libcalls.c
===================================================================
--- clang/test/CodeGen/libcalls.c
+++ clang/test/CodeGen/libcalls.c
@@ -125,4 +125,4 @@
 
 // CHECK-YES: attributes [[NUW]] = { nounwind "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+x87" }
 // CHECK-NO-DAG: attributes [[NUW_RN]] = { nounwind readnone{{.*}} }
-// CHECK-NO-DAG: attributes [[NUW_RNI]] = { nocallback nofree nosync nounwind readnone speculatable willreturn }
+// CHECK-NO-DAG: attributes [[NUW_RNI]] = { nocallback nofree noread_thread_id nosync nounwind readnone speculatable willreturn }
Index: clang/test/CodeGen/builtin-sqrt.c
===================================================================
--- clang/test/CodeGen/builtin-sqrt.c
+++ clang/test/CodeGen/builtin-sqrt.c
@@ -11,5 +11,5 @@
 // HAS_ERRNO-NOT: attributes [[ATTR]] = {{{.*}} readnone
 
 // NO_ERRNO: declare float @llvm.sqrt.f32(float) [[ATTR:#[0-9]+]]
-// NO_ERRNO: attributes [[ATTR]] = { nocallback nofree nosync nounwind readnone {{.*}}}
+// NO_ERRNO: attributes [[ATTR]] = { nocallback nofree noread_thread_id nosync nounwind readnone {{.*}}}
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to