[clang] [llvm] [mlir] [IR] Make InaccessibleMem a category rather than a location (PR #245318)
Serge Pavlov via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 09:47:55 PST 2026
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/245318
The memory location `InaccessibleMem` has been used to express various memory-like restrictions. It is used in many cases where no actual access to memory occurs; the only purpose of this access is to impose restrictions on the control flow. It does not specify a concrete reason why the restrictions are needed, and all operations having such access are subjected to the same restriction. Using more a specific property than the generic access to `InaccessibleMem` can be profitable, and sometimes `InaccessibleMem` undergoes splitting. Previously, `TargetMem` accesses had been separated from `InaccessibleMem` and there is an intention to separate the access to floating-point environment.
At the same time, the notion of `InaccessibleMem` is useful. In many cases, the knowledge that the access cannot alias with any pointer is enough for an algorithm. Considering all locations as a group may simplify algorithms; they continue using functions like `onlyAccessesInaccessibleMem`, although the set of tested locations can vary.
This change reorganizes the interface of MemoryEffects. Instead of `InaccessibleMem`, another location was introduced: `ControlMem`. Functions like `inaccessibleMemOnly` or `onlyAccessesInaccessibleMem` are preserved, but they may test more than one location.
The commit does not add new functionality; most changes are mechanical. However, there are differences with the current behavior.
First, the locations `TargetMem*` are considered part of `InaccessibleMem` locations, and functions like
`onlyAccessesInaccessibleMem` check the relevant access. This behavior differs from the current one, where TargetMem locations are considered as totally independent locations. It is conservatively safe to test `TargetMem` while checking for `InaccessibleMem`; previously the implementation did that.
Printing memory effectshas also changed. If all `inaccessibleMem` locations have the same access, the dump contains only the `inaccessiblemem` key. The same technique has been used for printing `TargetMem` access.
In some cases, memory effects were initialized by `controlMemOnly` rather than `inaccessibleMemOnly`; this is done when it is clear that target memory, as well as the floating-point environment, do not affect the behavior.
The purpose of this change is to enable intruducing floating-point memory locations, as proposed in
https://github.com/llvm/llvm-project/pull/226826#issuecomment-6634451283.
>From 5f14a4cccf6dd7966eb1c9c3fb02751b2a63cf1c Mon Sep 17 00:00:00 2001
From: Serge Pavlov <sepavloff at gmail.com>
Date: Sun, 15 Nov 2026 15:17:18 +0700
Subject: [PATCH] [IR] Make InaccessibleMem a category rather than a location
The memory location `InaccessibleMem` has been used to express various
memory-like restrictions. It is used in many cases where no actual
access to memory occurs; the only purpose of this access is to impose
restrictions on the control flow. It does not specify a concrete reason
why the restrictions are needed, and all operations having such access
are subjected to the same restriction. Using more a specific property
than the generic access to `InaccessibleMem` can be profitable, and
sometimes `InaccessibleMem` undergoes splitting. Previously, `TargetMem`
accesses had been separated from `InaccessibleMem` and there is an
intention to separate the access to floating-point environment.
At the same time, the notion of `InaccessibleMem` is useful. In many
cases, the knowledge that the access cannot alias with any pointer is
enough for an algorithm. Considering all locations as a group may
simplify algorithms; they continue using functions like
`onlyAccessesInaccessibleMem`, although the set of tested locations can
vary.
This change reorganizes the interface of MemoryEffects. Instead of
`InaccessibleMem`, another location was introduced: `ControlMem`.
Functions like `inaccessibleMemOnly` or `onlyAccessesInaccessibleMem`
are preserved, but they may test more than one location.
The commit does not add new functionality; most changes are mechanical.
However, there are differences with the current behavior.
First, the locations `TargetMem*` are considered part of
`InaccessibleMem` locations, and functions like
`onlyAccessesInaccessibleMem` check the relevant access. This behavior
differs from the current one, where TargetMem locations are considered
as totally independent locations. It is conservatively safe to test
`TargetMem` while checking for `InaccessibleMem`; previously the
implementation did that.
Printing memory effectshas also changed. If all `inaccessibleMem`
locations have the same access, the dump contains only the
`inaccessiblemem` key. The same technique has been used for printing
`TargetMem` access.
In some cases, memory effects were initialized by `controlMemOnly`
rather than `inaccessibleMemOnly`; this is done when it is clear that
target memory, as well as the floating-point environment, do not affect
the behavior.
The purpose of this change is to enable intruducing floating-point
memory locations, as proposed in
https://github.com/llvm/llvm-project/pull/226826#issuecomment-6634451283.
---
.../include/clang/CIR/Dialect/IR/CIRAttrs.td | 30 ++++++-
clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp | 2 +-
clang/lib/CIR/Dialect/IR/CIRAttrs.cpp | 52 ++++++++++--
.../Transforms/CallConvLoweringPass.cpp | 4 +-
.../CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp | 2 +-
clang/test/CIR/CodeGen/call.c | 4 +-
clang/test/CIR/CodeGen/class.cpp | 2 +-
.../CIR/CodeGen/new-delete-deactivation.cpp | 12 +--
.../CIR/CodeGen/new-delete-no-exceptions.cpp | 2 +-
clang/test/CIR/CodeGen/new-delete.cpp | 6 +-
clang/test/CIR/CodeGen/new.cpp | 46 +++++------
.../test/CIR/CodeGen/operator-new-noalias.cpp | 7 +-
.../test/CIR/CodeGen/paren-list-agg-init.cpp | 6 +-
clang/test/CIR/CodeGen/side-effect.cpp | 74 ++++++++---------
.../CodeGenBuiltins/builtin-new-delete.cpp | 6 +-
clang/test/CIR/CodeGenCXX/new-array-init.cpp | 38 ++++-----
clang/test/CIR/IR/call.cir | 20 ++---
clang/test/CIR/Lowering/memory-effects.cir | 16 ++--
.../memory-effects-argmem-indirect.cir | 6 +-
.../abi-lowering/memory-effects-argmem.cir | 24 +++---
.../abi-lowering/x86_64-indirect-variadic.cir | 6 +-
.../CIR/Transforms/flatten-preserve-attrs.cir | 16 ++--
.../test/CIR/Transforms/idiom-recognizer.cpp | 2 +-
.../CodeGen/sanitize-metadata-nosanitize.c | 18 ++---
.../CodeGenCXX/cxx1z-aligned-allocation.cpp | 12 +--
clang/test/CodeGenCXX/new.cpp | 4 +-
clang/test/CodeGenCXX/new_hot_cold.cpp | 16 ++--
clang/test/CodeGenCXX/operator-new.cpp | 2 +-
clang/test/CodeGenCXX/threadlocal_address.cpp | 2 +-
llvm/docs/ReleaseNotes.md | 3 +
llvm/include/llvm/AsmParser/LLToken.h | 1 +
llvm/include/llvm/IR/Function.h | 10 ---
llvm/include/llvm/IR/InstrTypes.h | 2 -
llvm/include/llvm/IR/Intrinsics.td | 20 +++--
llvm/include/llvm/IR/IntrinsicsAArch64.td | 4 +-
llvm/include/llvm/IR/IntrinsicsNVVM.td | 2 +-
llvm/include/llvm/IR/RuntimeLibcalls.td | 22 ++---
llvm/include/llvm/IR/RuntimeLibcallsImpl.td | 14 ++--
llvm/include/llvm/Support/ModRef.h | 81 +++++++++++++++----
llvm/lib/Analysis/AliasAnalysis.cpp | 16 ++--
llvm/lib/Analysis/BasicAliasAnalysis.cpp | 7 +-
llvm/lib/AsmParser/LLLexer.cpp | 1 +
llvm/lib/AsmParser/LLParser.cpp | 13 ++-
llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 32 ++++----
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 +-
llvm/lib/IR/Attributes.cpp | 46 ++++++++---
llvm/lib/IR/Function.cpp | 19 -----
llvm/lib/IR/Instruction.cpp | 2 +-
llvm/lib/IR/Instructions.cpp | 9 +--
llvm/lib/Support/ModRef.cpp | 4 +-
.../Instrumentation/AddressSanitizer.cpp | 4 +-
.../test/Assembler/memory-attribute-errors.ll | 6 +-
llvm/test/Assembler/memory-attribute.ll | 4 +-
llvm/test/Bitcode/compatibility-3.6.ll | 2 +-
llvm/test/Bitcode/compatibility-3.7.ll | 2 +-
llvm/test/Bitcode/compatibility-3.8.ll | 2 +-
llvm/test/Bitcode/compatibility-3.9.ll | 2 +-
llvm/test/Bitcode/compatibility-4.0.ll | 2 +-
llvm/test/Bitcode/compatibility-5.0.ll | 2 +-
llvm/test/Bitcode/compatibility-6.0.ll | 2 +-
llvm/test/Bitcode/compatibility.ll | 2 +-
llvm/test/Bitcode/memory-attribute-upgrade.ll | 4 +-
llvm/test/Bitcode/target-memory-attribute.ll | 4 +-
.../AddressSanitizer/remove-memory-effects.ll | 4 +-
.../HWAddressSanitizer/mem-attr.ll | 4 +-
.../TableGen/target-mem-intrinsic-attrs.td | 26 +++---
.../test/Transforms/EarlyCSE/target-memory.ll | 14 ++--
.../Transforms/FunctionAttrs/argmemonly.ll | 22 ++---
llvm/test/Transforms/FunctionAttrs/atomic.ll | 4 +-
.../Transforms/FunctionAttrs/initializes.ll | 12 +--
.../Transforms/FunctionAttrs/nocapture.ll | 38 ++++-----
.../Transforms/FunctionAttrs/nofpclass.ll | 4 +-
llvm/test/Transforms/FunctionAttrs/nosync.ll | 6 +-
.../FunctionAttrs/read-write-scc.ll | 4 +-
.../Transforms/FunctionAttrs/readattrs.ll | 4 +-
.../Transforms/FunctionAttrs/writeonly.ll | 6 +-
.../GlobalOpt/disable-globals-aa.ll | 8 +-
.../Transforms/InferFunctionAttrs/annotate.ll | 20 ++---
.../InferFunctionAttrs/enable-builtin.ll | 2 +-
.../InferFunctionAttrs/norecurse_debug.ll | 2 +-
.../cfi-nounwind-direct-call.ll | 2 +-
.../Transforms/SCCP/ipscp-drop-argmemonly.ll | 16 ++--
.../Util/DeclareRuntimeLibcalls/basic.ll | 6 +-
.../Util/DeclareRuntimeLibcalls/bsd.ll | 18 ++---
.../Util/DeclareRuntimeLibcalls/windows.ll | 24 +++---
llvm/unittests/Support/ModRefTest.cpp | 55 ++++++-------
.../TableGen/Basic/CodeGenIntrinsics.cpp | 17 ++--
.../TableGen/Basic/RuntimeLibcallsEmitter.cpp | 2 +-
.../mlir/Dialect/LLVMIR/LLVMAttrDefs.td | 2 +-
mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp | 2 +-
.../LLVMIR/LLVMToLLVMIRTranslation.cpp | 4 +-
mlir/lib/Target/LLVMIR/ModuleImport.cpp | 14 ++--
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp | 6 +-
93 files changed, 623 insertions(+), 510 deletions(-)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
index 33360b773093dd..82816365c869f0 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
@@ -2434,7 +2434,7 @@ def CIR_MemoryEffectsAttr : CIR_Attr<"MemoryEffects", "memory_effects"> {
parameters, including locations with no class of their own such as
globals and captured pointers.
- `arg_mem`: accesses based on the function's pointer arguments.
- - `inaccessible_mem`: accesses to memory the current module cannot reach,
+ - `control_mem`: accesses to memory the current module cannot reach,
often used to model the control dependencies of intrinsics.
- `errno_mem`: accesses to the `errno` variable.
- `target_mem0`, `target_mem1`: target-specific state.
@@ -2449,7 +2449,7 @@ def CIR_MemoryEffectsAttr : CIR_Attr<"MemoryEffects", "memory_effects"> {
Example:
```
#cir.memory_effects<other = read, arg_mem = readwrite,
- inaccessible_mem = none, errno_mem = none,
+ control_mem = none, errno_mem = none,
target_mem0 = none, target_mem1 = none>
```
@@ -2463,7 +2463,7 @@ def CIR_MemoryEffectsAttr : CIR_Attr<"MemoryEffects", "memory_effects"> {
}];
let parameters = (ins "ModRefInfo":$other, "ModRefInfo":$arg_mem,
- "ModRefInfo":$inaccessible_mem,
+ "ModRefInfo":$control_mem,
"ModRefInfo":$errno_mem, "ModRefInfo":$target_mem0,
"ModRefInfo":$target_mem1);
@@ -2489,6 +2489,10 @@ def CIR_MemoryEffectsAttr : CIR_Attr<"MemoryEffects", "memory_effects"> {
static MemoryEffectsAttr argMemOnly(::mlir::MLIRContext *ctx,
ModRefInfo mr = ModRefInfo::ModRef);
+ /// Create MemoryEffectsAttr that can only access control memory.
+ static MemoryEffectsAttr controlMemOnly(::mlir::MLIRContext *ctx,
+ ModRefInfo mr = ModRefInfo::ModRef);
+
/// Create MemoryEffectsAttr that can only access inaccessible memory.
static MemoryEffectsAttr
inaccessibleMemOnly(::mlir::MLIRContext *ctx,
@@ -2508,6 +2512,12 @@ def CIR_MemoryEffectsAttr : CIR_Attr<"MemoryEffects", "memory_effects"> {
inaccessibleOrArgMemOnly(::mlir::MLIRContext *ctx,
ModRefInfo mr = ModRefInfo::ModRef);
+ /// Create MemoryEffectsAttr that can only access control or argument
+ /// memory.
+ static MemoryEffectsAttr
+ controlOrArgMemOnly(::mlir::MLIRContext *ctx,
+ ModRefInfo mr = ModRefInfo::ModRef);
+
/// Create MemoryEffectsAttr that can only access inaccessible or errno
/// memory.
static MemoryEffectsAttr inaccessibleOrErrnoMemOnly(
@@ -2515,6 +2525,13 @@ def CIR_MemoryEffectsAttr : CIR_Attr<"MemoryEffects", "memory_effects"> {
ModRefInfo inaccessibleMr = ModRefInfo::ModRef,
ModRefInfo errnoMr = ModRefInfo::ModRef);
+ /// Create MemoryEffectsAttr that can only access control or errno
+ /// memory.
+ static MemoryEffectsAttr controlOrErrnoMemOnly(
+ ::mlir::MLIRContext *ctx,
+ ModRefInfo controlMr = ModRefInfo::ModRef,
+ ModRefInfo errnoMr = ModRefInfo::ModRef);
+
/// Create MemoryEffectsAttr that can only access inaccessible, argument or
/// errno memory.
static MemoryEffectsAttr inaccessibleOrArgOrErrnoMemOnly(
@@ -2522,6 +2539,13 @@ def CIR_MemoryEffectsAttr : CIR_Attr<"MemoryEffects", "memory_effects"> {
ModRefInfo inaccessibleOrArgMr = ModRefInfo::ModRef,
ModRefInfo errnoMr = ModRefInfo::ModRef);
+ /// Create MemoryEffectsAttr that can only access control, argument or
+ /// errno memory.
+ static MemoryEffectsAttr controlOrArgOrErrnoMemOnly(
+ ::mlir::MLIRContext *ctx,
+ ModRefInfo controlOrArgMr = ModRefInfo::ModRef,
+ ModRefInfo errnoMr = ModRefInfo::ModRef);
+
/// Create MemoryEffectsAttr that can only access argument or errno memory.
static MemoryEffectsAttr
argumentOrErrnoMemOnly(::mlir::MLIRContext *ctx,
diff --git a/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp b/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
index d19784a491e1f0..453d6da857db9b 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp
@@ -775,7 +775,7 @@ static RValue emitNewDeleteCall(CIRGenFunction &cgf,
// FIXME: inaccessiblemem could cause issues if LTO makes the
// previously inaccessible memory accessible after linking.
callOrTryCall.setMemoryEffectsAttr(
- cir::MemoryEffectsAttr::inaccessibleOrErrnoMemOnly(
+ cir::MemoryEffectsAttr::controlOrErrnoMemOnly(
callOrTryCall->getContext(), cir::ModRefInfo::ModRef,
cir::ModRefInfo::Mod));
}
diff --git a/clang/lib/CIR/Dialect/IR/CIRAttrs.cpp b/clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
index ab4cbaf5bd4994..7c243cf64a3f98 100644
--- a/clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
@@ -468,7 +468,7 @@ MemoryEffectsAttr MemoryEffectsAttr::writeOnly(MLIRContext *ctx) {
MemoryEffectsAttr MemoryEffectsAttr::argMemOnly(MLIRContext *ctx,
ModRefInfo mr) {
return get(ctx, /*other=*/ModRefInfo::NoModRef, /*arg_mem=*/mr,
- /*inaccessible_mem=*/ModRefInfo::NoModRef,
+ /*control_mem=*/ModRefInfo::NoModRef,
/*errno_mem=*/ModRefInfo::NoModRef,
/*target_mem0=*/ModRefInfo::NoModRef,
/*target_mem1=*/ModRefInfo::NoModRef);
@@ -477,7 +477,16 @@ MemoryEffectsAttr MemoryEffectsAttr::argMemOnly(MLIRContext *ctx,
MemoryEffectsAttr MemoryEffectsAttr::inaccessibleMemOnly(MLIRContext *ctx,
ModRefInfo mr) {
return get(ctx, /*other=*/ModRefInfo::NoModRef,
- /*arg_mem=*/ModRefInfo::NoModRef, /*inaccessible_mem=*/mr,
+ /*arg_mem=*/ModRefInfo::NoModRef, /*control_mem=*/mr,
+ /*errno_mem=*/ModRefInfo::NoModRef,
+ /*target_mem0=*/mr,
+ /*target_mem1=*/mr);
+}
+
+MemoryEffectsAttr MemoryEffectsAttr::controlMemOnly(MLIRContext *ctx,
+ ModRefInfo mr) {
+ return get(ctx, /*other=*/ModRefInfo::NoModRef,
+ /*arg_mem=*/ModRefInfo::NoModRef, /*control_mem=*/mr,
/*errno_mem=*/ModRefInfo::NoModRef,
/*target_mem0=*/ModRefInfo::NoModRef,
/*target_mem1=*/ModRefInfo::NoModRef);
@@ -487,7 +496,7 @@ MemoryEffectsAttr MemoryEffectsAttr::errnoMemOnly(MLIRContext *ctx,
ModRefInfo mr) {
return get(ctx, /*other=*/ModRefInfo::NoModRef,
/*arg_mem=*/ModRefInfo::NoModRef,
- /*inaccessible_mem=*/ModRefInfo::NoModRef, /*errno_mem=*/mr,
+ /*control_mem=*/ModRefInfo::NoModRef, /*errno_mem=*/mr,
/*target_mem0=*/ModRefInfo::NoModRef,
/*target_mem1=*/ModRefInfo::NoModRef);
}
@@ -495,7 +504,7 @@ MemoryEffectsAttr MemoryEffectsAttr::errnoMemOnly(MLIRContext *ctx,
MemoryEffectsAttr MemoryEffectsAttr::otherMemOnly(MLIRContext *ctx,
ModRefInfo mr) {
return get(ctx, /*other=*/mr, /*arg_mem=*/ModRefInfo::NoModRef,
- /*inaccessible_mem=*/ModRefInfo::NoModRef,
+ /*control_mem=*/ModRefInfo::NoModRef,
/*errno_mem=*/ModRefInfo::NoModRef,
/*target_mem0=*/ModRefInfo::NoModRef,
/*target_mem1=*/ModRefInfo::NoModRef);
@@ -504,7 +513,15 @@ MemoryEffectsAttr MemoryEffectsAttr::otherMemOnly(MLIRContext *ctx,
MemoryEffectsAttr MemoryEffectsAttr::inaccessibleOrArgMemOnly(MLIRContext *ctx,
ModRefInfo mr) {
return get(ctx, /*other=*/ModRefInfo::NoModRef, /*arg_mem=*/mr,
- /*inaccessible_mem=*/mr, /*errno_mem=*/ModRefInfo::NoModRef,
+ /*control_mem=*/mr, /*errno_mem=*/ModRefInfo::NoModRef,
+ /*target_mem0=*/mr,
+ /*target_mem1=*/mr);
+}
+
+MemoryEffectsAttr MemoryEffectsAttr::controlOrArgMemOnly(MLIRContext *ctx,
+ ModRefInfo mr) {
+ return get(ctx, /*other=*/ModRefInfo::NoModRef, /*arg_mem=*/mr,
+ /*control_mem=*/mr, /*errno_mem=*/ModRefInfo::NoModRef,
/*target_mem0=*/ModRefInfo::NoModRef,
/*target_mem1=*/ModRefInfo::NoModRef);
}
@@ -513,7 +530,17 @@ MemoryEffectsAttr MemoryEffectsAttr::inaccessibleOrErrnoMemOnly(
MLIRContext *ctx, ModRefInfo inaccessibleMr, ModRefInfo errnoMr) {
return get(ctx, /*other=*/ModRefInfo::NoModRef,
/*arg_mem=*/ModRefInfo::NoModRef,
- /*inaccessible_mem=*/inaccessibleMr, /*errno_mem=*/errnoMr,
+ /*control_mem=*/inaccessibleMr, /*errno_mem=*/errnoMr,
+ /*target_mem0=*/inaccessibleMr,
+ /*target_mem1=*/inaccessibleMr);
+}
+
+MemoryEffectsAttr MemoryEffectsAttr::controlOrErrnoMemOnly(MLIRContext *ctx,
+ ModRefInfo controlMr,
+ ModRefInfo errnoMr) {
+ return get(ctx, /*other=*/ModRefInfo::NoModRef,
+ /*arg_mem=*/ModRefInfo::NoModRef,
+ /*control_mem=*/controlMr, /*errno_mem=*/errnoMr,
/*target_mem0=*/ModRefInfo::NoModRef,
/*target_mem1=*/ModRefInfo::NoModRef);
}
@@ -522,7 +549,16 @@ MemoryEffectsAttr MemoryEffectsAttr::inaccessibleOrArgOrErrnoMemOnly(
MLIRContext *ctx, ModRefInfo inaccessibleOrArgMr, ModRefInfo errnoMr) {
return get(ctx, /*other=*/ModRefInfo::NoModRef,
/*arg_mem=*/inaccessibleOrArgMr,
- /*inaccessible_mem=*/inaccessibleOrArgMr, /*errno_mem=*/errnoMr,
+ /*control_mem=*/inaccessibleOrArgMr, /*errno_mem=*/errnoMr,
+ /*target_mem0=*/inaccessibleOrArgMr,
+ /*target_mem1=*/inaccessibleOrArgMr);
+}
+
+MemoryEffectsAttr MemoryEffectsAttr::controlOrArgOrErrnoMemOnly(
+ MLIRContext *ctx, ModRefInfo inaccessibleOrArgMr, ModRefInfo errnoMr) {
+ return get(ctx, /*other=*/ModRefInfo::NoModRef,
+ /*arg_mem=*/inaccessibleOrArgMr,
+ /*control_mem=*/inaccessibleOrArgMr, /*errno_mem=*/errnoMr,
/*target_mem0=*/ModRefInfo::NoModRef,
/*target_mem1=*/ModRefInfo::NoModRef);
}
@@ -531,7 +567,7 @@ MemoryEffectsAttr
MemoryEffectsAttr::argumentOrErrnoMemOnly(MLIRContext *ctx, ModRefInfo argMr,
ModRefInfo errnoMr) {
return get(ctx, /*other=*/ModRefInfo::NoModRef, /*arg_mem=*/argMr,
- /*inaccessible_mem=*/ModRefInfo::NoModRef, /*errno_mem=*/errnoMr,
+ /*control_mem=*/ModRefInfo::NoModRef, /*errno_mem=*/errnoMr,
/*target_mem0=*/ModRefInfo::NoModRef,
/*target_mem1=*/ModRefInfo::NoModRef);
}
diff --git a/clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp b/clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
index 2ccf798e5fa3f4..b7a4c68db82a78 100644
--- a/clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
+++ b/clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
@@ -90,8 +90,8 @@ template <typename OpTy> static void widenForArgMemory(OpTy op) {
return;
op.setMemoryEffectsAttr(cir::MemoryEffectsAttr::get(
effects.getContext(), effects.getOther(), cir::ModRefInfo::ModRef,
- effects.getInaccessibleMem(), effects.getErrnoMem(),
- effects.getTargetMem0(), effects.getTargetMem1()));
+ effects.getControlMem(), effects.getErrnoMem(), effects.getTargetMem0(),
+ effects.getTargetMem1()));
}
#ifndef NDEBUG
diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
index b470b07efddd15..f9beaee477a254 100644
--- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
@@ -572,7 +572,7 @@ convertMemoryEffects(mlir::MLIRContext *ctx, cir::MemoryEffectsAttr effects) {
return mlir::LLVM::MemoryEffectsAttr::get(
ctx, convertModRefInfo(effects.getOther()),
convertModRefInfo(effects.getArgMem()),
- convertModRefInfo(effects.getInaccessibleMem()),
+ convertModRefInfo(effects.getControlMem()),
convertModRefInfo(effects.getErrnoMem()),
convertModRefInfo(effects.getTargetMem0()),
convertModRefInfo(effects.getTargetMem1()));
diff --git a/clang/test/CIR/CodeGen/call.c b/clang/test/CIR/CodeGen/call.c
index dfc58315a0cdc2..2fc11f57d7380b 100644
--- a/clang/test/CIR/CodeGen/call.c
+++ b/clang/test/CIR/CodeGen/call.c
@@ -138,9 +138,9 @@ int f12(void) {
// CIR-LABEL: cir.func{{.*}} @f12() -> !s32i{{.*}} {
// CIR: %[[A:.+]] = cir.const #cir.int<1> : !s32i
-// CIR-NEXT: %{{.+}} = cir.call @f10(%[[A]]) nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : (!s32i {llvm.noundef}) -> !s32i
+// CIR-NEXT: %{{.+}} = cir.call @f10(%[[A]]) nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : (!s32i {llvm.noundef}) -> !s32i
// CIR-NEXT: %[[B:.+]] = cir.const #cir.int<2> : !s32i
-// CIR-NEXT: %{{.+}} = cir.call @f11(%[[B]]) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s32i {llvm.noundef}) -> !s32i
+// CIR-NEXT: %{{.+}} = cir.call @f11(%[[B]]) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s32i {llvm.noundef}) -> !s32i
// LLVM-LABEL: define{{.*}} i32 @f12(){{.*}}
// LLVM: %{{.+}} = call i32 @f10(i32 noundef 1) #[[ATTR0:.+]]
diff --git a/clang/test/CIR/CodeGen/class.cpp b/clang/test/CIR/CodeGen/class.cpp
index 282d9ef0b80166..3bbb2d8b656ad3 100644
--- a/clang/test/CIR/CodeGen/class.cpp
+++ b/clang/test/CIR/CodeGen/class.cpp
@@ -181,7 +181,7 @@ void fam_3() {
// CIR: cir.func{{.*}}@_Z5fam_3v
// CIR: %[[A:.*]] = cir.alloca "a" align(8) init : !cir.ptr<!cir.ptr<!rec_JustFam>>
// CIR: %[[ZERO:.*]] = cir.const #cir.int<0> : !u64i
-// CIR: %[[NEW:.*]] = cir.call @_Znwm(%[[ZERO]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: %[[NEW:.*]] = cir.call @_Znwm(%[[ZERO]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: %[[NEW_TO_A:.*]] = cir.cast bitcast %[[NEW]] : !cir.ptr<!void> -> !cir.ptr<!rec_JustFam>
// CIR: cir.store align(8) %[[NEW_TO_A]], %[[A]] : !cir.ptr<!rec_JustFam>, !cir.ptr<!cir.ptr<!rec_JustFam>>
// CIR: %[[LOAD_A:.*]] = cir.load align(8) %[[A]] : !cir.ptr<!cir.ptr<!rec_JustFam>>, !cir.ptr<!rec_JustFam>
diff --git a/clang/test/CIR/CodeGen/new-delete-deactivation.cpp b/clang/test/CIR/CodeGen/new-delete-deactivation.cpp
index a2f70507946d22..13eb9d5c38e221 100644
--- a/clang/test/CIR/CodeGen/new-delete-deactivation.cpp
+++ b/clang/test/CIR/CodeGen/new-delete-deactivation.cpp
@@ -26,7 +26,7 @@ A *deact_simple() { return new A(makeB()); }
// CIR: %[[NEW_RESULT:.*]] = cir.alloca "__new_result" {{.*}} : !cir.ptr<!cir.ptr<!rec_A>>
// CIR: %[[TMP:.*]] = cir.alloca "ref.tmp0" {{.*}} : !cir.ptr<!rec_B>
// CIR: %[[ACTIVE:.*]] = cir.alloca "cleanup.isactive" {{.*}} : !cir.ptr<!cir.bool>
-// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: cir.cleanup.scope {
// CIR: %[[TRUE:.*]] = cir.const #true
// CIR: cir.store %[[TRUE]], %[[ACTIVE]] : !cir.bool, !cir.ptr<!cir.bool>
@@ -106,7 +106,7 @@ A *deact_if(bool cond) {
// CIR-LABEL: cir.func {{.*}} @_Z8deact_ifb
// CIR: cir.if {{.*}} {
// CIR: %[[ACTIVE:.*]] = cir.alloca "cleanup.isactive" {{.*}} : !cir.ptr<!cir.bool>
-// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: cir.cleanup.scope {
// CIR: %[[TRUE:.*]] = cir.const #true
// CIR: cir.store %[[TRUE]], %[[ACTIVE]] : !cir.bool, !cir.ptr<!cir.bool>
@@ -162,7 +162,7 @@ A *deact_ternary(bool cond) { return (new A(makeB()), cond) ? nullptr : nullptr;
// CIR-LABEL: cir.func {{.*}} @_Z13deact_ternaryb
// CIR: %[[ACTIVE:.*]] = cir.alloca "cleanup.isactive" {{.*}} : !cir.ptr<!cir.bool>
-// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: cir.cleanup.scope {
// CIR: %[[TRUE:.*]] = cir.const #true
// CIR: cir.store %[[TRUE]], %[[ACTIVE]] : !cir.bool, !cir.ptr<!cir.bool>
@@ -219,7 +219,7 @@ A *deact_while_cond(int n) {
// CIR-LABEL: cir.func {{.*}} @_Z16deact_while_condi
// CIR: %[[ACTIVE:.*]] = cir.alloca "cleanup.isactive" {{.*}} : !cir.ptr<!cir.bool>
// CIR: cir.while {
-// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: cir.cleanup.scope {
// CIR: %[[TRUE:.*]] = cir.const #true
// CIR: cir.store %[[TRUE]], %[[ACTIVE]] : !cir.bool, !cir.ptr<!cir.bool>
@@ -299,7 +299,7 @@ A *deact_switch(int kind) {
// CIR: %[[ACTIVE:.*]] = cir.alloca "cleanup.isactive" {{.*}} : !cir.ptr<!cir.bool>
// CIR: cir.switch({{.*}}) {
// CIR: cir.case(equal, [#cir.int<1> : !s32i]) {
-// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: %[[PTR:.*]] = cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: cir.cleanup.scope {
// CIR: %[[TRUE:.*]] = cir.const #true
// CIR: cir.store %[[TRUE]], %[[ACTIVE]] : !cir.bool, !cir.ptr<!cir.bool>
@@ -358,7 +358,7 @@ A *deact_switch(int kind) {
// OGCG: [[DO_DELETE]]:
// OGCG: call void @_ZdlPv(ptr allocptr %[[PTR]])
-// LLVM-DAG: attributes #[[ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}memory(inaccessiblemem: readwrite, errnomem: write){{.*}}}
+// LLVM-DAG: attributes #[[ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}memory(errnomem: write, controlmem: readwrite){{.*}}}
// LLVM-DAG: attributes #[[ATTR_BUILTIN_DEL]] = {{{.*}}builtin{{.*}}}
// LLVM-DAG: attributes #[[ATTR_NOUNWIND]] = {{{.*}}nounwind{{.*}}}
// OGCG-DAG: attributes #[[OGCG_ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}}
diff --git a/clang/test/CIR/CodeGen/new-delete-no-exceptions.cpp b/clang/test/CIR/CodeGen/new-delete-no-exceptions.cpp
index e2e6955610d480..a2db13f2b14600 100644
--- a/clang/test/CIR/CodeGen/new-delete-no-exceptions.cpp
+++ b/clang/test/CIR/CodeGen/new-delete-no-exceptions.cpp
@@ -32,7 +32,7 @@ B makeB();
A *noex_new() { return new A(makeB()); }
// CIR-LABEL: cir.func {{.*}} @_Z8noex_newv()
-// CIR: cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.call @_Znwm({{.*}}) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: cir.call @_Z5makeBv
// CIR: cir.cleanup.scope {
// CIR: cir.call @_ZN1BcviEv
diff --git a/clang/test/CIR/CodeGen/new-delete.cpp b/clang/test/CIR/CodeGen/new-delete.cpp
index 7ecc3ca5e37a32..1ba67cd2d50aad 100644
--- a/clang/test/CIR/CodeGen/new-delete.cpp
+++ b/clang/test/CIR/CodeGen/new-delete.cpp
@@ -16,7 +16,7 @@ A *a() {
// CIR: %[[RETVAL:.*]] = cir.alloca "" {{.*}} return_slot : !cir.ptr<!cir.ptr<!rec_A>>
// CIR: %[[NEW_RESULT:.*]] = cir.alloca "__new_result" {{.*}} : !cir.ptr<!cir.ptr<!rec_A>>
// CIR: %[[ALLOC_SIZE:.*]] = cir.const #cir.int<8> : !u64i
-// CIR: %[[PTR:.*]] = cir.call @_Znwm(%[[ALLOC_SIZE]]) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: %[[PTR:.*]] = cir.call @_Znwm(%[[ALLOC_SIZE]]) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: cir.cleanup.scope {
// CIR: %[[PTR_A:.*]] = cir.cast bitcast %[[PTR]] : !cir.ptr<!void> -> !cir.ptr<!rec_A>
// CIR: cir.store{{.*}} %[[PTR_A]], %[[NEW_RESULT]] : !cir.ptr<!rec_A>, !cir.ptr<!cir.ptr<!rec_A>>
@@ -91,7 +91,7 @@ A *b() {
// CIR: %[[RETVAL:.*]] = cir.alloca "" {{.*}} return_slot : !cir.ptr<!cir.ptr<!rec_A>>
// CIR: %[[NEW_RESULT:.*]] = cir.alloca "__new_result" {{.*}} : !cir.ptr<!cir.ptr<!rec_A>>
// CIR: %[[ALLOC_SIZE:.*]] = cir.const #cir.int<8> : !u64i
-// CIR: %[[PTR:.*]] = cir.call @_Znwm(%[[ALLOC_SIZE]]) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
+// CIR: %[[PTR:.*]] = cir.call @_Znwm(%[[ALLOC_SIZE]]) {{{.*}}builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>}
// CIR: cir.cleanup.scope {
// CIR: %[[PTR_A:.*]] = cir.cast bitcast %[[PTR]] : !cir.ptr<!void> -> !cir.ptr<!rec_A>
// CIR: cir.store{{.*}} %[[PTR_A]], %[[NEW_RESULT]] : !cir.ptr<!rec_A>, !cir.ptr<!cir.ptr<!rec_A>>
@@ -573,7 +573,7 @@ D *test_new_delete_conditional_array(bool cond, int n) {
// OGCG: %[[OGA_LOAD_SIZE:.*]] = load i64, ptr %[[OGA_SAVE_SIZE]], align 8
// OGCG: invoke void @_ZN1DdaEPvm(ptr %[[OGA_LOAD_PTR]], i64 %[[OGA_LOAD_SIZE]])
-// LLVM-DAG: attributes #[[ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}memory(inaccessiblemem: readwrite, errnomem: write){{.*}}}
+// LLVM-DAG: attributes #[[ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}memory(errnomem: write, controlmem: readwrite){{.*}}}
// LLVM-DAG: attributes #[[ATTR_BUILTIN_DEL]] = {{{.*}}builtin{{.*}}}
// OGCG-DAG: attributes #[[OGCG_ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}}
// OGCG-DAG: attributes #[[OGCG_ATTR_BUILTIN_DEL]] = {{{.*}}builtin{{.*}}}
diff --git a/clang/test/CIR/CodeGen/new.cpp b/clang/test/CIR/CodeGen/new.cpp
index 3a26f7264c0001..e7a037d06a75f9 100644
--- a/clang/test/CIR/CodeGen/new.cpp
+++ b/clang/test/CIR/CodeGen/new.cpp
@@ -163,7 +163,7 @@ void test_new_with_complex_type() {
// CHECK: cir.func{{.*}} @_Z26test_new_with_complex_typev
// CHECK: %[[A_ADDR:.*]] = cir.alloca "a" {{.*}} init : !cir.ptr<!cir.ptr<!cir.complex<!cir.float>>>
// CHECK: %[[COMPLEX_SIZE:.*]] = cir.const #cir.int<8> : !u64i
-// CHECK: %[[NEW_COMPLEX:.*]] = cir.call @_Znwm(%[[COMPLEX_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[NEW_COMPLEX:.*]] = cir.call @_Znwm(%[[COMPLEX_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[COMPLEX_PTR:.*]] = cir.cast bitcast %[[NEW_COMPLEX]] : !cir.ptr<!void> -> !cir.ptr<!cir.complex<!cir.float>>
// CHECK: %[[COMPLEX_VAL:.*]] = cir.const #cir.const_complex<#cir.fp<1.000000e+00> : !cir.float, #cir.fp<2.000000e+00> : !cir.float> : !cir.complex<!cir.float>
// CHECK: cir.store{{.*}} %[[COMPLEX_VAL]], %[[COMPLEX_PTR]] : !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>
@@ -191,7 +191,7 @@ void t_new_constant_size() {
// CHECK: cir.func{{.*}} @_Z19t_new_constant_sizev()
// CHECK: %[[P_ADDR:.*]] = cir.alloca "p" align(8) init : !cir.ptr<!cir.ptr<!cir.double>>
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<128> : !u64i
-// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[TYPED_PTR:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!cir.double>
// CHECK: cir.store align(8) %[[TYPED_PTR]], %[[P_ADDR]] : !cir.ptr<!cir.double>, !cir.ptr<!cir.ptr<!cir.double>>
// CHECK: cir.return
@@ -220,7 +220,7 @@ void t_constant_size_nontrivial() {
// CHECK: %[[P_ADDR:.*]] = cir.alloca "p" align(8) init : !cir.ptr<!cir.ptr<!rec_C>>
// CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<3> : !u64i
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<11> : !u64i
-// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[COOKIE_PTR_BASE:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!u8i>
// CHECK: %[[COOKIE_PTR:.*]] = cir.cast bitcast %[[COOKIE_PTR_BASE]] : !cir.ptr<!u8i> -> !cir.ptr<!u64i>
// CHECK: cir.store align(8) %[[NUM_ELEMENTS]], %[[COOKIE_PTR]] : !u64i, !cir.ptr<!u64i>
@@ -260,7 +260,7 @@ void t_constant_size_nontrivial2() {
// CHECK: %[[P_ADDR:.*]] = cir.alloca "p" align(8) init : !cir.ptr<!cir.ptr<!rec_D>>
// CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<3> : !u64i
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<20> : !u64i
-// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[COOKIE_PTR_BASE:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!u8i>
// CHECK: %[[COOKIE_PTR:.*]] = cir.cast bitcast %[[COOKIE_PTR_BASE]] : !cir.ptr<!u8i> -> !cir.ptr<!u64i>
// CHECK: cir.store align(8) %[[NUM_ELEMENTS]], %[[COOKIE_PTR]] : !u64i, !cir.ptr<!u64i>
@@ -292,7 +292,7 @@ void t_align16_nontrivial() {
// CHECK: %[[P_ADDR:.*]] = cir.alloca "p" align(8) init : !cir.ptr<!cir.ptr<!rec_E>>
// CHECK: %[[NUM_ELEMENTS:.*]] = cir.const #cir.int<2> : !u64i
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<48> : !u64i
-// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[COOKIE_PTR_BASE:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!u8i>
// CHECK: %[[COOKIE_OFFSET:.*]] = cir.const #cir.int<8> : !s32i
// CHECK: %[[COOKIE_PTR_RAW:.*]] = cir.ptr_stride %[[COOKIE_PTR_BASE]], %[[COOKIE_OFFSET]] : (!cir.ptr<!u8i>, !s32i) -> !cir.ptr<!u8i>
@@ -330,7 +330,7 @@ void t_new_multidim_constant_size() {
// CHECK: cir.func{{.*}} @_Z28t_new_multidim_constant_sizev()
// CHECK: %[[P_ADDR:.*]] = cir.alloca "p" align(8) init : !cir.ptr<!cir.ptr<!cir.array<!cir.array<!cir.double x 4> x 3>>>
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<192> : !u64i
-// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[TYPED_PTR:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!cir.array<!cir.array<!cir.double x 4> x 3>>
// CHECK: cir.store align(8) %[[TYPED_PTR]], %[[P_ADDR]] : !cir.ptr<!cir.array<!cir.array<!cir.double x 4> x 3>>, !cir.ptr<!cir.ptr<!cir.array<!cir.array<!cir.double x 4> x 3>>>
// CHECK: }
@@ -351,7 +351,7 @@ void t_constant_size_memset_init() {
// CHECK: cir.func {{.*}} @_Z27t_constant_size_memset_initv()
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<64> : !u64i
-// CHECK: %[[ALLOC_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[ALLOC_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[ELEM_PTR:.*]] = cir.cast bitcast %[[ALLOC_PTR]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CHECK: %[[VOID_PTR:.*]] = cir.cast bitcast %[[ELEM_PTR]] : !cir.ptr<!s32i> -> !cir.ptr<!void>
// CHECK: %[[ZERO:.*]] = cir.const #cir.int<0> : !u8i
@@ -371,7 +371,7 @@ void t_constant_size_full_init() {
// CHECK: cir.func {{.*}} @_Z25t_constant_size_full_initv()
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<16> : !u64i
-// CHECK: %[[ALLOC_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[ALLOC_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[ELEM_0_PTR:.*]] = cir.cast bitcast %[[ALLOC_PTR]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CHECK: %[[CONST_ONE:.*]] = cir.const #cir.int<1> : !s32i
// CHECK: cir.store{{.*}} %[[CONST_ONE]], %[[ELEM_0_PTR]] : !s32i, !cir.ptr<!s32i>
@@ -414,7 +414,7 @@ void t_constant_size_partial_init() {
// CHECK: cir.func {{.*}} @_Z28t_constant_size_partial_initv()
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<64> : !u64i
-// CHECK: %[[ALLOC_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %[[ALLOC_PTR:.*]] = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CHECK: %[[ELEM_0_PTR:.*]] = cir.cast bitcast %[[ALLOC_PTR]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CHECK: %[[CONST_ONE:.*]] = cir.const #cir.int<1> : !s32i
// CHECK: cir.store{{.*}} %[[CONST_ONE]], %[[ELEM_0_PTR]] : !s32i, !cir.ptr<!s32i>
@@ -465,7 +465,7 @@ void t_new_huge_float_size() {
// CHECK: cir.func {{.*}} @_Z21t_new_huge_float_sizev()
// CHECK: %[[ALLOCATION_SIZE:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
-// CHECK: %{{.*}} = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+// CHECK: %{{.*}} = cir.call @_Znam(%[[ALLOCATION_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// LLVM: define{{.*}} void @_Z21t_new_huge_float_sizev()
// LLVM: %{{.*}} = call{{.*}} ptr @_Znam(i64{{.*}} -1)
@@ -479,7 +479,7 @@ void t_new_var_size(size_t n) {
// CHECK: cir.func {{.*}} @_Z14t_new_var_sizem
// CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]]
-// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[N]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[N]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// LLVM: define{{.*}} void @_Z14t_new_var_sizem
// LLVM: %[[N:.*]] = load i64, ptr %{{.+}}
@@ -496,7 +496,7 @@ void t_new_var_size2(int n) {
// CHECK: cir.func {{.*}} @_Z15t_new_var_size2i
// CHECK: %[[N:.*]] = cir.load{{.*}} %[[ARG_ALLOCA:.*]]
// CHECK: %[[N_SIZE_T:.*]] = cir.cast integral %[[N]] : !s32i -> !u64i
-// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[N_SIZE_T]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[N_SIZE_T]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// LLVM: define{{.*}} void @_Z15t_new_var_size2i
// LLVM: %[[N:.*]] = load i32, ptr %{{.+}}
@@ -518,7 +518,7 @@ void t_new_var_size3(size_t n) {
// CHECK: %[[RESULT:.*]], %[[OVERFLOW:.*]] = cir.mul.overflow %[[N]], %[[ELEMENT_SIZE]] : !u64i -> !u64i
// CHECK: %[[ALL_ONES:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CHECK: %[[ALLOC_SIZE:.*]] = cir.select if %[[OVERFLOW]] then %[[ALL_ONES]] else %[[RESULT]] : (!cir.bool, !u64i, !u64i)
-// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// LLVM: define{{.*}} void @_Z15t_new_var_size3m
// LLVM: %[[N:.*]] = load i64, ptr %{{.+}}
@@ -547,7 +547,7 @@ void t_new_var_size4(int n) {
// CHECK: %[[RESULT:.*]], %[[OVERFLOW:.*]] = cir.mul.overflow %[[N_SIZE_T]], %[[ELEMENT_SIZE]] : !u64i -> !u64i
// CHECK: %[[ALL_ONES:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CHECK: %[[ALLOC_SIZE:.*]] = cir.select if %[[OVERFLOW]] then %[[ALL_ONES]] else %[[RESULT]] : (!cir.bool, !u64i, !u64i)
-// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// LLVM: define{{.*}} void @_Z15t_new_var_size4i
// LLVM: %[[N:.*]] = load i32, ptr %{{.+}}
@@ -581,7 +581,7 @@ void t_new_var_size5(int n) {
// CHECK: %[[RESULT:.*]], %[[OVERFLOW:.*]] = cir.mul.overflow %[[N_SIZE_T]], %[[ELEMENT_SIZE]] : !u64i -> !u64i
// CHECK: %[[ALL_ONES:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CHECK: %[[ALLOC_SIZE:.*]] = cir.select if %[[OVERFLOW]] then %[[ALL_ONES]] else %[[RESULT]] : (!cir.bool, !u64i, !u64i)
-// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// LLVM: define{{.*}} void @_Z15t_new_var_size5i
// LLVM: %[[N:.*]] = load i32, ptr %{{.+}}
@@ -615,7 +615,7 @@ void t_new_var_size6(int n) {
// CHECK: %[[ANY_OVERFLOW:.*]] = cir.or %[[LT_MIN_SIZE]], %[[OVERFLOW]] : !cir.bool
// CHECK: %[[ALL_ONES:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CHECK: %[[ALLOC_SIZE:.*]] = cir.select if %[[ANY_OVERFLOW]] then %[[ALL_ONES]] else %[[RESULT]] : (!cir.bool, !u64i, !u64i)
-// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// CHECK: %[[PTR_DOUBLE:.*]] = cir.cast bitcast %[[PTR]] : !cir.ptr<!void> -> !cir.ptr<!cir.double>
// CHECK: %[[ELEM_0:.*]] = cir.const #cir.fp<1.000000e+00> : !cir.double
// CHECK: cir.store{{.*}} %[[ELEM_0]], %[[PTR_DOUBLE]]
@@ -684,7 +684,7 @@ void t_new_var_size7(__int128 n) {
// CHECK: %[[RESULT:.*]], %[[OVERFLOW:.*]] = cir.mul.overflow %[[N_SIZE_T]], %[[ELEMENT_SIZE]] : !u64i -> !u64i
// CHECK: %[[ALL_ONES:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CHECK: %[[ALLOC_SIZE:.*]] = cir.select if %[[OVERFLOW]] then %[[ALL_ONES]] else %[[RESULT]] : (!cir.bool, !u64i, !u64i)
-// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// LLVM: define{{.*}} void @_Z15t_new_var_size7n
// LLVM: %[[N:.*]] = load i128, ptr %{{.+}}
@@ -717,7 +717,7 @@ void t_new_var_size_nontrivial(size_t n) {
// CHECK: %[[ANY_OVERFLOW:.*]] = cir.or %[[OVERFLOW]], %[[OVERFLOW2]] : !cir.bool
// CHECK: %[[ALL_ONES:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CHECK: %[[ALLOC_SIZE:.*]] = cir.select if %[[ANY_OVERFLOW]] then %[[ALL_ONES]] else %[[SIZE]] : (!cir.bool, !u64i, !u64i)
-// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[PTR:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// LLVM: define{{.*}} void @_Z25t_new_var_size_nontrivialm
// LLVM: %[[N:.*]] = load i64, ptr %{{.+}}
@@ -755,7 +755,7 @@ void test_array_new_with_ctor_init() {
// CIR-BEFORE-LPP: cir.func {{.*}} @_Z29test_array_new_with_ctor_initv
// CIR-BEFORE-LPP: %[[P_ADDR:.*]] = cir.alloca "p" {{.*}} init : !cir.ptr<!cir.ptr<!rec_F>>
// CIR-BEFORE-LPP: %[[THREE:.*]] = cir.const #cir.int<3> : !u64i
-// CIR-BEFORE-LPP: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[THREE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CIR-BEFORE-LPP: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[THREE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// CIR-BEFORE-LPP: %[[BEGIN:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!rec_F>
// CIR-BEFORE-LPP: %[[ARRAY_PTR:.*]] = cir.cast bitcast %[[BEGIN]] : !cir.ptr<!rec_F> -> !cir.ptr<!cir.array<!rec_F x 3>>
// CIR-BEFORE-LPP: cir.array.ctor %[[ARRAY_PTR]] : !cir.ptr<!cir.array<!rec_F x 3>> {
@@ -768,7 +768,7 @@ void test_array_new_with_ctor_init() {
// CHECK: cir.func {{.*}} @_Z29test_array_new_with_ctor_initv
// CHECK: %[[P_ADDR:.*]] = cir.alloca "p" {{.*}} init : !cir.ptr<!cir.ptr<!rec_F>>
// CHECK: %[[THREE:.*]] = cir.const #cir.int<3> : !u64i
-// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[THREE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[THREE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// CHECK: %[[BEGIN:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!rec_F>
// CHECK: %[[ARRAY_PTR:.*]] = cir.cast bitcast %[[BEGIN]] : !cir.ptr<!rec_F> -> !cir.ptr<!cir.array<!rec_F x 3>>
// CHECK: %[[THREE_2:.*]] = cir.const #cir.int<3> : !u64i
@@ -1141,7 +1141,7 @@ void test_array_new_with_ctor_partial_init_list() {
// CIR-BEFORE-LPP: cir.func {{.*}} @_Z42test_array_new_with_ctor_partial_init_listv
// CIR-BEFORE-LPP: %[[P_ADDR:.*]] = cir.alloca "p" {{.*}} init : !cir.ptr<!cir.ptr<!rec_G>>
// CIR-BEFORE-LPP: %[[EIGHT:.*]] = cir.const #cir.int<8> : !u64i
-// CIR-BEFORE-LPP: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[EIGHT]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CIR-BEFORE-LPP: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[EIGHT]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// CIR-BEFORE-LPP: %[[BEGIN:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!rec_G>
// CIR-BEFORE-LPP: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CIR-BEFORE-LPP: cir.call @_ZN1GC1Ei(%[[BEGIN]], %[[ONE]]) : (!cir.ptr<!rec_G> {{.*}}, !s32i {llvm.noundef}) -> ()
@@ -1162,7 +1162,7 @@ void test_array_new_with_ctor_partial_init_list() {
// CHECK: cir.func {{.*}} @_Z42test_array_new_with_ctor_partial_init_listv
// CHECK: %[[P_ADDR:.*]] = cir.alloca "p" {{.*}} init : !cir.ptr<!cir.ptr<!rec_G>>
// CHECK: %[[EIGHT:.*]] = cir.const #cir.int<8> : !u64i
-// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[EIGHT]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: %[[RAW_PTR:.*]] = cir.call @_Znam(%[[EIGHT]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// CHECK: %[[BEGIN:.*]] = cir.cast bitcast %[[RAW_PTR]] : !cir.ptr<!void> -> !cir.ptr<!rec_G>
// CHECK: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CHECK: cir.call @_ZN1GC1Ei(%[[BEGIN]], %[[ONE]]) : (!cir.ptr<!rec_G> {{.*}}, !s32i {llvm.noundef}) -> ()
@@ -1241,7 +1241,7 @@ namespace gh227980 {
// CHECK-LABEL: cir.func{{.*}}@_ZN8gh22798015huge_float_sizeEv()
// CHECK: %[[NEG:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
-// CHECK: cir.call @_Znam(%[[NEG]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
+// CHECK: cir.call @_Znam(%[[NEG]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef})
// LLVM-LABEL: define {{.*}}@_ZN8gh22798015huge_float_sizeEv()
// LLVM: call{{.*}} ptr @_Znam(i64 noundef -1)
diff --git a/clang/test/CIR/CodeGen/operator-new-noalias.cpp b/clang/test/CIR/CodeGen/operator-new-noalias.cpp
index 469bcee63087a1..21a1f775627b93 100644
--- a/clang/test/CIR/CodeGen/operator-new-noalias.cpp
+++ b/clang/test/CIR/CodeGen/operator-new-noalias.cpp
@@ -11,14 +11,15 @@
void *test_new() { return new int; }
-// CIR: cir.call @_Znwm(%{{.*}}) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : {{.*}} -> (!cir.ptr<!void> {llvm.noalias{{.*}}})
+// CIR: cir.call @_Znwm(%{{.*}}) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : {{.*}} -> (!cir.ptr<!void> {llvm.noalias{{.*}}})
// LLVM: call noalias noundef nonnull ptr @_Znwm(i64 noundef 4) [[ATTR:#[0-9]+]]
// OGCG: call noalias noundef nonnull ptr @_Znwm(i64 noundef 4) [[ATTR:#[0-9]+]]
-// LLVM: attributes [[ATTR]] = { builtin allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) }
-// OGCG: attributes [[ATTR]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_Znwm" }
+// LLVM: attributes [[ATTR]] = { builtin allocsize(0) memory(errnomem: write, controlmem: readwrite) }
+// OGCG: attributes [[ATTR]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_Znwm" }
// NOSANE: call noundef nonnull ptr @_Znwm(i64 noundef 4) [[NOSANE_ATTR:#[0-9]+]]
// NOSANE-NOT: call noalias
// NOSANE: attributes [[NOSANE_ATTR]] = { builtin {{(allockind\("alloc,uninitialized"\) )?}}allocsize(0){{( "alloc-family"="_Znwm")?}} }
// NOSANE-NOT: inaccessiblemem
+// NOSANE-NOT: controlmem
diff --git a/clang/test/CIR/CodeGen/paren-list-agg-init.cpp b/clang/test/CIR/CodeGen/paren-list-agg-init.cpp
index c27c03fd0ba6b9..6d7b6371b266ce 100644
--- a/clang/test/CIR/CodeGen/paren-list-agg-init.cpp
+++ b/clang/test/CIR/CodeGen/paren-list-agg-init.cpp
@@ -789,7 +789,7 @@ namespace gh68198 {
// CIR-LABEL: cir.{{.*}}@_ZN7gh681985foo25Ev()
// CIR: %[[ARR_ALLOCA:.*]] = cir.alloca "arr8" align(8) init : !cir.ptr<!cir.ptr<!s32i>>
// CIR: %[[SIZE:.*]] = cir.const #cir.int<8> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_TO_ARR:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CIR: cir.store{{.*}} %[[ONE]], %[[ALLOC_TO_ARR]] : !s32i, !cir.ptr<!s32i>
@@ -819,7 +819,7 @@ namespace gh68198 {
// CIR-LABEL: cir.{{.*}}@_ZN7gh681985foo26Ev()
// CIR: %[[ARR_ALLOCA:.*]] = cir.alloca "arr9" align(8) init : !cir.ptr<!cir.ptr<!void>>
// CIR: %[[SIZE:.*]] = cir.const #cir.int<16> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_TO_ARR:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!cir.array<!s32i x 2>>
// CIR: %[[ELT0_0:.*]] = cir.cast array_to_ptrdecay %[[ALLOC_TO_ARR]] : !cir.ptr<!cir.array<!s32i x 2>> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
@@ -862,7 +862,7 @@ namespace gh68198 {
// CIR-LABEL: cir.{{.*}}@_ZN7gh681985foo27Ev()
// CIR: %[[ARR_ALLOCA:.*]] = cir.alloca "arr10" align(8) init : !cir.ptr<!cir.ptr<!void>>
// CIR: %[[SIZE:.*]] = cir.const #cir.int<32> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_TO_ARR:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!cir.array<!s32i x 2>>
// CIR: %[[ELT0_0:.*]] = cir.cast array_to_ptrdecay %[[ALLOC_TO_ARR]] : !cir.ptr<!cir.array<!s32i x 2>> -> !cir.ptr<!s32i>
// CIR: %[[FIVE:.*]] = cir.const #cir.int<5> : !s32i
diff --git a/clang/test/CIR/CodeGen/side-effect.cpp b/clang/test/CIR/CodeGen/side-effect.cpp
index bbab041c5465ee..126cf5711efe8e 100644
--- a/clang/test/CIR/CodeGen/side-effect.cpp
+++ b/clang/test/CIR/CodeGen/side-effect.cpp
@@ -30,112 +30,112 @@ __attribute__((const)) int const_flattened(TwoLong t);
// FIXME: We should figure out how to better print this on functions in the
// future.
-// CIR: cir.func{{.*}}@pure_func() -> !s32i attributes {{{.*}}nothrow, nounwind, optnone, willreturn, memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} {
+// CIR: cir.func{{.*}}@pure_func() -> !s32i attributes {{{.*}}nothrow, nounwind, optnone, willreturn, memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} {
__attribute__((pure))
int pure_func() { return 2;}
-// CIR: cir.func{{.*}}@const_func() -> !s32i attributes {{{.*}}nothrow, nounwind, optnone, willreturn, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
+// CIR: cir.func{{.*}}@const_func() -> !s32i attributes {{{.*}}nothrow, nounwind, optnone, willreturn, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
__attribute__((const))
int const_func() { return 1;}
-// CIR: cir.func{{.*}}@noalias_func(%{{[^,)]+}}: !cir.ptr<!s32i> {llvm.noundef}{{.*}}) -> !s32i attributes {{{.*}}nothrow, nounwind, optnone, memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = readwrite, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
+// CIR: cir.func{{.*}}@noalias_func(%{{[^,)]+}}: !cir.ptr<!s32i> {llvm.noundef}{{.*}}) -> !s32i attributes {{{.*}}nothrow, nounwind, optnone, memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = readwrite, errno_mem = none, target_mem0 = readwrite, target_mem1 = readwrite>} {
__declspec(noalias)
int noalias_func(int *p) { return *p; }
// Widened with no indirect slot in the signature: an ellipsis argument can be
// a pointer the declared parameters say nothing about.
-// CIR: cir.func{{.*}}@const_variadic(%{{[^,)]+}}: !s32i {llvm.noundef}{{.*}}, ...) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
+// CIR: cir.func{{.*}}@const_variadic(%{{[^,)]+}}: !s32i {llvm.noundef}{{.*}}, ...) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
__attribute__((const))
int const_variadic(int n, ...) { return n; }
// A definition also gets llvm.noalias on the sret slot, so this is where
// noalias, writable and the widened effect have to coexist.
-// CIR: cir.func{{.*}}@const_sret_def(%{{[^,)]+}}: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.dead_on_unwind, llvm.noalias, llvm.sret = !rec_Big, llvm.writable}{{.*}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
+// CIR: cir.func{{.*}}@const_sret_def(%{{[^,)]+}}: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.dead_on_unwind, llvm.noalias, llvm.sret = !rec_Big, llvm.writable}{{.*}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
__attribute__((const))
Big const_sret_def() { Big r{}; return r; }
-// CIR: cir.func{{.*}}@pure_sret_def(%{{[^,)]+}}: !cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}{{.*}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} {
+// CIR: cir.func{{.*}}@pure_sret_def(%{{[^,)]+}}: !cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}{{.*}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} {
__attribute__((pure))
Big pure_sret_def() { Big r{}; return r; }
void use() {
- // CIR: cir.call @pure_func() nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
+ // CIR: cir.call @pure_func() nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
pure_func();
- // CIR: cir.call @const_func() nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> !s32i
+ // CIR: cir.call @const_func() nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> !s32i
const_func();
int x = 0;
- // CIR: cir.call @noalias_func(%{{[^,)]+}}) nounwind {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = readwrite, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i> {llvm.noundef}) -> !s32i
+ // CIR: cir.call @noalias_func(%{{[^,)]+}}) nounwind {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = readwrite, errno_mem = none, target_mem0 = readwrite, target_mem1 = readwrite>} : (!cir.ptr<!s32i> {llvm.noundef}) -> !s32i
noalias_func(&x);
// The pass has already given these calls their sret operand.
- // CIR: cir.call @const_sret(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) -> ()
+ // CIR: cir.call @const_sret(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) -> ()
const_sret();
- // CIR: cir.call @pure_sret(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) -> ()
+ // CIR: cir.call @pure_sret(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) -> ()
pure_sret();
Big b{};
- // CIR: cir.call @const_byval(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i
+ // CIR: cir.call @const_byval(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i
const_byval(b);
- // CIR: cir.call @pure_byval(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i
+ // CIR: cir.call @pure_byval(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i
pure_byval(b);
// A record small enough to come back in a register hands the callee
// nothing, so the return side leaves the effects alone.
- // CIR: cir.call @const_small() nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> !s32i
+ // CIR: cir.call @const_small() nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> !s32i
const_small();
// A pointer the source wrote is not memory the ABI handed over.
- // CIR: cir.call @const_ptr(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i> {llvm.noundef}) -> !s32i
+ // CIR: cir.call @const_ptr(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i> {llvm.noundef}) -> !s32i
const_ptr(&x);
// A call passes a fixed argument list, so neither of these widens even
// though both callees are variadic and both were widened themselves.
- // CIR: cir.call @const_variadic(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s32i {llvm.noundef}) -> !s32i
+ // CIR: cir.call @const_variadic(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s32i {llvm.noundef}) -> !s32i
const_variadic(1);
- // CIR: cir.call @const_variadic_decl(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s32i {llvm.noundef}) -> !s32i
+ // CIR: cir.call @const_variadic_decl(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s32i {llvm.noundef}) -> !s32i
const_variadic_decl(1);
// A leading direct argument puts the byval slot at index 1.
- // CIR: cir.call @const_byval2(%{{[^,)]+}}, %{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s32i {llvm.noundef}, !cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i
+ // CIR: cir.call @const_byval2(%{{[^,)]+}}, %{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s32i {llvm.noundef}, !cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i
const_byval2(1, b);
- // CIR: cir.call @const_sret_def(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) -> ()
+ // CIR: cir.call @const_sret_def(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) -> ()
const_sret_def();
// A reference parameter is a pointer the source wrote, not a slot the ABI
// introduced.
- // CIR: cir.call @const_bigref(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.dereferenceable = 32 : i64, llvm.nonnull, llvm.noundef}) -> !s32i
+ // CIR: cir.call @const_bigref(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.dereferenceable = 32 : i64, llvm.nonnull, llvm.noundef}) -> !s32i
const_bigref(b);
// A class with a non-trivial destructor passes indirectly without byval,
// and widens the same as byval does.
WithDtor w{};
- // CIR: cir.call @const_non_byval(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_WithDtor> {{{.*}}llvm.nofreeobj{{.*}}}) -> !s32i
+ // CIR: cir.call @const_non_byval(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_WithDtor> {{{.*}}llvm.nofreeobj{{.*}}}) -> !s32i
const_non_byval(w);
// The remaining argument rewrites hand the callee no memory: the argument
// is dropped, coerced into a register, or flattened into registers.
- // CIR: cir.call @const_ignore() nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> !s32i
+ // CIR: cir.call @const_ignore() nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> !s32i
const_ignore(Empty{});
- // CIR: cir.call @const_coerced(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!u64i) -> !s32i
+ // CIR: cir.call @const_coerced(%{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!u64i) -> !s32i
const_coerced(SmallPair{});
- // CIR: cir.call @const_flattened(%{{[^,)]+}}, %{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s64i, !s64i) -> !s32i
+ // CIR: cir.call @const_flattened(%{{[^,)]+}}, %{{[^,)]+}}) nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!s64i, !s64i) -> !s32i
const_flattened(TwoLong{});
}
// The declarations print after @use(), in the order the calls above reach
// them.
-// CIR: cir.func private @const_sret(!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @pure_sret(!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
-// CIR: cir.func private @const_byval(!cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @pure_byval(!cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
-// CIR: cir.func private @const_small() -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @const_ptr(!cir.ptr<!s32i> {llvm.noundef}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @const_variadic_decl(!s32i {llvm.noundef}, ...) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @const_byval2(!s32i {llvm.noundef}, !cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @const_bigref(!cir.ptr<!rec_Big> {{{.*}}llvm.nonnull{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @const_non_byval(!cir.ptr<!rec_WithDtor> {{{.*}}llvm.nofreeobj{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @const_ignore() -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @const_coerced(!u64i) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
-// CIR: cir.func private @const_flattened(!s64i, !s64i) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_sret(!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @pure_sret(!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
+// CIR: cir.func private @const_byval(!cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @pure_byval(!cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
+// CIR: cir.func private @const_small() -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_ptr(!cir.ptr<!s32i> {llvm.noundef}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_variadic_decl(!s32i {llvm.noundef}, ...) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_byval2(!s32i {llvm.noundef}, !cir.ptr<!rec_Big> {{{.*}}llvm.byval = !rec_Big{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_bigref(!cir.ptr<!rec_Big> {{{.*}}llvm.nonnull{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_non_byval(!cir.ptr<!rec_WithDtor> {{{.*}}llvm.nofreeobj{{.*}}}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_ignore() -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_coerced(!u64i) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+// CIR: cir.func private @const_flattened(!s64i, !s64i) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
}
diff --git a/clang/test/CIR/CodeGenBuiltins/builtin-new-delete.cpp b/clang/test/CIR/CodeGenBuiltins/builtin-new-delete.cpp
index 5ca1e6a0f5d9e0..8671ed5fa70ac9 100644
--- a/clang/test/CIR/CodeGenBuiltins/builtin-new-delete.cpp
+++ b/clang/test/CIR/CodeGenBuiltins/builtin-new-delete.cpp
@@ -9,7 +9,7 @@
void test_builtins_basic() {
__builtin_operator_delete(__builtin_operator_new(4));
// CIR-LABEL: test_builtins_basic
- // CIR: [[P:%.*]] = cir.call @_Znwm({{%.*}}) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: [[P:%.*]] = cir.call @_Znwm({{%.*}}) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: cir.call @_ZdlPv([[P]]) {{.*}}builtin{{.*}} : (!cir.ptr<!void> {llvm.noundef}) -> ()
// CIR: cir.return
@@ -28,7 +28,7 @@ void test_sized_delete() {
__builtin_operator_delete(__builtin_operator_new(4), 4);
// CIR-LABEL: test_sized_delete
- // CIR: [[P:%.*]] = cir.call @_Znwm({{%.*}}) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: [[P:%.*]] = cir.call @_Znwm({{%.*}}) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: cir.call @_ZdlPvm([[P]], {{%.*}}) {{.*}}builtin{{.*}} : (!cir.ptr<!void> {llvm.noundef}, !u64i {llvm.noundef}) -> ()
// CIR: cir.return
@@ -43,7 +43,7 @@ void test_sized_delete() {
// OGCG: ret void
}
-// LLVM-DAG: attributes #[[ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}memory(inaccessiblemem: readwrite, errnomem: write){{.*}}}
+// LLVM-DAG: attributes #[[ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}memory(errnomem: write, controlmem: readwrite){{.*}}}
// LLVM-DAG: attributes #[[ATTR_BUILTIN_DEL]] = {{{.*}}builtin{{.*}}}
// OGCG-DAG: attributes #[[OGCG_ATTR_BUILTIN_NEW]] = {{{.*}}builtin{{.*}}}
// OGCG-DAG: attributes #[[OGCG_ATTR_BUILTIN_DEL]] = {{{.*}}builtin{{.*}}}
diff --git a/clang/test/CIR/CodeGenCXX/new-array-init.cpp b/clang/test/CIR/CodeGenCXX/new-array-init.cpp
index 183c9aac2a3dbf..2f5060b11b8336 100644
--- a/clang/test/CIR/CodeGenCXX/new-array-init.cpp
+++ b/clang/test/CIR/CodeGenCXX/new-array-init.cpp
@@ -27,7 +27,7 @@ void fn(int n) {
// 64 bit all 1s
// CIR: %[[ALL_ONES:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CIR: %[[ADJ_SIZE:.*]] = cir.select if %[[LT_THREE_OR_OVRFL]] then %[[ALL_ONES]] else %[[N_IN_BYTES]] : (!cir.bool, !u64i, !u64i) -> !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[ADJ_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[ADJ_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_TO_INTS:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CIR: cir.store {{.*}}%[[ONE]], %[[ALLOC_TO_INTS]] : !s32i, !cir.ptr<!s32i>
@@ -82,7 +82,7 @@ void fn_paren(int n) {
// 64 bit all 1s
// CIR: %[[ALL_ONES:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CIR: %[[ADJ_SIZE:.*]] = cir.select if %[[LT_THREE_OR_OVRFL]] then %[[ALL_ONES]] else %[[N_IN_BYTES]] : (!cir.bool, !u64i, !u64i) -> !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[ADJ_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[ADJ_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_TO_INTS:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CIR: cir.store {{.*}}%[[ONE]], %[[ALLOC_TO_INTS]] : !s32i, !cir.ptr<!s32i>
@@ -127,7 +127,7 @@ void fn_paren(int n) {
// LLVM-LABEL: define{{.*}} void @_Z11const_exactv
void const_exact() {
// CIR: %[[ALLOC_SIZE:.*]] = cir.const #cir.int<12> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[ALLOC_SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_TO_INTS:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CIR: cir.store {{.*}}%[[ONE]], %[[ALLOC_TO_INTS]] : !s32i, !cir.ptr<!s32i>
@@ -158,7 +158,7 @@ void const_exact() {
// LLVM-LABEL: define{{.*}} void @_Z17const_exact_parenv
void const_exact_paren() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<12> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CIR: cir.store {{.*}} %[[ONE]], %[[ALLOC_CAST]] : !s32i, !cir.ptr<!s32i>
@@ -188,7 +188,7 @@ void const_exact_paren() {
// LLVM-LABEL: define{{.*}} void @_Z16const_sufficientv
void const_sufficient() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<16> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_INTS:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CIR: cir.store {{.*}} %[[ONE]], %[[ALLOC_INTS]] : !s32i, !cir.ptr<!s32i>
@@ -225,7 +225,7 @@ void const_sufficient() {
// LLVM-LABEL: define{{.*}} void @_Z22const_sufficient_parenv
void const_sufficient_paren() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<16> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_INTS:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
// CIR: cir.store {{.*}} %[[ONE]], %[[ALLOC_INTS]] : !s32i, !cir.ptr<!s32i>
@@ -287,7 +287,7 @@ void string_nonconst(int n) {
// CIR: %[[N_LT_4:.*]] = cir.cmp lt %[[N_CAST]], %[[FOUR]] : !u64i
// CIR: %[[NEG_ONE:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CIR: %[[SIZE:.*]] = cir.select if %[[N_LT_4]] then %[[NEG_ONE]] else %[[N_CAST]] : (!cir.bool, !u64i, !u64i) -> !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_AS_STRING:.*]] = cir.cast bitcast %[[ALLOC_CAST]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 4>>
// CIR: %[[GET_STR:.*]] = cir.get_global @[[ABC4]] : !cir.ptr<!cir.array<!s8i x 4>>
@@ -323,7 +323,7 @@ void string_nonconst_paren(int n) {
// CIR: %[[N_LT_4:.*]] = cir.cmp lt %[[N_CAST]], %[[FOUR]] : !u64i
// CIR: %[[NEG_ONE:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CIR: %[[SIZE:.*]] = cir.select if %[[N_LT_4]] then %[[NEG_ONE]] else %[[N_CAST]] : (!cir.bool, !u64i, !u64i) -> !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_AS_STRING:.*]] = cir.cast bitcast %[[ALLOC_CAST]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 4>>
// CIR: %[[GET_STR:.*]] = cir.get_global @[[ABC4]] : !cir.ptr<!cir.array<!s8i x 4>>
@@ -359,7 +359,7 @@ void string_nonconst_paren_extra_paren(int n) {
// CIR: %[[N_LT_4:.*]] = cir.cmp lt %[[N_CAST]], %[[FOUR]] : !u64i
// CIR: %[[NEG_ONE:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CIR: %[[SIZE:.*]] = cir.select if %[[N_LT_4]] then %[[NEG_ONE]] else %[[N_CAST]] : (!cir.bool, !u64i, !u64i) -> !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_AS_STRING:.*]] = cir.cast bitcast %[[ALLOC_CAST]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 4>>
// CIR: %[[GET_STR:.*]] = cir.get_global @[[ABC4]] : !cir.ptr<!cir.array<!s8i x 4>>
@@ -389,7 +389,7 @@ void string_nonconst_paren_extra_paren(int n) {
// LLVM-LABEL: define{{.*}} void @_Z12string_exactv
void string_exact() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<4> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_AS_STRING:.*]] = cir.cast bitcast %[[ALLOC_CAST]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 4>>
// CIR: %[[GET_STR:.*]] = cir.get_global @[[ABC4]] : !cir.ptr<!cir.array<!s8i x 4>>
@@ -405,7 +405,7 @@ void string_exact() {
// LLVM-LABEL: define{{.*}} void @_Z18string_exact_parenv
void string_exact_paren() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<4> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_AS_STRING:.*]] = cir.cast bitcast %[[ALLOC_CAST]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 4>>
// CIR: %[[GET_STR:.*]] = cir.get_global @[[ABC4]] : !cir.ptr<!cir.array<!s8i x 4>>
@@ -421,7 +421,7 @@ void string_exact_paren() {
// LLVM-LABEL: define{{.*}} void @_Z28string_exact_paren_extensionv
void string_exact_paren_extension() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<4> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_AS_STRING:.*]] = cir.cast bitcast %[[ALLOC_CAST]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 4>>
// CIR: %[[GET_STR:.*]] = cir.get_global @[[ABC4]] : !cir.ptr<!cir.array<!s8i x 4>>
@@ -437,7 +437,7 @@ void string_exact_paren_extension() {
// LLVM-LABEL: define{{.*}} void @_Z17string_sufficientv
void string_sufficient() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<15> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_AS_STRING:.*]] = cir.cast bitcast %[[ALLOC_CAST]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 15>>
// CIR: %[[GET_STR:.*]] = cir.get_global @[[ABC15]] : !cir.ptr<!cir.array<!s8i x 15>>
@@ -453,7 +453,7 @@ void string_sufficient() {
// LLVM-LABEL: define{{.*}} void @_Z23string_sufficient_parenv
void string_sufficient_paren() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<15> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_AS_STRING:.*]] = cir.cast bitcast %[[ALLOC_CAST]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 15>>
// CIR: %[[GET_STR:.*]] = cir.get_global @[[ABC15]] : !cir.ptr<!cir.array<!s8i x 15>>
@@ -469,7 +469,7 @@ void string_sufficient_paren() {
// LLVM-LABEL: define{{.*}} void @_Z10aggr_exactv
void aggr_exact() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<16> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!rec_Aggr>
// CIR: %[[GET_A:.*]] = cir.get_member %[[ALLOC_CAST]][0] {name = "a"} : !cir.ptr<!rec_Aggr> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
@@ -518,7 +518,7 @@ void aggr_sufficient(int n) {
// CIR: %[[N_LT_OR_OF:.*]] = cir.or %[[N_LT_2]], %[[MUL_OF]] : !cir.bool
// CIR: %[[NEG_ONE:.*]] = cir.const #cir.int<18446744073709551615> : !u64i
// CIR: %[[SIZE:.*]] = cir.select if %[[N_LT_OR_OF]] then %[[NEG_ONE]] else %[[N_BYTES]] : (!cir.bool, !u64i, !u64i) -> !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CAST:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!rec_Aggr2E0>
// CIR: %[[GET_A:.*]] = cir.get_member %[[ALLOC_CAST]][0] {name = "a"} : !cir.ptr<!rec_Aggr2E0> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
@@ -572,7 +572,7 @@ void aggr_sufficient(int n) {
// LLVM-LABEL: define{{.*}} void @_Z14constexpr_testv
void constexpr_test() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<4> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_INTS:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s32i>
// CIR: %[[ZERO:.*]] = cir.const #cir.int<0> : !s32i
// CIR: cir.store {{.*}} %[[ZERO]], %[[ALLOC_INTS]] : !s32i, !cir.ptr<!s32i>
@@ -590,7 +590,7 @@ void constexpr_test() {
// LLVM-LABEL: define{{.*}} void @_Z13unknown_boundv
void unknown_bound() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<24> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_AGG:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!rec_Aggr2E1>
// CIR: %[[GET_X:.*]] = cir.get_member %[[ALLOC_AGG]][0] {name = "x"} : !cir.ptr<!rec_Aggr2E1> -> !cir.ptr<!s32i>
// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i
@@ -638,7 +638,7 @@ void unknown_bound() {
// LLVM-LABEL: define{{.*}} void @_Z20unknown_bound_stringv
void unknown_bound_string() {
// CIR: %[[SIZE:.*]] = cir.const #cir.int<6> : !u64i
- // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
+ // CIR: %[[ALLOC:.*]] = cir.call @_Znam(%[[SIZE]]) {allocsize = array<i32: 0>, builtin, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = readwrite, errno_mem = write, target_mem0 = none, target_mem1 = none>} : (!u64i {llvm.noundef}) -> (!cir.ptr<!void> {llvm.noalias, llvm.nonnull, llvm.noundef})
// CIR: %[[ALLOC_CHAR:.*]] = cir.cast bitcast %[[ALLOC]] : !cir.ptr<!void> -> !cir.ptr<!s8i>
// CIR: %[[ALLOC_STR:.*]] = cir.cast bitcast %[[ALLOC_CHAR]] : !cir.ptr<!s8i> -> !cir.ptr<!cir.array<!s8i x 6>>
// CIR: %[[GET_HELLO:.*]] = cir.get_global @[[HELLO]] : !cir.ptr<!cir.array<!s8i x 6>>
diff --git a/clang/test/CIR/IR/call.cir b/clang/test/CIR/IR/call.cir
index 0113e89bbbff19..d29aca5c05eb49 100644
--- a/clang/test/CIR/IR/call.cir
+++ b/clang/test/CIR/IR/call.cir
@@ -10,9 +10,9 @@ cir.func @f2() {
cir.call @f1() : () -> ()
cir.call @f1() nounwind : () -> ()
cir.call @f1() willreturn : () -> ()
- cir.call @f1() {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> ()
- cir.call @f1() nothrow nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> ()
- cir.call @f1() {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = write, errno_mem = read, target_mem0 = read, target_mem1 = none>} : () -> ()
+ cir.call @f1() {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> ()
+ cir.call @f1() nothrow nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> ()
+ cir.call @f1() {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = write, errno_mem = read, target_mem0 = read, target_mem1 = none>} : () -> ()
cir.return
}
@@ -20,19 +20,19 @@ cir.func @f2() {
// CHECK-NEXT: cir.call @f1() : () -> ()
// CHECK-NEXT: cir.call @f1() nounwind : () -> ()
// CHECK-NEXT: cir.call @f1() willreturn : () -> ()
-// CHECK-NEXT: cir.call @f1() {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> ()
-// CHECK-NEXT: cir.call @f1() nothrow nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> ()
-// CHECK-NEXT: cir.call @f1() {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = write, errno_mem = read, target_mem0 = read, target_mem1 = none>} : () -> ()
+// CHECK-NEXT: cir.call @f1() {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> ()
+// CHECK-NEXT: cir.call @f1() nothrow nounwind willreturn {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : () -> ()
+// CHECK-NEXT: cir.call @f1() {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = write, errno_mem = read, target_mem0 = read, target_mem1 = none>} : () -> ()
// CHECK-NEXT: cir.return
// CHECK-NEXT: }
-// CHECK: cir.func private @f8() attributes {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = write, errno_mem = read, target_mem0 = read, target_mem1 = none>}
-cir.func private @f8() attributes {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = write, errno_mem = read, target_mem0 = read, target_mem1 = none>}
+// CHECK: cir.func private @f8() attributes {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = write, errno_mem = read, target_mem0 = read, target_mem1 = none>}
+cir.func private @f8() attributes {memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = write, errno_mem = read, target_mem0 = read, target_mem1 = none>}
-// CHECK: cir.func{{.*}} @f9() attributes {nothrow, nounwind, willreturn, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
+// CHECK: cir.func{{.*}} @f9() attributes {nothrow, nounwind, willreturn, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
// CHECK-NEXT: cir.return
// CHECK-NEXT: }
-cir.func @f9() attributes {nothrow, nounwind, willreturn, memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
+cir.func @f9() attributes {nothrow, nounwind, willreturn, memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} {
cir.return
}
diff --git a/clang/test/CIR/Lowering/memory-effects.cir b/clang/test/CIR/Lowering/memory-effects.cir
index 9a1c73021876dd..1d2b2d106a6fb4 100644
--- a/clang/test/CIR/Lowering/memory-effects.cir
+++ b/clang/test/CIR/Lowering/memory-effects.cir
@@ -4,19 +4,19 @@
!s32i = !cir.int<s, 32>
module {
- cir.func private @reads() -> !s32i attributes {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
+ cir.func private @reads() -> !s32i attributes {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
cir.func private @reads_nounwind() -> !s32i
- attributes {nounwind, willreturn, memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
+ attributes {nounwind, willreturn, memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
cir.func private @writes_args(!cir.ptr<!s32i>)
- attributes {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
- cir.func private @distinct() -> !s32i attributes {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = write, errno_mem = read, target_mem0 = readwrite, target_mem1 = none>}
+ attributes {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>}
+ cir.func private @distinct() -> !s32i attributes {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = write, errno_mem = read, target_mem0 = readwrite, target_mem1 = none>}
cir.func private @only_nounwind() -> !s32i attributes {nounwind}
cir.func private @only_willreturn() -> !s32i attributes {willreturn}
cir.func @caller(%arg0: !cir.ptr<!s32i>) {
- %0 = cir.call @reads() {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
- %1 = cir.call @reads_nounwind() nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
- cir.call @writes_args(%arg0) {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i>) -> ()
+ %0 = cir.call @reads() {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
+ %1 = cir.call @reads_nounwind() nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
+ cir.call @writes_args(%arg0) {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i>) -> ()
%2 = cir.call @only_nounwind() nounwind : () -> !s32i
%3 = cir.call @only_willreturn() willreturn : () -> !s32i
cir.return
@@ -43,6 +43,6 @@ module {
// LLVM-DAG: attributes #[[READS]] = { memory(read) }
// LLVM-DAG: attributes #[[BOTH]] = { nounwind willreturn memory(read) }
// LLVM-DAG: attributes #[[ARGMEM]] = { memory(argmem: readwrite) }
-// LLVM-DAG: attributes #[[DISTINCT]] = { memory(inaccessiblemem: write, errnomem: read, target_mem0: readwrite) }
+// LLVM-DAG: attributes #[[DISTINCT]] = { memory(errnomem: read, controlmem: write, target_mem0: readwrite) }
// LLVM-DAG: attributes #[[NUW]] = { nounwind }
// LLVM-DAG: attributes #[[WR]] = { willreturn }
diff --git a/clang/test/CIR/Transforms/abi-lowering/memory-effects-argmem-indirect.cir b/clang/test/CIR/Transforms/abi-lowering/memory-effects-argmem-indirect.cir
index 5595a6920556c7..d8e6e7bbde350e 100644
--- a/clang/test/CIR/Transforms/abi-lowering/memory-effects-argmem-indirect.cir
+++ b/clang/test/CIR/Transforms/abi-lowering/memory-effects-argmem-indirect.cir
@@ -5,7 +5,7 @@
!rec_Big = !cir.struct<"Big" {data !s64i, data !s64i, data !s64i, data !s64i}>
#none = #cir.memory_effects<other = none, arg_mem = none,
- inaccessible_mem = none, errno_mem = none,
+ control_mem = none, errno_mem = none,
target_mem0 = none, target_mem1 = none>
module attributes {
@@ -24,7 +24,7 @@ module attributes {
}
// CHECK: cir.func{{.*}} @call_byval
- // CHECK: cir.call %{{[^(]+}}(%{{[^,)]+}}) {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>>, !cir.ptr<!rec_Big>
+ // CHECK: cir.call %{{[^(]+}}(%{{[^,)]+}}) {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!rec_Big>) -> !s64i>>, !cir.ptr<!rec_Big>
// CHECK-SAME: llvm.byval = !rec_Big
// CHECK-SAME: -> !s64i
@@ -37,6 +37,6 @@ module attributes {
}
// CHECK: cir.func{{.*}} @call_scalar
- // CHECK-NEXT: cir.call %{{[^(]+}}(%{{[^,)]+}}) {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!s32i) -> !s32i>>, !s32i) -> !s32i
+ // CHECK-NEXT: cir.call %{{[^(]+}}(%{{[^,)]+}}) {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!s32i) -> !s32i>>, !s32i) -> !s32i
}
diff --git a/clang/test/CIR/Transforms/abi-lowering/memory-effects-argmem.cir b/clang/test/CIR/Transforms/abi-lowering/memory-effects-argmem.cir
index 5c1352d639cfd7..5c449de450599d 100644
--- a/clang/test/CIR/Transforms/abi-lowering/memory-effects-argmem.cir
+++ b/clang/test/CIR/Transforms/abi-lowering/memory-effects-argmem.cir
@@ -7,15 +7,15 @@
!rec_Big = !cir.struct<"Big" {data !s64i, data !s64i, data !s64i}>
#none = #cir.memory_effects<other = none, arg_mem = none,
- inaccessible_mem = none, errno_mem = none,
+ control_mem = none, errno_mem = none,
target_mem0 = none, target_mem1 = none>
#read = #cir.memory_effects<other = read, arg_mem = read,
- inaccessible_mem = read, errno_mem = read,
+ control_mem = read, errno_mem = read,
target_mem0 = read, target_mem1 = read>
#argmem = #cir.memory_effects<other = none, arg_mem = readwrite,
- inaccessible_mem = none, errno_mem = none,
+ control_mem = none, errno_mem = none,
target_mem0 = none, target_mem1 = none>
// The leading direct argument puts the byval slot at index 1.
@@ -63,36 +63,36 @@ module attributes {
cir.func private @const_sret() -> !rec_Big
requires_call_conv_lowering attributes { memory_effects = #none, test_classify = #sret_ret }
- // CHECK: cir.func{{.*}} @const_sret(!cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.dead_on_unwind, llvm.sret = !rec_Big, llvm.writable}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
+ // CHECK: cir.func{{.*}} @const_sret(!cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.dead_on_unwind, llvm.sret = !rec_Big, llvm.writable}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
cir.func private @pure_sret() -> !rec_Big
requires_call_conv_lowering attributes { memory_effects = #read, test_classify = #sret_ret }
- // CHECK: cir.func{{.*}} @pure_sret(!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>
+ // CHECK: cir.func{{.*}} @pure_sret(!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = read, arg_mem = readwrite, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>
cir.func private @const_byval(!s32i, !rec_Big)
requires_call_conv_lowering attributes { memory_effects = #none, test_classify = #byval_arg }
- // CHECK: cir.func{{.*}} @const_byval(!s32i, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
+ // CHECK: cir.func{{.*}} @const_byval(!s32i, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
// An indirect argument without byval widens the same as byval.
cir.func private @const_non_byval(!rec_Big)
requires_call_conv_lowering attributes { memory_effects = #none, test_classify = #non_byval_arg }
- // CHECK: cir.func{{.*}} @const_non_byval(!cir.ptr<!rec_Big> {{{.*}}llvm.nofreeobj{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
+ // CHECK: cir.func{{.*}} @const_non_byval(!cir.ptr<!rec_Big> {{{.*}}llvm.nofreeobj{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
// Variadic with no indirect slot in the signature.
cir.func private @const_variadic(!s8i, ...) -> !s32i
requires_call_conv_lowering attributes { memory_effects = #none, test_classify = #extend_arg }
- // CHECK: cir.func{{.*}} @const_variadic(!s8i {llvm.noundef, llvm.signext}, ...) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
+ // CHECK: cir.func{{.*}} @const_variadic(!s8i {llvm.noundef, llvm.signext}, ...) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
// An Extend argument is rewritten but hands the callee no memory, so the
// effects stay as written.
cir.func private @const_extend(!s8i) -> !s32i
requires_call_conv_lowering attributes { memory_effects = #none, test_classify = #extend_arg }
- // CHECK: cir.func{{.*}} @const_extend(!s8i {llvm.noundef, llvm.signext}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
+ // CHECK: cir.func{{.*}} @const_extend(!s8i {llvm.noundef, llvm.signext}) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
// Expand replaces the record with its fields, handing the callee no
// memory. Only the hook reaches this, since no x86_64 classification
@@ -100,13 +100,13 @@ module attributes {
cir.func private @const_expand(!rec_Big) -> !s32i
requires_call_conv_lowering attributes { memory_effects = #none, test_classify = #expand_arg }
- // CHECK: cir.func{{.*}} @const_expand(!s64i, !s64i, !s64i) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
+ // CHECK: cir.func{{.*}} @const_expand(!s64i, !s64i, !s64i) -> !s32i attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
// Already widened on the way in, so widening it again changes nothing.
cir.func private @prewidened_sret() -> !rec_Big
requires_call_conv_lowering attributes { memory_effects = #argmem, test_classify = #sret_ret }
- // CHECK: cir.func{{.*}} @prewidened_sret(!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
+ // CHECK: cir.func{{.*}} @prewidened_sret(!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) attributes {{{.*}}memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>
// A callee with no recorded effects must still come out with none, so that
// forwarding the original is distinguishable from hard-coding a value.
@@ -139,5 +139,5 @@ module attributes {
}
// CHECK: cir.func{{.*}} @call_const_sret()
- // CHECK: cir.call @const_sret(%{{[^,)]+}}) {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) -> ()
+ // CHECK: cir.call @const_sret(%{{[^,)]+}}) {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!rec_Big> {{{.*}}llvm.sret = !rec_Big{{.*}}}) -> ()
}
diff --git a/clang/test/CIR/Transforms/abi-lowering/x86_64-indirect-variadic.cir b/clang/test/CIR/Transforms/abi-lowering/x86_64-indirect-variadic.cir
index 15dccccfb0e319..9239c2f5e8d84b 100644
--- a/clang/test/CIR/Transforms/abi-lowering/x86_64-indirect-variadic.cir
+++ b/clang/test/CIR/Transforms/abi-lowering/x86_64-indirect-variadic.cir
@@ -13,7 +13,7 @@
!rec_NoRegs = !cir.struct<"NoRegs" {data !s32i, data !s32i}>
#none = #cir.memory_effects<other = none, arg_mem = none,
- inaccessible_mem = none, errno_mem = none,
+ control_mem = none, errno_mem = none,
target_mem0 = none, target_mem1 = none>
module attributes {
@@ -199,9 +199,9 @@ module attributes {
}
// CHECK-LABEL: cir.func {{.*}}@indirect_big_none(%arg0: !cir.ptr<!cir.func<(!cir.ptr<!s8i>, ...) -> !s32i>>, %arg1: !cir.ptr<!s8i>, %arg2: !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef})
- // CHECK: %{{.+}} = cir.call %arg0(%arg1, %{{.+}}) {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!s8i>, ...) -> !s32i>>, !cir.ptr<!s8i>, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> !s32i
+ // CHECK: %{{.+}} = cir.call %arg0(%arg1, %{{.+}}) {memory_effects = #cir.memory_effects<other = none, arg_mem = readwrite, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!s8i>, ...) -> !s32i>>, !cir.ptr<!s8i>, !cir.ptr<!rec_Big> {llvm.align = 8 : i64, llvm.byval = !rec_Big, llvm.noundef}) -> !s32i
// CHECK-LABEL: cir.func {{.*}}@indirect_scalar_none(%arg0: !cir.ptr<!cir.func<(!cir.ptr<!s8i>, ...) -> !s32i>>, %arg1: !cir.ptr<!s8i>, %arg2: !s32i)
- // CHECK: %{{.+}} = cir.call %arg0(%arg1, %arg2) {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!s8i>, ...) -> !s32i>>, !cir.ptr<!s8i>, !s32i) -> !s32i
+ // CHECK: %{{.+}} = cir.call %arg0(%arg1, %arg2) {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!s8i>, ...) -> !s32i>>, !cir.ptr<!s8i>, !s32i) -> !s32i
// LLVM-LABEL: define void @indirect_big_none(
// LLVM: call i32 (ptr, ...) %{{[^,)]+}}(ptr %{{[^,)]+}}, ptr noundef byval(%struct.Big) align 8 %{{[^,)]+}}) #[[WIDE:[0-9]+]]
diff --git a/clang/test/CIR/Transforms/flatten-preserve-attrs.cir b/clang/test/CIR/Transforms/flatten-preserve-attrs.cir
index 42a27b7c710e1f..b96853f87bf85a 100644
--- a/clang/test/CIR/Transforms/flatten-preserve-attrs.cir
+++ b/clang/test/CIR/Transforms/flatten-preserve-attrs.cir
@@ -48,7 +48,7 @@ cir.func @test_preserve_res_attrs() {
cir.func @test_preserve_memory_effects() {
cir.scope {
cir.try {
- %0 = cir.call @pureFunc() {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
+ %0 = cir.call @pureFunc() {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
cir.yield
} catch all (%eh_token : !cir.eh_token) {
%catch_token, %exn_ptr = cir.begin_catch %eh_token : !cir.eh_token -> (!cir.catch_token, !cir.ptr<!cir.void>)
@@ -60,13 +60,13 @@ cir.func @test_preserve_memory_effects() {
}
// CHECK-LABEL: cir.func @test_preserve_memory_effects()
-// CHECK: cir.try_call @pureFunc() ^{{bb[0-9]+}}, ^{{bb[0-9]+}} {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
+// CHECK: cir.try_call @pureFunc() ^{{bb[0-9]+}}, ^{{bb[0-9]+}} {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
// Test that nounwind and willreturn are preserved on the cir.try_call.
cir.func @test_preserve_nounwind_willreturn() {
cir.scope {
cir.try {
- %0 = cir.call @pureFunc() nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
+ %0 = cir.call @pureFunc() nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
cir.yield
} catch all (%eh_token : !cir.eh_token) {
%catch_token, %exn_ptr = cir.begin_catch %eh_token : !cir.eh_token -> (!cir.catch_token, !cir.ptr<!cir.void>)
@@ -78,7 +78,7 @@ cir.func @test_preserve_nounwind_willreturn() {
}
// CHECK-LABEL: cir.func @test_preserve_nounwind_willreturn()
-// CHECK: cir.try_call @pureFunc() ^{{bb[0-9]+}}, ^{{bb[0-9]+}} nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
+// CHECK: cir.try_call @pureFunc() ^{{bb[0-9]+}}, ^{{bb[0-9]+}} nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>} : () -> !s32i
// Test that argument attributes on an indirect cir.call are preserved on the
// resulting indirect cir.try_call after flattening.
@@ -105,7 +105,7 @@ cir.func @test_preserve_indirect_call_attrs(
cir.func @test_preserve_all_attrs(%arg0 : !cir.ptr<!s32i>) {
cir.scope {
cir.try {
- %0 = cir.call @generalFunc(%arg0) {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i> {llvm.nonnull, llvm.noundef}) -> (!cir.ptr<!s32i> {llvm.nonnull})
+ %0 = cir.call @generalFunc(%arg0) {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i> {llvm.nonnull, llvm.noundef}) -> (!cir.ptr<!s32i> {llvm.nonnull})
cir.yield
} catch all (%eh_token : !cir.eh_token) {
%catch_token, %exn_ptr = cir.begin_catch %eh_token : !cir.eh_token -> (!cir.catch_token, !cir.ptr<!cir.void>)
@@ -117,7 +117,7 @@ cir.func @test_preserve_all_attrs(%arg0 : !cir.ptr<!s32i>) {
}
// CHECK-LABEL: cir.func @test_preserve_all_attrs(%arg0: !cir.ptr<!s32i>)
-// CHECK: cir.try_call @generalFunc(%arg0) ^{{bb[0-9]+}}, ^{{bb[0-9]+}} {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i> {llvm.nonnull, llvm.noundef}) -> (!cir.ptr<!s32i> {llvm.nonnull})
+// CHECK: cir.try_call @generalFunc(%arg0) ^{{bb[0-9]+}}, ^{{bb[0-9]+}} {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!s32i> {llvm.nonnull, llvm.noundef}) -> (!cir.ptr<!s32i> {llvm.nonnull})
// Test that all attribute types are preserved with indirect calls.
cir.func @test_preserve_all_attrs_indirect(
@@ -125,7 +125,7 @@ cir.func @test_preserve_all_attrs_indirect(
%obj : !cir.ptr<!rec_SomeClass>) {
cir.scope {
cir.try {
- %0 = cir.call %fptr(%obj) {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!rec_SomeClass>) -> !s32i>>, !cir.ptr<!rec_SomeClass> {llvm.nonnull}) -> (!s32i {llvm.nonnull})
+ %0 = cir.call %fptr(%obj) {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!rec_SomeClass>) -> !s32i>>, !cir.ptr<!rec_SomeClass> {llvm.nonnull}) -> (!s32i {llvm.nonnull})
cir.yield
} catch all (%eh_token : !cir.eh_token) {
%catch_token, %exn_ptr = cir.begin_catch %eh_token : !cir.eh_token -> (!cir.catch_token, !cir.ptr<!cir.void>)
@@ -139,7 +139,7 @@ cir.func @test_preserve_all_attrs_indirect(
// CHECK-LABEL: cir.func @test_preserve_all_attrs_indirect
// CHECK: %[[FN_PTR:.*]]: !cir.ptr<!cir.func<(!cir.ptr<!rec_SomeClass>) -> !s32i>>,
// CHECK-SAME: %[[OBJ:.*]]: !cir.ptr<!rec_SomeClass>
-// CHECK: cir.try_call %[[FN_PTR]](%[[OBJ]]) ^{{bb[0-9]+}}, ^{{bb[0-9]+}} {memory_effects = #cir.memory_effects<other = none, arg_mem = none, inaccessible_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!rec_SomeClass>) -> !s32i>>, !cir.ptr<!rec_SomeClass> {llvm.nonnull}) -> (!s32i {llvm.nonnull})
+// CHECK: cir.try_call %[[FN_PTR]](%[[OBJ]]) ^{{bb[0-9]+}}, ^{{bb[0-9]+}} {memory_effects = #cir.memory_effects<other = none, arg_mem = none, control_mem = none, errno_mem = none, target_mem0 = none, target_mem1 = none>} : (!cir.ptr<!cir.func<(!cir.ptr<!rec_SomeClass>) -> !s32i>>, !cir.ptr<!rec_SomeClass> {llvm.nonnull}) -> (!s32i {llvm.nonnull})
// Test that the calling convention on a cir.call is preserved on the resulting
// cir.try_call after flattening.
diff --git a/clang/test/CIR/Transforms/idiom-recognizer.cpp b/clang/test/CIR/Transforms/idiom-recognizer.cpp
index b72669fca49646..2eca896c774a11 100644
--- a/clang/test/CIR/Transforms/idiom-recognizer.cpp
+++ b/clang/test/CIR/Transforms/idiom-recognizer.cpp
@@ -43,7 +43,7 @@ char *test_find(char *first, char *last, const char &value) {
// FINAL: %[[LAST:.*]] = cir.load{{.*}} %[[LAST_ADDR]] :
// FINAL: %[[VALUE:.*]] = cir.load{{.*}} %[[VALUE_ADDR]] :
// FINAL: cir.call @_ZSt4findIPccET_S1_S1_RKT0_(%[[FIRST]], %[[LAST]], %[[VALUE]])
-// FINAL-SAME: nothrow nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, inaccessible_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
+// FINAL-SAME: nothrow nounwind willreturn {memory_effects = #cir.memory_effects<other = read, arg_mem = read, control_mem = read, errno_mem = read, target_mem0 = read, target_mem1 = read>}
// FINAL-SAME: {llvm.noundef}
// FINAL-SAME: -> (!cir.ptr<!s8i> {llvm.noundef})
// FINAL-NOT: cir.call @_ZSt4find
diff --git a/clang/test/CodeGen/sanitize-metadata-nosanitize.c b/clang/test/CodeGen/sanitize-metadata-nosanitize.c
index bc071e6e541a59..7644180f378adb 100644
--- a/clang/test/CodeGen/sanitize-metadata-nosanitize.c
+++ b/clang/test/CodeGen/sanitize-metadata-nosanitize.c
@@ -10,7 +10,7 @@
// CHECK: @llvm.global_ctors = appending global [2 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 2, ptr @__sanitizer_metadata_covered2.module_ctor, ptr @__sanitizer_metadata_covered2.module_ctor }, { i32, ptr, ptr } { i32 2, ptr @__sanitizer_metadata_atomics2.module_ctor, ptr @__sanitizer_metadata_atomics2.module_ctor }]
// CHECK: @llvm.global_dtors = appending global [2 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 2, ptr @__sanitizer_metadata_covered2.module_dtor, ptr @__sanitizer_metadata_covered2.module_dtor }, { i32, ptr, ptr } { i32 2, ptr @__sanitizer_metadata_atomics2.module_dtor, ptr @__sanitizer_metadata_atomics2.module_dtor }]
//.
-// CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+// CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none)
// CHECK-LABEL: define dso_local void @escape(
// CHECK-SAME: ptr noundef [[P:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] !pcsections [[META6:![0-9]+]] {
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -21,7 +21,7 @@ __attribute__((noinline, not_tail_called)) void escape(const volatile void *p) {
sink = p;
}
-// CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none)
+// CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none)
// CHECK-LABEL: define dso_local i32 @normal_function(
// CHECK-SAME: ptr noundef [[X:%.*]], ptr nofree noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] !pcsections [[META8:![0-9]+]] {
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -38,7 +38,7 @@ int normal_function(int *x, int *y) {
return *y;
}
-// CHECK: Function Attrs: disable_sanitizer_instrumentation mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none)
+// CHECK: Function Attrs: disable_sanitizer_instrumentation mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none)
// CHECK-LABEL: define dso_local i32 @test_disable_sanitize_instrumentation(
// CHECK-SAME: ptr noundef [[X:%.*]], ptr nofree noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -55,7 +55,7 @@ __attribute__((disable_sanitizer_instrumentation)) int test_disable_sanitize_ins
return *y;
}
-// CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none)
+// CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none)
// CHECK-LABEL: define dso_local i32 @test_no_sanitize_thread(
// CHECK-SAME: ptr noundef [[X:%.*]], ptr nofree noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR3:[0-9]+]] !pcsections [[META15:![0-9]+]] {
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -72,7 +72,7 @@ __attribute__((no_sanitize("thread"))) int test_no_sanitize_thread(int *x, int *
return *y;
}
-// CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none)
+// CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none)
// CHECK-LABEL: define dso_local i32 @test_no_sanitize_all(
// CHECK-SAME: ptr noundef [[X:%.*]], ptr nofree noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] !pcsections [[META15]] {
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -89,10 +89,10 @@ __attribute__((no_sanitize("all"))) int test_no_sanitize_all(int *x, int *y) {
return *y;
}
//.
-// CHECK: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
-// CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
-// CHECK: attributes #[[ATTR2]] = { disable_sanitizer_instrumentation mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
-// CHECK: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "no_sanitize_thread" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
+// CHECK: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
+// CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
+// CHECK: attributes #[[ATTR2]] = { disable_sanitizer_instrumentation mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
+// CHECK: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "no_sanitize_thread" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
// CHECK: attributes #[[ATTR4:[0-9]+]] = { nounwind "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
//.
// CHECK: [[META0:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
diff --git a/clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp b/clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp
index d45247b69a7e7a..d5d1ba908306aa 100644
--- a/clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp
+++ b/clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp
@@ -230,17 +230,17 @@ void *g0() { return new G; }
void *g1() { return new (q) G; }
#endif
-// CHECK-DAG: attributes [[ATTR_ALIGN_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_ZnwmSt11align_val_t" }
+// CHECK-DAG: attributes [[ATTR_ALIGN_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_ZnwmSt11align_val_t" }
// CHECK-DAG: attributes [[ATTR_ALIGN_DELETE]] = { builtin nounwind allockind("free") "alloc-family"="_ZnwmSt11align_val_t" }
-// CHECK-DAG: attributes [[ATTR_ALIGN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_ZnamSt11align_val_t" }
+// CHECK-DAG: attributes [[ATTR_ALIGN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_ZnamSt11align_val_t" }
// CHECK-DAG: attributes [[ATTR_ALIGN_ARRAY_DELETE]] = { builtin nounwind allockind("free") "alloc-family"="_ZnamSt11align_val_t" }
-// CHECK-MS-DAG: attributes [[ATTR_MS_ALIGN_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="??2 at YAPAXIW4align_val_t@std@@@Z" }
+// CHECK-MS-DAG: attributes [[ATTR_MS_ALIGN_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="??2 at YAPAXIW4align_val_t@std@@@Z" }
// CHECK-MS-DAG: attributes [[ATTR_MS_ALIGN_DELETE]] = { builtin nounwind allockind("free") "alloc-family"="??2 at YAPAXIW4align_val_t@std@@@Z" }
-// CHECK-MS-DAG: attributes [[ATTR_MS_ALIGN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="??_U at YAPAXIW4align_val_t@std@@@Z" }
+// CHECK-MS-DAG: attributes [[ATTR_MS_ALIGN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="??_U at YAPAXIW4align_val_t@std@@@Z" }
// CHECK-MS-DAG: attributes [[ATTR_MS_ALIGN_ARRAY_DELETE]] = { builtin nounwind allockind("free") "alloc-family"="??_U at YAPAXIW4align_val_t@std@@@Z" }
-// CHECK-MS-UNALIGNED-DAG: attributes [[ATTR_MS_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="??2 at YAPAXI@Z" }
+// CHECK-MS-UNALIGNED-DAG: attributes [[ATTR_MS_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="??2 at YAPAXI@Z" }
// CHECK-MS-UNALIGNED-DAG: attributes [[ATTR_MS_DELETE]] = { builtin nounwind allockind("free") "alloc-family"="??2 at YAPAXI@Z" }
-// CHECK-MS-UNALIGNED-DAG: attributes [[ATTR_MS_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="??_U at YAPAXI@Z" }
+// CHECK-MS-UNALIGNED-DAG: attributes [[ATTR_MS_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="??_U at YAPAXI@Z" }
// CHECK-MS-UNALIGNED-DAG: attributes [[ATTR_MS_ARRAY_DELETE]] = { builtin nounwind allockind("free") "alloc-family"="??_U at YAPAXI@Z" }
diff --git a/clang/test/CodeGenCXX/new.cpp b/clang/test/CodeGenCXX/new.cpp
index ac6748bc96924c..be390837d0ec13 100644
--- a/clang/test/CodeGenCXX/new.cpp
+++ b/clang/test/CodeGenCXX/new.cpp
@@ -366,10 +366,10 @@ namespace builtins {
// CHECK-DAG: attributes [[ATTR_NOBUILTIN_NOUNWIND]] = {{[{].*}} nobuiltin nounwind {{.*[}]}}
// CHECK-DAG: attributes [[ATTR_NOBUILTIN_NOUNWIND_ALLOCSIZE]] = {{[{].*}} nobuiltin nounwind allocsize(0) {{.*[}]}}
-// CHECK-DAG: attributes [[ATTR_BUILTIN_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_Znwm" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_Znwm" }
// CHECK-DAG: attributes [[ATTR_BUILTIN_DELETE]] = { builtin nounwind allockind("free") "alloc-family"="_Znwm" }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_Znam" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_Znam" }
// CHECK-DAG: attributes [[ATTR_BUILTIN_ARRAY_DELETE]] = { builtin nounwind allockind("free") "alloc-family"="_Znam" }
// The ([^b}|...) monstrosity is matching a character that's not the start of 'builtin'.
diff --git a/clang/test/CodeGenCXX/new_hot_cold.cpp b/clang/test/CodeGenCXX/new_hot_cold.cpp
index 26933095faa19a..58a24a5910a416 100644
--- a/clang/test/CodeGenCXX/new_hot_cold.cpp
+++ b/clang/test/CodeGenCXX/new_hot_cold.cpp
@@ -126,11 +126,11 @@ void hot_cold_new_align_nothrow_array() {
// CHECK-DAG: attributes [[ATTR_NOBUILTIN_NOTHROW]] = { nobuiltin nounwind allocsize(0) {{.*}} }
// CHECK-DAG: attributes [[ATTR_NO_BUILTIN_CALL]] = { allocsize(0) }
// CHECK-DAG: attributes [[ATTR_NO_BUILTIN_NOTHROW_CALL]] = { nounwind allocsize(0) }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_Znwm" }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_Znam" }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_NOTHROW_NEW]] = { builtin nounwind allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_Znwm" }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_NOTHROW_ARRAY_NEW]] = { builtin nounwind allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_Znam" }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_ALIGN_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_ZnwmSt11align_val_t" }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_ALIGN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_ZnamSt11align_val_t" }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_ALIGN_NOTHROW_NEW]] = { builtin nounwind allockind("alloc,uninitialized,aligned") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_ZnwmSt11align_val_t" }
-// CHECK-DAG: attributes [[ATTR_BUILTIN_ALIGN_NOTHROW_ARRAY_NEW]] = { builtin nounwind allockind("alloc,uninitialized,aligned") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_ZnamSt11align_val_t" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_Znwm" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_Znam" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_NOTHROW_NEW]] = { builtin nounwind allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_Znwm" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_NOTHROW_ARRAY_NEW]] = { builtin nounwind allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_Znam" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_ALIGN_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_ZnwmSt11align_val_t" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_ALIGN_ARRAY_NEW]] = { builtin allockind("alloc,uninitialized,aligned") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_ZnamSt11align_val_t" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_ALIGN_NOTHROW_NEW]] = { builtin nounwind allockind("alloc,uninitialized,aligned") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_ZnwmSt11align_val_t" }
+// CHECK-DAG: attributes [[ATTR_BUILTIN_ALIGN_NOTHROW_ARRAY_NEW]] = { builtin nounwind allockind("alloc,uninitialized,aligned") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_ZnamSt11align_val_t" }
diff --git a/clang/test/CodeGenCXX/operator-new.cpp b/clang/test/CodeGenCXX/operator-new.cpp
index 04aaf431be67fe..0e42dc780ce6d4 100644
--- a/clang/test/CodeGenCXX/operator-new.cpp
+++ b/clang/test/CodeGenCXX/operator-new.cpp
@@ -34,7 +34,7 @@ void *f3(unsigned long N) {
return ::operator new(N);
}
-// SANE: attributes [[ATTR]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="_Znam" }
+// SANE: attributes [[ATTR]] = { builtin allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="_Znam" }
// SANE: attributes [[ATTR2]] = { allocsize(0) }
// SANENOT: attributes [[ATTR]] = { builtin allockind("alloc,uninitialized") allocsize(0) "alloc-family"="_Znam" }
// SANENOT: attributes [[ATTR2]] = { allocsize(0) }
diff --git a/clang/test/CodeGenCXX/threadlocal_address.cpp b/clang/test/CodeGenCXX/threadlocal_address.cpp
index 445a75538a64ea..fd966c075890e1 100644
--- a/clang/test/CodeGenCXX/threadlocal_address.cpp
+++ b/clang/test/CodeGenCXX/threadlocal_address.cpp
@@ -135,7 +135,7 @@ int h() {
// NON-ZERO-GLOBAL-AS: attributes #[[ATTR3:[0-9]+]] = { convergent noinline nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
// NON-ZERO-GLOBAL-AS: attributes #[[ATTR4]] = { convergent }
//.
-// CHECK-O1: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none, target_mem: none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
+// CHECK-O1: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
// CHECK-O1: attributes #[[ATTR1:[0-9]+]] = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
// CHECK-O1: attributes #[[ATTR2]] = { mustprogress nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
// CHECK-O1: attributes #[[ATTR3:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index 8526ce883c14b9..1f34b4a05815b7 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -178,6 +178,9 @@ Makes programs 10x faster by doing Special New Thing.
* Added the `bitinsert` and `bitextract` instructions for bit-range
manipulation on byte type values.
+
+* `InaccessibleMem` is now a category that includes several MemoryEffect
+ locations. The location it previously denoted is `ControlMem`.
* The verifier now rejects a `"wchar_size"` module flag whose value is not
positive.
diff --git a/llvm/include/llvm/AsmParser/LLToken.h b/llvm/include/llvm/AsmParser/LLToken.h
index 1adb04d13ab8cd..79e195bd2d9ae5 100644
--- a/llvm/include/llvm/AsmParser/LLToken.h
+++ b/llvm/include/llvm/AsmParser/LLToken.h
@@ -209,6 +209,7 @@ enum Kind {
kw_readwrite,
kw_argmem,
kw_inaccessiblemem,
+ kw_controlmem,
kw_target_mem,
kw_target_mem0,
kw_target_mem1,
diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h
index a620340165be73..f7704c610c3577 100644
--- a/llvm/include/llvm/IR/Function.h
+++ b/llvm/include/llvm/IR/Function.h
@@ -552,16 +552,6 @@ class LLVM_ABI Function : public GlobalObject, public ilist_node<Function> {
bool onlyAccessesArgMemory() const;
void setOnlyAccessesArgMemory();
- /// Determine if the function may only access memory that is
- /// inaccessible from the IR.
- bool onlyAccessesInaccessibleMemory() const;
- void setOnlyAccessesInaccessibleMemory();
-
- /// Determine if the function may only access memory that is
- /// either inaccessible from the IR or pointed to by its arguments.
- bool onlyAccessesInaccessibleMemOrArgMem() const;
- void setOnlyAccessesInaccessibleMemOrArgMem();
-
/// Determine if the function cannot return.
bool doesNotReturn() const {
return hasFnAttribute(Attribute::NoReturn);
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index 27fc0ca1c8526d..2a1e82487290d3 100644
--- a/llvm/include/llvm/IR/InstrTypes.h
+++ b/llvm/include/llvm/IR/InstrTypes.h
@@ -2018,12 +2018,10 @@ class CallBase : public Instruction {
/// Determine if the function may only access memory that is
/// inaccessible from the IR.
LLVM_ABI bool onlyAccessesInaccessibleMemory() const;
- LLVM_ABI void setOnlyAccessesInaccessibleMemory();
/// Determine if the function may only access memory that is
/// either inaccessible from the IR or pointed to by its arguments.
LLVM_ABI bool onlyAccessesInaccessibleMemOrArgMem() const;
- LLVM_ABI void setOnlyAccessesInaccessibleMemOrArgMem();
/// Determine if the call cannot return.
bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); }
diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index 43caed2bf46c37..91888fd668e16c 100644
--- a/llvm/include/llvm/IR/Intrinsics.td
+++ b/llvm/include/llvm/IR/Intrinsics.td
@@ -61,13 +61,23 @@ def IntrInaccessibleMemOnly : IntrinsicProperty;
// by the module being compiled. This is a weaker form of IntrArgMemOnly.
def IntrInaccessibleMemOrArgMemOnly : IntrinsicProperty;
+// IntrControlMemOnly -- This intrinsic may only make access memory-like
+// objects, that cannot be accessed by any pointer. This is a weaker form of
+// IntrNoMem.
+def IntrControlMemOnly : IntrinsicProperty;
+
+// IntrControlMemOrArgMemOnly -- This intrinsic may only access memory-like
+// objects or the memory that its pointer-typed arguments point to. This is a
+// weaker form of IntrArgMemOnly.
+def IntrControlMemOrArgMemOnly : IntrinsicProperty;
+
// Tablegen representation of IRMemLocation.
class IntrinsicMemoryLocation;
// TODO: Populate with all IRMemLocation enum values and update
// getValueAsIRMemLocation accordingly.
def ArgMem : IntrinsicMemoryLocation;
-def InaccessibleMem : IntrinsicMemoryLocation;
+def ControlMem : IntrinsicMemoryLocation;
def TargetMem0 : IntrinsicMemoryLocation;
def TargetMem1 : IntrinsicMemoryLocation;
@@ -1075,14 +1085,14 @@ def int_thread_pointer : DefaultAttrsIntrinsic<
[llvm_anyptr_ty], [], [IntrNoMem]>,
ClangBuiltin<"__builtin_thread_pointer">;
-// IntrInaccessibleMemOrArgMemOnly is a little more pessimistic than strictly
+// IntrIControlMemOrArgMemOnly is a little more pessimistic than strictly
// necessary for prefetch, however it does conveniently prevent the prefetch
// from being reordered overly much with respect to nearby access to the same
// memory while not impeding optimization.
def int_prefetch
: DefaultAttrsIntrinsic<[],
[llvm_anyptr_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
- [IntrInaccessibleMemOrArgMemOnly,
+ [IntrControlMemOrArgMemOnly,
ReadOnly<ArgIndex<0>>, NoCapture<ArgIndex<0>>,
ImmArg<ArgIndex<1>>, Range<ArgIndex<1>, 0, 2>,
ImmArg<ArgIndex<2>>, Range<ArgIndex<2>, 0, 4>,
@@ -2128,12 +2138,12 @@ def int_allow_sanitize_hwaddress
// Support for dynamic deoptimization (or de-specialization)
def int_experimental_deoptimize
: Intrinsic<[llvm_any_ty], [llvm_vararg_ty],
- [Throws, IntrWrite<[InaccessibleMem]>]>;
+ [Throws, IntrWrite<[ControlMem]>]>;
// Support for speculative runtime guards
def int_experimental_guard
: Intrinsic<[], [llvm_i1_ty, llvm_vararg_ty],
- [Throws, IntrWrite<[InaccessibleMem]>]>;
+ [Throws, IntrWrite<[ControlMem]>]>;
// Supports widenable conditions for guards represented as explicit branches.
def int_experimental_widenable_condition : DefaultAttrsIntrinsic<[llvm_i1_ty],
diff --git a/llvm/include/llvm/IR/IntrinsicsAArch64.td b/llvm/include/llvm/IR/IntrinsicsAArch64.td
index d05f36c86b8191..f21f2e52d58e2b 100644
--- a/llvm/include/llvm/IR/IntrinsicsAArch64.td
+++ b/llvm/include/llvm/IR/IntrinsicsAArch64.td
@@ -742,8 +742,8 @@ def int_aarch64_neon_tbx3 : AdvSIMD_Tbx3_Intrinsic;
def int_aarch64_neon_tbx4 : AdvSIMD_Tbx4_Intrinsic;
// Maps Memory locations to registers.
-defvar FFR = InaccessibleMem;
-defvar FPMR = InaccessibleMem;
+defvar FFR = ControlMem;
+defvar FPMR = ControlMem;
defvar ZT0 = TargetMem0;
defvar ZA = TargetMem1;
diff --git a/llvm/include/llvm/IR/IntrinsicsNVVM.td b/llvm/include/llvm/IR/IntrinsicsNVVM.td
index 5b47906b193153..5a002c81d04cd8 100644
--- a/llvm/include/llvm/IR/IntrinsicsNVVM.td
+++ b/llvm/include/llvm/IR/IntrinsicsNVVM.td
@@ -1223,7 +1223,7 @@ class NVVM_TCGEN05_MMA_BASE<string Space, bit IsSparse, string Kind = "",
// Descriptors read shared memory; writes affect tensor memory and internal
// state. D may be read, and .ashift also writes A.
list<IntrinsicProperty> common_intr_props = !listconcat(
- [IntrWrite<[ArgMem, InaccessibleMem]>],
+ [IntrWrite<[ArgMem, ControlMem]>],
!if(!and(!eq(Space, "tensor"), !not(IsAShift)), [ReadOnly<ArgIndex<1>>], []),
!if(IsSparse, [ReadOnly<ArgIndex<5>>], []));
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 78a8de4ef75291..e24f1b4d592c95 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -808,7 +808,7 @@ class MallocLibcall<string family> : RuntimeLibcall<Ptr, [SizeT]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn,
UninitAllocKind,
AllocSizeAttr<0>, AllocFamilyAttr<family>];
- let Memory = InaccessibleMemOrErrnoWrite;
+ let Memory = ControlMemOrErrnoWrite;
let RetAttrs = [NoAlias, NoUndef];
let ParamAttrs = [[NoUndef]];
}
@@ -817,7 +817,7 @@ class CallocLibcall<string family> : RuntimeLibcall<Ptr, [SizeT, SizeT]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn,
AllocKindAttr<"AllocFnKind::Alloc | AllocFnKind::Zeroed">,
AllocSizeAttr<0, "1">, AllocFamilyAttr<family>];
- let Memory = InaccessibleMemOrErrnoWrite;
+ let Memory = ControlMemOrErrnoWrite;
let RetAttrs = [NoAlias, NoUndef];
let ParamAttrs = [[NoUndef], [NoUndef]];
}
@@ -825,7 +825,7 @@ class CallocLibcall<string family> : RuntimeLibcall<Ptr, [SizeT, SizeT]> {
class FreeLibcall<string family> : RuntimeLibcall<Void, [Ptr]> {
let FnAttrs = [NoUnwind, WillReturn, AllocKindAttr<"AllocFnKind::Free">,
AllocFamilyAttr<family>];
- let Memory = InaccessibleOrArgMem;
+ let Memory = ControlOrArgMem;
let ParamAttrs = [[AllocatedPointer, NoUndef, CapturesNone]];
}
@@ -834,7 +834,7 @@ class ReallocLibcall<string family, list<FuncArgType> SizeTypes,
: RuntimeLibcall<Ptr, !listconcat([Ptr], SizeTypes)> {
let FnAttrs = [NoUnwind, WillReturn, AllocKindAttr<"AllocFnKind::Realloc">,
allocSize, AllocFamilyAttr<family>];
- let Memory = InaccessibleOrArgMemOrErrnoWrite;
+ let Memory = ControlMemOrArgMemOrErrnoWrite;
let RetAttrs = [NoAlias, NoUndef];
let ParamAttrs = !listconcat([[AllocatedPointer, CapturesNone]],
!listsplat([NoUndef], !size(SizeTypes)));
@@ -1203,7 +1203,7 @@ def ALIGNED_ALLOC : RuntimeLibcall<Ptr, [SizeT, SizeT]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn,
AlignedUninitAllocKind,
AllocSizeAttr<1>, AllocFamilyAttr<"malloc">];
- let Memory = InaccessibleMemOrErrnoWrite;
+ let Memory = ControlMemOrArgMemOrErrnoWrite;
let RetAttrs = [NoAlias, NoUndef];
let ParamAttrs = [[AllocAlign, NoUndef], [NoUndef]];
}
@@ -1674,7 +1674,7 @@ def MEMALIGN : RuntimeLibcall<Ptr, [SizeT, SizeT]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn,
AlignedUninitAllocKind,
AllocSizeAttr<1>, AllocFamilyAttr<"malloc">];
- let Memory = InaccessibleMemOrErrnoWrite;
+ let Memory = ControlMemOrArgMemOrErrnoWrite;
let RetAttrs = [NoAlias, NoUndef];
let ParamAttrs = [[AllocAlign]];
}
@@ -1789,7 +1789,7 @@ def POPEN : RuntimeLibcall<Ptr, [Ptr, Ptr]> {
def POSIX_MEMALIGN : RuntimeLibcall<Int, [Ptr, SizeT, SizeT]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn];
- let Memory = InaccessibleOrArgMem;
+ let Memory = ControlOrArgMem;
let RetAttrs = [NoUndef];
let ParamAttrs = [[CapturesNone, NoUndef, WriteOnly], [NoUndef], [NoUndef]];
}
@@ -1836,7 +1836,7 @@ def PVALLOC : RuntimeLibcall<Ptr, [SizeT]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn,
UninitAllocKind,
AllocFamilyAttr<"malloc">];
- let Memory = InaccessibleMemOrErrnoWrite;
+ let Memory = ControlMemOrErrnoWrite;
let RetAttrs = [NoAlias, NoUndef];
let ParamAttrs = [[NoUndef]];
}
@@ -2054,7 +2054,7 @@ def STRCSPN : RuntimeLibcall<SizeT, [Ptr, Ptr]> {
def STRDUP : RuntimeLibcall<Ptr, [Ptr]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn, AllocFamilyAttr<"malloc">];
- let Memory = InaccessibleOrArgMemOrErrnoWrite;
+ let Memory = ControlMemOrArgMemOrErrnoWrite;
let RetAttrs = [NoAlias];
let ParamAttrs = [[CapturesNone, ReadOnly]];
}
@@ -2114,7 +2114,7 @@ def STRNCPY_CHK : RuntimeLibcall<Ptr, [Ptr, Ptr, SizeT, SizeT]> {
def STRNDUP : RuntimeLibcall<Ptr, [Ptr, SizeT]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn, AllocFamilyAttr<"malloc">];
- let Memory = InaccessibleOrArgMemOrErrnoWrite;
+ let Memory = ControlMemOrArgMemOrErrnoWrite;
let RetAttrs = [NoAlias];
let ParamAttrs = [[CapturesNone, ReadOnly], [NoUndef]];
}
@@ -2279,7 +2279,7 @@ def VALLOC : RuntimeLibcall<Ptr, [SizeT]> {
let FnAttrs = [NoFree, NoUnwind, WillReturn,
UninitAllocKind,
AllocSizeAttr<0>, AllocFamilyAttr<"malloc">];
- let Memory = InaccessibleMemOrErrnoWrite;
+ let Memory = ControlMemOrErrnoWrite;
let RetAttrs = [NoAlias, NoUndef];
let ParamAttrs = [[NoUndef]];
}
diff --git a/llvm/include/llvm/IR/RuntimeLibcallsImpl.td b/llvm/include/llvm/IR/RuntimeLibcallsImpl.td
index 7fc65311c5ce7d..2463b40542bf59 100644
--- a/llvm/include/llvm/IR/RuntimeLibcallsImpl.td
+++ b/llvm/include/llvm/IR/RuntimeLibcallsImpl.td
@@ -153,7 +153,7 @@ def ModRef : ModRefInfo;
class MemoryEffects<ModRefInfo mr = ModRef> {
ModRefInfo ArgMem = mr;
- ModRefInfo InaccessibleMem = mr;
+ ModRefInfo ControlMem = mr;
ModRefInfo ErrnoMem = mr;
ModRefInfo Other = mr;
ModRefInfo TargetMem0 = mr;
@@ -172,19 +172,19 @@ def ArgOrErrnoMemWriteOnly : MemoryEffects<NoModRef> {
}
def ErrnoMemWriteOnly : MemoryEffects<NoModRef> { let ErrnoMem = Mod; }
-def InaccessibleMemOrErrnoWrite : MemoryEffects<NoModRef> {
- let InaccessibleMem = ModRef;
+def ControlMemOrErrnoWrite : MemoryEffects<NoModRef> {
+ let ControlMem = ModRef;
let ErrnoMem = Mod;
}
-def InaccessibleOrArgMem : MemoryEffects<NoModRef> {
+def ControlOrArgMem : MemoryEffects<NoModRef> {
let ArgMem = ModRef;
- let InaccessibleMem = ModRef;
+ let ControlMem = ModRef;
}
-def InaccessibleOrArgMemOrErrnoWrite : MemoryEffects<NoModRef> {
+def ControlMemOrArgMemOrErrnoWrite : MemoryEffects<NoModRef> {
let ArgMem = ModRef;
- let InaccessibleMem = ModRef;
+ let ControlMem = ModRef;
let ErrnoMem = Mod;
}
diff --git a/llvm/include/llvm/Support/ModRef.h b/llvm/include/llvm/Support/ModRef.h
index 83091c617f6290..53f5b3edebc2c3 100644
--- a/llvm/include/llvm/Support/ModRef.h
+++ b/llvm/include/llvm/Support/ModRef.h
@@ -60,12 +60,18 @@ LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, ModRefInfo MR);
enum class IRMemLocation {
/// Access to memory via argument pointers.
ArgMem = 0,
- /// Memory that is inaccessible via LLVM IR.
- InaccessibleMem = 1,
/// Errno memory.
- ErrnoMem = 2,
+ ErrnoMem = 1,
/// Any other memory.
- Other = 3,
+ Other = 2,
+
+ // Note: The locations below only resemble memory accesses. They are not
+ // actual memory and cannot be associated with any pointer. These locations
+ // must form a continuous sequence.
+
+ /// Used to represent control flow restrictions.
+ ControlMem = 3,
+
/// Represents target specific state.
TargetMem0 = 4,
TargetMem1 = 5,
@@ -73,6 +79,8 @@ enum class IRMemLocation {
/// Helpers to iterate all locations in the MemoryEffectsBase class.
First = ArgMem,
Last = TargetMem1,
+ FirstInaccessible = ControlMem,
+ LastInaccessible = TargetMem1
};
template <typename LocationEnum> class MemoryEffectsBase {
@@ -102,6 +110,12 @@ template <typename LocationEnum> class MemoryEffectsBase {
return enum_seq_inclusive(Location::First, Location::Last,
force_iteration_on_noniterable_enum);
}
+ /// Returns iterator over all inaccessible memory location kinds.
+ static auto inaccessibleMemLocations() {
+ return enum_seq_inclusive(Location::FirstInaccessible,
+ Location::LastInaccessible,
+ force_iteration_on_noniterable_enum);
+ }
/// Returns iterator over all target location kinds
static auto targetMemLocations() {
return enum_seq_inclusive(Location::TargetMem0, Location::TargetMem1,
@@ -144,10 +158,18 @@ template <typename LocationEnum> class MemoryEffectsBase {
return MemoryEffectsBase(Location::ArgMem, MR);
}
+ /// Create MemoryEffectsBase that can only access control memory.
+ static MemoryEffectsBase controlMemOnly(ModRefInfo MR = ModRefInfo::ModRef) {
+ return MemoryEffectsBase(Location::ControlMem, MR);
+ }
+
/// Create MemoryEffectsBase that can only access inaccessible memory.
static MemoryEffectsBase
inaccessibleMemOnly(ModRefInfo MR = ModRefInfo::ModRef) {
- return MemoryEffectsBase(Location::InaccessibleMem, MR);
+ MemoryEffectsBase MEB = none();
+ for (auto L : inaccessibleMemLocations())
+ MEB.setModRef(L, MR);
+ return MEB;
}
/// Create MemoryEffectsBase that can only access errno memory.
@@ -166,7 +188,18 @@ template <typename LocationEnum> class MemoryEffectsBase {
inaccessibleOrArgMemOnly(ModRefInfo MR = ModRefInfo::ModRef) {
MemoryEffectsBase FRMB = none();
FRMB.setModRef(Location::ArgMem, MR);
- FRMB.setModRef(Location::InaccessibleMem, MR);
+ for (auto L : inaccessibleMemLocations())
+ FRMB.setModRef(L, MR);
+ return FRMB;
+ }
+
+ /// Create MemoryEffectsBase that can only access control or argument
+ /// memory.
+ static MemoryEffectsBase
+ controlOrArgMemOnly(ModRefInfo MR = ModRefInfo::ModRef) {
+ MemoryEffectsBase FRMB = none();
+ FRMB.setModRef(Location::ControlMem, MR);
+ FRMB.setModRef(Location::ArgMem, MR);
return FRMB;
}
@@ -176,7 +209,8 @@ template <typename LocationEnum> class MemoryEffectsBase {
inaccessibleOrErrnoMemOnly(ModRefInfo InaccessibleMR = ModRefInfo::ModRef,
ModRefInfo ErrnoMR = ModRefInfo::ModRef) {
MemoryEffectsBase FRMB = none();
- FRMB.setModRef(Location::InaccessibleMem, InaccessibleMR);
+ for (auto L : inaccessibleMemLocations())
+ FRMB.setModRef(L, InaccessibleMR);
FRMB.setModRef(Location::ErrnoMem, ErrnoMR);
return FRMB;
}
@@ -187,7 +221,8 @@ template <typename LocationEnum> class MemoryEffectsBase {
ModRefInfo InaccessibleOrArgMR = ModRefInfo::ModRef,
ModRefInfo ErrnoMR = ModRefInfo::ModRef) {
MemoryEffectsBase FRMB = none();
- FRMB.setModRef(Location::InaccessibleMem, InaccessibleOrArgMR);
+ for (auto L : inaccessibleMemLocations())
+ FRMB.setModRef(L, InaccessibleOrArgMR);
FRMB.setModRef(Location::ArgMem, InaccessibleOrArgMR);
FRMB.setModRef(Location::ErrnoMem, ErrnoMR);
return FRMB;
@@ -234,6 +269,14 @@ template <typename LocationEnum> class MemoryEffectsBase {
return ME;
}
+ /// Getnew MemoryEffectsBase with NoModRef on the inaccessible memory.
+ MemoryEffectsBase getWithoutInaccessibleLocs() const {
+ MemoryEffectsBase ME = *this;
+ for (auto Loc : inaccessibleMemLocations())
+ ME.setModRef(Loc, ModRefInfo::NoModRef);
+ return ME;
+ }
+
/// Get ModRefInfo for any location.
ModRefInfo getModRef() const {
ModRefInfo MR = ModRefInfo::NoModRef;
@@ -261,18 +304,22 @@ template <typename LocationEnum> class MemoryEffectsBase {
return isModOrRefSet(getModRef(Location::ArgMem));
}
+ /// Whether this function only (at most) accesses control memory.
+ bool onlyAccessesControlMem() const {
+ return getWithoutLoc(Location::ControlMem).doesNotAccessMemory();
+ }
+
/// Whether this function only (at most) accesses inaccessible memory.
bool onlyAccessesInaccessibleMem() const {
- return getWithoutLoc(Location::InaccessibleMem).doesNotAccessMemory();
+ return getWithoutInaccessibleLocs().doesNotAccessMemory();
}
- /// Whether this function only (at most) accesses inaccessible or target
- /// memory.
- bool onlyAccessesInaccessibleOrTargetMem() const {
- MemoryEffectsBase ME = *this;
- for (auto Loc : MemoryEffectsBase::targetMemLocations())
- ME &= ME.getWithoutLoc(Loc);
- return ME.getWithoutLoc(Location::InaccessibleMem).doesNotAccessMemory();
+ /// Whether location is an inaccessible memory location.
+ bool isInaccessibleMemLoc(IRMemLocation Loc) {
+ for (auto L : inaccessibleMemLocations())
+ if (Loc == L)
+ return true;
+ return false;
}
/// Whether location is target memory location.
@@ -303,7 +350,7 @@ template <typename LocationEnum> class MemoryEffectsBase {
/// Whether this function only (at most) accesses argument and inaccessible
/// memory.
bool onlyAccessesInaccessibleOrArgMem() const {
- return getWithoutLoc(Location::InaccessibleMem)
+ return getWithoutInaccessibleLocs()
.getWithoutLoc(Location::ArgMem)
.doesNotAccessMemory();
}
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 6f80216b3bcdbb..280a7e35126354 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -239,9 +239,8 @@ ModRefInfo AAResults::getModRefInfo(const CallBase *Call,
return Result;
}
-ModRefInfo
-getModRefInfoInaccessibleAndTargetMemLoc(const MemoryEffects CallUse,
- const MemoryEffects CallDef) {
+ModRefInfo getModRefInfoInaccessibleMemLoc(const MemoryEffects CallUse,
+ const MemoryEffects CallDef) {
ModRefInfo Result = ModRefInfo::NoModRef;
auto addModRefInfoForLoc = [&](IRMemLocation L) {
@@ -256,8 +255,7 @@ getModRefInfoInaccessibleAndTargetMemLoc(const MemoryEffects CallUse,
Result |= UseMR;
};
- addModRefInfoForLoc(IRMemLocation::InaccessibleMem);
- for (auto Loc : MemoryEffects::targetMemLocations())
+ for (auto Loc : MemoryEffects::inaccessibleMemLocations())
addModRefInfoForLoc(Loc);
return Result;
}
@@ -366,11 +364,11 @@ ModRefInfo AAResults::getModRefInfo(const CallBase *Call1,
return R;
}
- // If only Inaccessible and Target Memory Location have set ModRefInfo
+ // If only Inaccessible Memory Locations have set ModRefInfo
// then check the relation between the same locations.
- if (Call1B.onlyAccessesInaccessibleOrTargetMem() &&
- Call2B.onlyAccessesInaccessibleOrTargetMem())
- return getModRefInfoInaccessibleAndTargetMemLoc(Call1B, Call2B);
+ if (Call1B.onlyAccessesInaccessibleMem() &&
+ Call2B.onlyAccessesInaccessibleMem())
+ return getModRefInfoInaccessibleMemLoc(Call1B, Call2B);
return Result;
}
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index ff77ab6976455d..58a8d476f47eae 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -935,7 +935,7 @@ MemoryEffects BasicAAResult::getMemoryEffects(const CallBase *Call,
FuncME |= MemoryEffects::writeOnly();
if (Call->isVolatile()) {
// Volatile operations also access inaccessible memory.
- FuncME |= MemoryEffects::inaccessibleMemOnly();
+ FuncME |= MemoryEffects::controlMemOnly();
}
Min &= FuncME;
}
@@ -1027,9 +1027,8 @@ ModRefInfo BasicAAResult::getModRefInfo(const CallBase *Call,
// We can completely ignore inaccessible memory here, because MemoryLocations
// can only reference accessible memory.
- auto ME = AAQI.AAR.getMemoryEffects(Call, AAQI)
- .getWithoutLoc(IRMemLocation::InaccessibleMem);
- if (ME.doesNotAccessMemory())
+ auto ME = AAQI.AAR.getMemoryEffects(Call, AAQI);
+ if (ME.onlyAccessesInaccessibleMem())
return ModRefInfo::NoModRef;
ModRefInfo ArgMR = ME.getModRef(IRMemLocation::ArgMem);
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index 6678269c8793ca..83b785817aa653 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -723,6 +723,7 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(write);
KEYWORD(readwrite);
KEYWORD(argmem);
+ KEYWORD(controlmem);
KEYWORD(target_mem0);
KEYWORD(target_mem1);
KEYWORD(target_mem);
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 3a21ad056083f0..c9fd8fae6f2454 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -2754,10 +2754,16 @@ static SmallVector<MemoryEffects::Location, 2> keywordToLoc(lltok::Kind Tok) {
switch (Tok) {
case lltok::kw_argmem:
return {Loc::ArgMem};
- case lltok::kw_inaccessiblemem:
- return {Loc::InaccessibleMem};
+ case lltok::kw_inaccessiblemem: {
+ SmallVector<MemoryEffects::Location, 2> Inaccessible;
+ for (auto Loc : MemoryEffects::inaccessibleMemLocations())
+ Inaccessible.push_back(Loc);
+ return Inaccessible;
+ }
case lltok::kw_errnomem:
return {Loc::ErrnoMem};
+ case lltok::kw_controlmem:
+ return {Loc::ControlMem};
case lltok::kw_target_mem0:
return {Loc::TargetMem0};
case lltok::kw_target_mem1:
@@ -2833,7 +2839,8 @@ std::optional<MemoryEffects> LLParser::parseMemoryAttr() {
std::optional<ModRefInfo> MR = keywordToModRef(Lex.getKind());
if (!MR) {
if (Locs.empty())
- tokError("expected memory location (argmem, inaccessiblemem, errnomem) "
+ tokError("expected memory location (argmem, errnomem, inaccessiblemem, "
+ "controlmem, target_mem, target_mem0, target_mem1) "
"or access kind (none, read, write, readwrite)");
else
tokError("expected access kind (none, read, write, readwrite)");
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 9d46b8795e5659..d244fb7dcc79a1 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2519,28 +2519,28 @@ Error BitcodeReader::parseAttributeGroupBlock() {
MemoryEffects::argMemOnly(ArgMem) |
MemoryEffects::errnoMemOnly(OtherMem) |
MemoryEffects::otherMemOnly(OtherMem);
- // Old bitcode encoded AArch64 state as inaccessible memory.
- // Upgrade those effects to target-specific memory locations.
- if (getTargetTriple().isAArch64())
- ME = ME.getWithModRef(IRMemLocation::TargetMem0,
- InaccessibleMem) |
- ME.getWithModRef(IRMemLocation::TargetMem1,
- InaccessibleMem);
+ B.addMemoryAttr(ME);
+ } else if (Version <= 2) {
+ ModRefInfo ArgMem = ModRefInfo((EncodedME >> 0) & 3);
+ ModRefInfo InaccessibleMem = ModRefInfo((EncodedME >> 2) & 3);
+ ModRefInfo ErrnoMem = ModRefInfo((EncodedME >> 4) & 3);
+ ModRefInfo OtherMem = ModRefInfo((EncodedME >> 6) & 3);
+ auto ME = MemoryEffects::inaccessibleMemOnly(InaccessibleMem) |
+ MemoryEffects::argMemOnly(ArgMem) |
+ MemoryEffects::errnoMemOnly(ErrnoMem) |
+ MemoryEffects::otherMemOnly(OtherMem);
+ if (Version == 2) {
+ ModRefInfo TargetMem0 = ModRefInfo((EncodedME >> 8) & 3);
+ ModRefInfo TargetMem1 = ModRefInfo((EncodedME >> 10) & 3);
+ ME = ME.getWithModRef(IRMemLocation::TargetMem0, TargetMem0)
+ .getWithModRef(IRMemLocation::TargetMem1, TargetMem1);
+ }
B.addMemoryAttr(ME);
} else {
// Construct the memory attribute directly from the encoded base
// on newer versions.
auto ME = MemoryEffects::createFromIntValue(
EncodedME & 0x00FFFFFFFFFFFFFFULL);
- // Upgrade to target-specific memory locations introduced in
- // version 2.
- if (Version == 1 && getTargetTriple().isAArch64())
- ME = ME.getWithModRef(
- IRMemLocation::TargetMem0,
- ME.getModRef(IRMemLocation::InaccessibleMem)) |
- ME.getWithModRef(
- IRMemLocation::TargetMem1,
- ME.getModRef(IRMemLocation::InaccessibleMem));
B.addMemoryAttr(ME);
}
} else if (Kind == Attribute::Captures)
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 26e411a587c267..ec8894adac695b 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1104,7 +1104,7 @@ void ModuleBitcodeWriter::writeAttributeGroupTable() {
Record.push_back(getAttrKindEncoding(Kind));
if (Kind == Attribute::Memory) {
// Version field for upgrading old memory effects.
- const uint64_t Version = 2;
+ const uint64_t Version = 3;
Record.push_back((Version << 56) | Attr.getValueAsInt());
} else {
Record.push_back(Attr.getValueAsInt());
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 19acea0ab0f0ce..b3481df37bcda4 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -636,26 +636,52 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
OS << getModRefStr(OtherMR);
}
- bool TargetPrintedForAll = false;
+ bool SkipLocGroup = false;
+ IRMemLocation LastToSkip;
+ const auto isInaccessibleMemLocSameForAll = [](MemoryEffects ME) -> bool {
+ ModRefInfo Expected = ME.getModRef(IRMemLocation::FirstInaccessible);
+ for (auto L : MemoryEffects::inaccessibleMemLocations()) {
+ if (Expected != ME.getModRef(L))
+ return false;
+ }
+ return true;
+ };
+
for (auto Loc : MemoryEffects::locations()) {
ModRefInfo MR = ME.getModRef(Loc);
if (MR == OtherMR)
continue;
- if (!First && !TargetPrintedForAll)
+ if (SkipLocGroup) {
+ if (Loc == LastToSkip)
+ SkipLocGroup = false;
+ continue;
+ }
+
+ if (!First && !SkipLocGroup)
OS << ", ";
First = false;
+ // If all inaccessible memory locations have the same value, ptint that
+ // value under "inaccessiblemem" key.
+ if (Loc == IRMemLocation::FirstInaccessible) {
+ if (isInaccessibleMemLocSameForAll(ME)) {
+ OS << "inaccessiblemem: ";
+ OS << getModRefStr(MR);
+ SkipLocGroup = true;
+ LastToSkip = IRMemLocation::LastInaccessible;
+ continue;
+ }
+ }
+
// isTargetMemLocSameForAll is fine for target location < 3
// If more targets are added it should do something like:
// memory(target_mem:read, target_mem3:none, target_mem5:write).
if (ME.isTargetMemLoc(Loc) && ME.isTargetMemLocSameForAll()) {
- if (!TargetPrintedForAll) {
- OS << "target_mem: ";
- OS << getModRefStr(MR);
- TargetPrintedForAll = true;
- }
- // Only works when target memories are last to be listed in Location.
+ OS << "target_mem: ";
+ OS << getModRefStr(MR);
+ SkipLocGroup = true;
+ LastToSkip = IRMemLocation::TargetMem1;
continue;
}
@@ -663,8 +689,8 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
case IRMemLocation::ArgMem:
OS << "argmem: ";
break;
- case IRMemLocation::InaccessibleMem:
- OS << "inaccessiblemem: ";
+ case IRMemLocation::ControlMem:
+ OS << "controlmem: ";
break;
case IRMemLocation::ErrnoMem:
OS << "errnomem: ";
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index c11e5f2ae12209..552a12b55552ce 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -899,25 +899,6 @@ void Function::setOnlyAccessesArgMemory() {
setMemoryEffects(getMemoryEffects() & MemoryEffects::argMemOnly());
}
-/// Determine if the function may only access memory that is
-/// inaccessible from the IR.
-bool Function::onlyAccessesInaccessibleMemory() const {
- return getMemoryEffects().onlyAccessesInaccessibleMem();
-}
-void Function::setOnlyAccessesInaccessibleMemory() {
- setMemoryEffects(getMemoryEffects() & MemoryEffects::inaccessibleMemOnly());
-}
-
-/// Determine if the function may only access memory that is
-/// either inaccessible from the IR or pointed to by its arguments.
-bool Function::onlyAccessesInaccessibleMemOrArgMem() const {
- return getMemoryEffects().onlyAccessesInaccessibleOrArgMem();
-}
-void Function::setOnlyAccessesInaccessibleMemOrArgMem() {
- setMemoryEffects(getMemoryEffects() &
- MemoryEffects::inaccessibleOrArgMemOnly());
-}
-
bool Function::isTargetIntrinsic() const {
return Intrinsic::isTargetIntrinsic(IntID);
}
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index 21381258af8f3f..84942be8e19431 100644
--- a/llvm/lib/IR/Instruction.cpp
+++ b/llvm/lib/IR/Instruction.cpp
@@ -1100,7 +1100,7 @@ MemoryEffects Instruction::getMemoryEffects() const {
return MemoryEffects::unknown();
if (IsVolatile)
- return MemoryEffects::inaccessibleOrArgMemOnly();
+ return MemoryEffects::controlOrArgMemOnly();
if (isStrongerThanUnordered(Ordering))
return MemoryEffects::argMemOnly();
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index ce1fa80806180e..798fbbdec49e55 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -686,7 +686,7 @@ MemoryEffects CallBase::getMemoryEffects() const {
}
if (isVolatile()) {
// Volatile operations also access inaccessible memory.
- FnME |= MemoryEffects::inaccessibleMemOnly();
+ FnME |= MemoryEffects::controlMemOnly();
}
ME &= FnME;
}
@@ -734,19 +734,12 @@ void CallBase::setOnlyAccessesArgMemory() {
bool CallBase::onlyAccessesInaccessibleMemory() const {
return getMemoryEffects().onlyAccessesInaccessibleMem();
}
-void CallBase::setOnlyAccessesInaccessibleMemory() {
- setMemoryEffects(getMemoryEffects() & MemoryEffects::inaccessibleMemOnly());
-}
/// Determine if the function may only access memory that is
/// either inaccessible from the IR or pointed to by its arguments.
bool CallBase::onlyAccessesInaccessibleMemOrArgMem() const {
return getMemoryEffects().onlyAccessesInaccessibleOrArgMem();
}
-void CallBase::setOnlyAccessesInaccessibleMemOrArgMem() {
- setMemoryEffects(getMemoryEffects() &
- MemoryEffects::inaccessibleOrArgMemOnly());
-}
CaptureInfo CallBase::getCaptureInfo(unsigned OpNo) const {
if (OpNo < arg_size()) {
diff --git a/llvm/lib/Support/ModRef.cpp b/llvm/lib/Support/ModRef.cpp
index 1083c72902c0b7..17e06b928d6d39 100644
--- a/llvm/lib/Support/ModRef.cpp
+++ b/llvm/lib/Support/ModRef.cpp
@@ -40,8 +40,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, MemoryEffects ME) {
case IRMemLocation::ArgMem:
OS << "ArgMem: ";
break;
- case IRMemLocation::InaccessibleMem:
- OS << "InaccessibleMem: ";
+ case IRMemLocation::ControlMem:
+ OS << "ControlMem: ";
break;
case IRMemLocation::ErrnoMem:
OS << "ErrnoMem: ";
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index edbaa95b4041b6..996da0b652b1cd 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -379,9 +379,7 @@ void llvm::removeASanIncompatibleFnAttributes(Function &F, bool ReadsArgMem) {
// read/write shadow memory, which is IRMemLocation::Other. Sanitizer
// instrumentation can instrument any memory accesses to non-inaccessible
// memory.
- if (!F.getMemoryEffects()
- .getWithoutLoc(IRMemLocation::InaccessibleMem)
- .doesNotAccessMemory() &&
+ if (!F.getMemoryEffects().onlyAccessesInaccessibleMem() &&
!isModAndRefSet(F.getMemoryEffects().getModRef(IRMemLocation::Other))) {
F.setMemoryEffects(F.getMemoryEffects() |
MemoryEffects::otherMemOnly(ModRefInfo::ModRef));
diff --git a/llvm/test/Assembler/memory-attribute-errors.ll b/llvm/test/Assembler/memory-attribute-errors.ll
index cf8690e07678ec..06cb2a71089184 100644
--- a/llvm/test/Assembler/memory-attribute-errors.ll
+++ b/llvm/test/Assembler/memory-attribute-errors.ll
@@ -13,16 +13,16 @@
; MISSING-ARGS: error: expected '('
declare void @fn() memory
;--- empty.ll
-; EMPTY: error: expected memory location (argmem, inaccessiblemem, errnomem) or access kind (none, read, write, readwrite)
+; EMPTY: error: expected memory location (argmem, errnomem, inaccessiblemem, controlmem, target_mem, target_mem0, target_mem1) or access kind (none, read, write, readwrite)
declare void @fn() memory()
;--- unterminated.ll
; UNTERMINATED: error: unterminated memory attribute
declare void @fn() memory(read
;--- invalid-kind.ll
-; INVALID-KIND: error: expected memory location (argmem, inaccessiblemem, errnomem) or access kind (none, read, write, readwrite)
+; INVALID-KIND: error: expected memory location (argmem, errnomem, inaccessiblemem, controlmem, target_mem, target_mem0, target_mem1) or access kind (none, read, write, readwrite)
declare void @fn() memory(foo)
;--- other.ll
-; OTHER: error: expected memory location (argmem, inaccessiblemem, errnomem) or access kind (none, read, write, readwrite)
+; OTHER: error: expected memory location (argmem, errnomem, inaccessiblemem, controlmem, target_mem, target_mem0, target_mem1) or access kind (none, read, write, readwrite)
declare void @fn() memory(other: read)
;--- missing-colon.ll
; MISSING-COLON: error: expected ':' after location
diff --git a/llvm/test/Assembler/memory-attribute.ll b/llvm/test/Assembler/memory-attribute.ll
index fd98384d90405b..1ae0d7706e0377 100644
--- a/llvm/test/Assembler/memory-attribute.ll
+++ b/llvm/test/Assembler/memory-attribute.ll
@@ -109,7 +109,7 @@ declare void @fn_read_target_mem0_write_mem_target1()
declare void @fn_inaccessiblemem_write_new()
memory(inaccessiblemem: write)
-; CHECK: Function Attrs: memory(inaccessiblemem: read, target_mem: read)
+; CHECK: Function Attrs: memory(inaccessiblemem: read)
; CHECK: @fn_inaccessiblemem_target_mem0_1read()
declare void @fn_inaccessiblemem_target_mem0_1read()
memory(inaccessiblemem: read, target_mem0: read, target_mem1: read)
@@ -119,7 +119,7 @@ declare void @fn_inaccessiblemem_target_mem0_1read()
declare void @fn_inaccessiblemem_none_target_mem0_read()
memory(inaccessiblemem: none, target_mem0: read)
-; CHECK: Function Attrs: memory(write, inaccessiblemem: read)
+; CHECK: Function Attrs: memory(write, controlmem: read, target_mem1: read)
; CHECK: @fn_write_inaccessiblemem_read_target_mem0_write
declare void @fn_write_inaccessiblemem_read_target_mem0_write()
memory(write, inaccessiblemem: read, target_mem0: write)
diff --git a/llvm/test/Bitcode/compatibility-3.6.ll b/llvm/test/Bitcode/compatibility-3.6.ll
index 75b07f7dd9fc15..53ef81aa4f0b09 100644
--- a/llvm/test/Bitcode/compatibility-3.6.ll
+++ b/llvm/test/Bitcode/compatibility-3.6.ll
@@ -1184,7 +1184,7 @@ define void @intrinsics.codegen() {
; CHECK: attributes #32 = { nocallback nofree nosync nounwind willreturn memory(read) }
; CHECK: attributes #33 = { nocallback nounwind }
; CHECK: attributes #34 = { nocallback nofree nosync nounwind willreturn }
-; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #36 = { builtin }
;; Metadata
diff --git a/llvm/test/Bitcode/compatibility-3.7.ll b/llvm/test/Bitcode/compatibility-3.7.ll
index bd4970abd8767c..e7405a156f7b95 100644
--- a/llvm/test/Bitcode/compatibility-3.7.ll
+++ b/llvm/test/Bitcode/compatibility-3.7.ll
@@ -1247,7 +1247,7 @@ define void @misc.metadata() {
; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(read) }
; CHECK: attributes #36 = { nocallback nounwind }
; CHECK: attributes #37 = { nocallback nofree nosync nounwind willreturn }
-; CHECK: attributes #38 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #38 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #39 = { builtin }
;; Metadata
diff --git a/llvm/test/Bitcode/compatibility-3.8.ll b/llvm/test/Bitcode/compatibility-3.8.ll
index 77b162d98fbfe6..6d79f8e5c4a434 100644
--- a/llvm/test/Bitcode/compatibility-3.8.ll
+++ b/llvm/test/Bitcode/compatibility-3.8.ll
@@ -1557,7 +1557,7 @@ normal:
; CHECK: attributes #38 = { nocallback nofree nosync nounwind willreturn memory(read) }
; CHECK: attributes #39 = { nocallback nounwind }
; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn }
-; CHECK: attributes #41 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #41 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #42 = { builtin }
;; Metadata
diff --git a/llvm/test/Bitcode/compatibility-3.9.ll b/llvm/test/Bitcode/compatibility-3.9.ll
index 4ffa9351066b10..8496e2d7eef45f 100644
--- a/llvm/test/Bitcode/compatibility-3.9.ll
+++ b/llvm/test/Bitcode/compatibility-3.9.ll
@@ -1631,7 +1631,7 @@ declare void @f.writeonly() writeonly
; CHECK: attributes #39 = { nocallback nounwind }
; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn }
; CHECK: attributes #41 = { memory(write) }
-; CHECK: attributes #42 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #42 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #43 = { builtin }
;; Metadata
diff --git a/llvm/test/Bitcode/compatibility-4.0.ll b/llvm/test/Bitcode/compatibility-4.0.ll
index d883bb56a04c6c..f8fc0987bef81d 100644
--- a/llvm/test/Bitcode/compatibility-4.0.ll
+++ b/llvm/test/Bitcode/compatibility-4.0.ll
@@ -1656,7 +1656,7 @@ define i8** @constexpr() {
; CHECK: attributes #39 = { nocallback nounwind }
; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn }
; CHECK: attributes #41 = { memory(write) }
-; CHECK: attributes #42 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #42 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #43 = { builtin }
;; Metadata
diff --git a/llvm/test/Bitcode/compatibility-5.0.ll b/llvm/test/Bitcode/compatibility-5.0.ll
index 90184dddef3453..9843c996d3a557 100644
--- a/llvm/test/Bitcode/compatibility-5.0.ll
+++ b/llvm/test/Bitcode/compatibility-5.0.ll
@@ -1672,7 +1672,7 @@ define i8** @constexpr() {
; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn }
; CHECK: attributes #41 = { memory(write) }
; CHECK: attributes #42 = { speculatable }
-; CHECK: attributes #43 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #43 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #44 = { builtin }
;; Metadata
diff --git a/llvm/test/Bitcode/compatibility-6.0.ll b/llvm/test/Bitcode/compatibility-6.0.ll
index 53d2f80c697bc2..c1d1bb0ba8a355 100644
--- a/llvm/test/Bitcode/compatibility-6.0.ll
+++ b/llvm/test/Bitcode/compatibility-6.0.ll
@@ -1682,7 +1682,7 @@ define i8** @constexpr() {
; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn }
; CHECK: attributes #41 = { memory(write) }
; CHECK: attributes #42 = { speculatable }
-; CHECK: attributes #43 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #43 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #44 = { builtin }
;; Metadata
diff --git a/llvm/test/Bitcode/compatibility.ll b/llvm/test/Bitcode/compatibility.ll
index 61e7b25787bbd9..7ca80f7a08cc24 100644
--- a/llvm/test/Bitcode/compatibility.ll
+++ b/llvm/test/Bitcode/compatibility.ll
@@ -2610,7 +2610,7 @@ declare void @f.sanitize_concurrency() sanitize_concurrency
; CHECK: attributes #37 = { nounwind memory(argmem: readwrite) }
; CHECK: attributes #38 = { nocallback nofree nosync nounwind willreturn memory(read) }
; CHECK: attributes #39 = { nocallback nounwind }
-; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #41 = { nocallback nofree nosync nounwind willreturn }
; CHECK: attributes #42 = { memory(write) }
; CHECK: attributes #43 = { speculatable }
diff --git a/llvm/test/Bitcode/memory-attribute-upgrade.ll b/llvm/test/Bitcode/memory-attribute-upgrade.ll
index 2d8eb12eaccf7c..915b62a88935d0 100644
--- a/llvm/test/Bitcode/memory-attribute-upgrade.ll
+++ b/llvm/test/Bitcode/memory-attribute-upgrade.ll
@@ -1,7 +1,7 @@
; RUN: llvm-dis < %S/Inputs/memory-attribute-upgrade.bc | FileCheck %s
-; CHECK: ; Function Attrs: memory(write, argmem: read, target_mem: none)
+; CHECK: ; Function Attrs: memory(write, argmem: read)
; CHECK-NEXT: define void @test_any_write_argmem_read(ptr %p)
-; CHECK: ; Function Attrs: memory(read, argmem: readwrite, inaccessiblemem: none, target_mem: none)
+; CHECK: ; Function Attrs: memory(read, argmem: readwrite, inaccessiblemem: none)
; CHECK-NEXT: define void @test_any_read_argmem_readwrite(ptr %p)
diff --git a/llvm/test/Bitcode/target-memory-attribute.ll b/llvm/test/Bitcode/target-memory-attribute.ll
index 0349f56aca5345..084ff7e49cb2ff 100644
--- a/llvm/test/Bitcode/target-memory-attribute.ll
+++ b/llvm/test/Bitcode/target-memory-attribute.ll
@@ -7,7 +7,7 @@
define void @test_inaccessible_read() #0 {
-; AARCH64: ; Function Attrs: memory(inaccessiblemem: read, target_mem: read)
+; AARCH64: ; Function Attrs: memory(inaccessiblemem: read)
; AARCH64-NEXT: define void @test_inaccessible_read()
; NON-AARCH64: ; Function Attrs: memory(inaccessiblemem: read)
; NON-AARCH64-NEXT: define void @test_inaccessible_read()
@@ -15,7 +15,7 @@ define void @test_inaccessible_read() #0 {
}
define void @test_inaccessible_readwrite() #1 {
-; AARCH64: ; Function Attrs: memory(inaccessiblemem: readwrite, target_mem: readwrite)
+; AARCH64: ; Function Attrs: memory(inaccessiblemem: readwrite)
; AARCH64-NEXT: define void @test_inaccessible_readwrite()
; NON-AARCH64: ; Function Attrs: memory(inaccessiblemem: readwrite)
; NON-AARCH64-NEXT: define void @test_inaccessible_readwrite()
diff --git a/llvm/test/Instrumentation/AddressSanitizer/remove-memory-effects.ll b/llvm/test/Instrumentation/AddressSanitizer/remove-memory-effects.ll
index dd8a5075d7acff..375a934f97b5c8 100644
--- a/llvm/test/Instrumentation/AddressSanitizer/remove-memory-effects.ll
+++ b/llvm/test/Instrumentation/AddressSanitizer/remove-memory-effects.ll
@@ -22,7 +22,7 @@ entry:
ret void
}
-; CHECK: attributes #[[ATTRS_FOO]] = { nobuiltin memory(readwrite, argmem: write, inaccessiblemem: none
-; CHECK: attributes #[[ATTRS_FOO2]] = { nobuiltin memory(readwrite, inaccessiblemem: write
+; CHECK: attributes #[[ATTRS_FOO]] = { nobuiltin memory(readwrite, argmem: write, errnomem: none, inaccessiblemem: none
+; CHECK: attributes #[[ATTRS_FOO2]] = { nobuiltin memory(readwrite, errnomem: none, inaccessiblemem: write
; CHECK: attributes #[[ATTRS_FOO3]] = { memory(inaccessiblemem: write) }
; CHECK: attributes #[[ATTRS_BAR]] = { sanitize_address }
diff --git a/llvm/test/Instrumentation/HWAddressSanitizer/mem-attr.ll b/llvm/test/Instrumentation/HWAddressSanitizer/mem-attr.ll
index 422c8b7a76863c..f7f3f81c241bab 100644
--- a/llvm/test/Instrumentation/HWAddressSanitizer/mem-attr.ll
+++ b/llvm/test/Instrumentation/HWAddressSanitizer/mem-attr.ll
@@ -18,7 +18,7 @@ entry:
ret void
}
-; CHECK: attributes #0 = { nobuiltin sanitize_hwaddress memory(readwrite, inaccessiblemem: none{{.*}}){{.*}} }
-; CHECK: attributes #1 = { nobuiltin sanitize_hwaddress memory(readwrite, argmem: read, inaccessiblemem: none{{.*}}){{.*}} }
+; CHECK: attributes #0 = { nobuiltin sanitize_hwaddress memory(readwrite, errnomem: none, inaccessiblemem: none{{.*}}){{.*}} }
+; CHECK: attributes #1 = { nobuiltin sanitize_hwaddress memory(readwrite, argmem: read, errnomem: none, inaccessiblemem: none{{.*}}){{.*}} }
attributes #0 = { sanitize_hwaddress memory(argmem: write) uwtable }
attributes #1 = { sanitize_hwaddress memory(argmem: read) uwtable }
diff --git a/llvm/test/TableGen/target-mem-intrinsic-attrs.td b/llvm/test/TableGen/target-mem-intrinsic-attrs.td
index b3e1b5a8a55e25..4acf1c1bfe6496 100644
--- a/llvm/test/TableGen/target-mem-intrinsic-attrs.td
+++ b/llvm/test/TableGen/target-mem-intrinsic-attrs.td
@@ -10,7 +10,7 @@ def int_aarch64_get_target_mem1 : DefaultAttrsIntrinsic<[], [llvm_i64_ty], [In
def int_aarch64_get_target_mem1_set_target_mem1 : DefaultAttrsIntrinsic<[], [llvm_i64_ty], [IntrRead<[TargetMem1]>, IntrWrite<[TargetMem1]>]>;
-def int_aarch64_set_inaccessible_mem : DefaultAttrsIntrinsic<[], [llvm_i64_ty], [IntrWriteMem, IntrWrite<[InaccessibleMem]>]>;
+def int_aarch64_set_control_mem : DefaultAttrsIntrinsic<[], [llvm_i64_ty], [IntrWriteMem, IntrWrite<[ControlMem]>]>;
def int_aarch64_set_target_mem0 : DefaultAttrsIntrinsic<[], [llvm_i64_ty], [IntrWriteMem, IntrWrite<[TargetMem0]>]>;
@@ -23,41 +23,41 @@ def int_aarch64_target_mem1_read_argmem_write : DefaultAttrsIntrinsic<[], [llv
def int_aarch64_target_mem0_read_argmem_write : DefaultAttrsIntrinsic<[], [llvm_i64_ty], [IntrRead<[TargetMem0]>, IntrWrite<[ArgMem]>]>;
// CHECK-LABEL: case 0: // llvm.aarch64.argmem.read.target.mem1.write
-// CHECK: // ArgMem: Ref, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: NoModRef, TargetMem1: Mod
+// CHECK: // ArgMem: Ref, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: NoModRef, TargetMem1: Mod
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(2049)),
// CHECK-LABEL: case 1: // llvm.aarch64.argmem.target.mem1.read.target.mem1.write
-// CHECK: // ArgMem: Ref, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: NoModRef, TargetMem1: ModRef
+// CHECK: // ArgMem: Ref, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: NoModRef, TargetMem1: ModRef
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(3073)),
// CHECK-LABEL: case 2: // llvm.aarch64.get.target.mem0.mem1
-// CHECK: // ArgMem: NoModRef, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: Ref, TargetMem1: Ref
+// CHECK: // ArgMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: Ref, TargetMem1: Ref
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(1280)),
// CHECK-LABEL: case 3: // llvm.aarch64.get.target.mem0.set.target.mem1
-// CHECK: // ArgMem: NoModRef, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: Ref, TargetMem1: Mod
+// CHECK: // ArgMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: Ref, TargetMem1: Mod
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(2304)),
// CHECK-LABEL: case 4: // llvm.aarch64.get.target.mem1
-// CHECK: // ArgMem: NoModRef, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: NoModRef, TargetMem1: Ref
+// CHECK: // ArgMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: NoModRef, TargetMem1: Ref
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(1024)),
// CHECK-LABEL: case 5: // llvm.aarch64.get.target.mem1.set.target.mem1
-// CHECK: // ArgMem: NoModRef, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: NoModRef, TargetMem1: ModRef
+// CHECK: // ArgMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: NoModRef, TargetMem1: ModRef
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(3072)),
-// CHECK-LABEL: case 6: // llvm.aarch64.set.inaccessible.mem
-// CHECK: // ArgMem: NoModRef, InaccessibleMem: Mod, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: NoModRef, TargetMem1: NoModRef
-// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(8)),
+// CHECK-LABEL: case 6: // llvm.aarch64.set.control.mem
+// CHECK: // ArgMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: Mod, TargetMem0: NoModRef, TargetMem1: NoModRef
+// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(128)),
// CHECK-LABEL: case 7: // llvm.aarch64.set.target.mem0
-// CHECK: // ArgMem: NoModRef, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: Mod, TargetMem1: NoModRef
+// CHECK: // ArgMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: Mod, TargetMem1: NoModRef
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(512)),
// CHECK-LABEL: case 8: // llvm.aarch64.target.mem0.read.argmem.write
-// CHECK: // ArgMem: Mod, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: Ref, TargetMem1: NoModRef
+// CHECK: // ArgMem: Mod, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: Ref, TargetMem1: NoModRef
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(258)),
// CHECK-LABEL: case 9: // llvm.aarch64.target.mem1.read.argmem.write
-// CHECK: // ArgMem: Mod, InaccessibleMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, TargetMem0: NoModRef, TargetMem1: Ref
+// CHECK: // ArgMem: Mod, ErrnoMem: NoModRef, Other: NoModRef, ControlMem: NoModRef, TargetMem0: NoModRef, TargetMem1: Ref
// CHECK-NEXT: Attribute::getWithMemoryEffects(C, MemoryEffects::createFromIntValue(1026)),
diff --git a/llvm/test/Transforms/EarlyCSE/target-memory.ll b/llvm/test/Transforms/EarlyCSE/target-memory.ll
index 74fda76e1c22b3..ac90a2c7b6540a 100644
--- a/llvm/test/Transforms/EarlyCSE/target-memory.ll
+++ b/llvm/test/Transforms/EarlyCSE/target-memory.ll
@@ -84,14 +84,14 @@ define void @f1(i64 %x, i64 %y){
define void @bar(){
; CHECK-LABEL: define void @bar() {
; CHECK-NEXT: call void @fn_write_target1()
-; CHECK-NEXT: call void @fn_write_inaccessiblemem()
-; CHECK-NEXT: call void @fn_read_inaccessiblemem()
+; CHECK-NEXT: call void @fn_write_controlmem()
+; CHECK-NEXT: call void @fn_read_controlmem()
; CHECK-NEXT: ret void
;
call void @fn_write_target1()
- call void @fn_write_inaccessiblemem()
+ call void @fn_write_controlmem()
call void @fn_write_target1()
- call void @fn_read_inaccessiblemem()
+ call void @fn_read_controlmem()
ret void
}
@@ -103,10 +103,10 @@ declare void @fn_read_target1()
declare void @fn_read_target0_readwrite_target1()
memory(target_mem0: read, target_mem1: readwrite)
-declare void @fn_read_inaccessiblemem()
+declare void @fn_read_controlmem()
memory(inaccessiblemem: read)
-declare void @fn_write_inaccessiblemem()
- memory(inaccessiblemem: write)
+declare void @fn_write_controlmem()
+ memory(controlmem: write)
declare void @fn_readwrite_target0_read_target1()
diff --git a/llvm/test/Transforms/FunctionAttrs/argmemonly.ll b/llvm/test/Transforms/FunctionAttrs/argmemonly.ll
index b1a44c94fd0463..97f0917f7ef74c 100644
--- a/llvm/test/Transforms/FunctionAttrs/argmemonly.ll
+++ b/llvm/test/Transforms/FunctionAttrs/argmemonly.ll
@@ -56,7 +56,7 @@ entry:
}
define i32 @test_read_global() {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define i32 @test_read_global
; FNATTRS-SAME: () #[[ATTR2:[0-9]+]] {
; FNATTRS-NEXT: entry:
@@ -76,7 +76,7 @@ entry:
}
define i32 @test_read_loaded_ptr(ptr %ptr) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none)
; FNATTRS-LABEL: define i32 @test_read_loaded_ptr
; FNATTRS-SAME: (ptr nofree readonly captures(none) [[PTR:%.*]]) #[[ATTR3:[0-9]+]] {
; FNATTRS-NEXT: entry:
@@ -119,7 +119,7 @@ entry:
}
define void @test_write_global() {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test_write_global
; FNATTRS-SAME: () #[[ATTR5:[0-9]+]] {
; FNATTRS-NEXT: entry:
@@ -243,7 +243,7 @@ declare void @llvm.memcpy.p0.p0.i64(ptr, ptr, i64, i1)
@arr = global [32 x i8] zeroinitializer
define void @test_memcpy_src_global(ptr %dst) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test_memcpy_src_global
; FNATTRS-SAME: (ptr nofree writeonly captures(none) initializes((0, 32)) [[DST:%.*]]) #[[ATTR11:[0-9]+]] {
; FNATTRS-NEXT: entry:
@@ -263,7 +263,7 @@ entry:
}
define void @test_memcpy_dst_global(ptr %src) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test_memcpy_dst_global
; FNATTRS-SAME: (ptr nofree readonly captures(none) [[SRC:%.*]]) #[[ATTR11]] {
; FNATTRS-NEXT: entry:
@@ -388,7 +388,7 @@ define void @test_inaccessibleorargmemonly_readwrite(ptr %arg) {
}
define void @test_recursive_argmem_read(ptr %p) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test_recursive_argmem_read
; FNATTRS-SAME: (ptr nofree readonly captures(none) [[P:%.*]]) #[[ATTR16:[0-9]+]] {
; FNATTRS-NEXT: [[PVAL:%.*]] = load ptr, ptr [[P]], align 8
@@ -408,7 +408,7 @@ define void @test_recursive_argmem_read(ptr %p) {
}
define void @test_recursive_argmem_readwrite(ptr %p) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test_recursive_argmem_readwrite
; FNATTRS-SAME: (ptr nofree captures(none) [[P:%.*]]) #[[ATTR17:[0-9]+]] {
; FNATTRS-NEXT: [[PVAL:%.*]] = load ptr, ptr [[P]], align 8
@@ -454,7 +454,7 @@ define void @test_recursive_argmem_read_alloca(ptr %p) {
}
define void @test_scc_argmem_read_1(ptr %p) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test_scc_argmem_read_1
; FNATTRS-SAME: (ptr nofree readonly captures(none) [[P:%.*]]) #[[ATTR16]] {
; FNATTRS-NEXT: [[PVAL:%.*]] = load ptr, ptr [[P]], align 8
@@ -474,7 +474,7 @@ define void @test_scc_argmem_read_1(ptr %p) {
}
define void @test_scc_argmem_read_2(ptr %p) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test_scc_argmem_read_2
; FNATTRS-SAME: (ptr nofree readonly captures(none) [[P:%.*]]) #[[ATTR16]] {
; FNATTRS-NEXT: call void @test_scc_argmem_read_1(ptr [[P]])
@@ -518,7 +518,7 @@ entry:
; FIXME: This could be `memory(argmem: read)`.
define i64 @select_different_obj(i1 %c, ptr %p, ptr %p2) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none)
; FNATTRS-LABEL: define i64 @select_different_obj
; FNATTRS-SAME: (i1 [[C:%.*]], ptr nofree readonly captures(none) [[P:%.*]], ptr nofree readonly captures(none) [[P2:%.*]]) #[[ATTR3]] {
; FNATTRS-NEXT: entry:
@@ -567,7 +567,7 @@ join:
; FIXME: This could be `memory(argmem: read)`.
define i64 @phi_different_obj(i1 %c, ptr %p, ptr %p2) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none)
; FNATTRS-LABEL: define i64 @phi_different_obj
; FNATTRS-SAME: (i1 [[C:%.*]], ptr nofree readonly captures(none) [[P:%.*]], ptr nofree readonly captures(none) [[P2:%.*]]) #[[ATTR3]] {
; FNATTRS-NEXT: entry:
diff --git a/llvm/test/Transforms/FunctionAttrs/atomic.ll b/llvm/test/Transforms/FunctionAttrs/atomic.ll
index 7d7695a88e2d05..148933f815a93c 100644
--- a/llvm/test/Transforms/FunctionAttrs/atomic.ll
+++ b/llvm/test/Transforms/FunctionAttrs/atomic.ll
@@ -110,7 +110,7 @@ define void @atomicrmw_acq_rel_arg(ptr %x) {
}
define void @atomicrmw_monotonic_volatile_arg(ptr %x) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; CHECK-LABEL: define void @atomicrmw_monotonic_volatile_arg(
; CHECK-SAME: ptr nofree captures(address) [[X:%.*]]) #[[ATTR3:[0-9]+]] {
; CHECK-NEXT: [[TMP1:%.*]] = atomicrmw volatile add ptr [[X]], i32 1 monotonic, align 4
@@ -154,7 +154,7 @@ define void @cmpxchg_monotonic_acquire_arg(ptr %x) {
}
define void @cmpxchg_monotonic_volatile_arg(ptr %x) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; CHECK-LABEL: define void @cmpxchg_monotonic_volatile_arg(
; CHECK-SAME: ptr nofree captures(address) [[X:%.*]]) #[[ATTR3]] {
; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg volatile ptr [[X]], i32 0, i32 1 monotonic monotonic, align 4
diff --git a/llvm/test/Transforms/FunctionAttrs/initializes.ll b/llvm/test/Transforms/FunctionAttrs/initializes.ll
index c41041c3eabd8f..3fe55e9e517b67 100644
--- a/llvm/test/Transforms/FunctionAttrs/initializes.ll
+++ b/llvm/test/Transforms/FunctionAttrs/initializes.ll
@@ -128,7 +128,7 @@ define void @store_offset(ptr %p) {
}
define void @store_volatile(ptr %p) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; CHECK-LABEL: define void @store_volatile(
; CHECK-SAME: ptr nofree captures(address) [[P:%.*]]) #[[ATTR2:[0-9]+]] {
; CHECK-NEXT: [[G:%.*]] = getelementptr i8, ptr [[P]], i64 8
@@ -443,7 +443,7 @@ define void @memset_neg(ptr %p) {
}
define void @memset_volatile(ptr %p) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: write, inaccessiblemem: readwrite)
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: write, controlmem: readwrite)
; CHECK-LABEL: define void @memset_volatile(
; CHECK-SAME: ptr nofree writeonly captures(address) [[P:%.*]]) #[[ATTR5:[0-9]+]] {
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[P]], i8 2, i64 9, i1 true)
@@ -478,9 +478,9 @@ define void @memcpy(ptr %p, ptr %p2) {
}
define void @memcpy_volatile(ptr %p, ptr %p2) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; CHECK-LABEL: define void @memcpy_volatile(
-; CHECK-SAME: ptr nofree writeonly captures(address) [[P:%.*]], ptr nofree readonly captures(address) [[P2:%.*]]) #[[ATTR2]] {
+; CHECK-SAME: ptr nofree writeonly captures(address) [[P:%.*]], ptr nofree readonly captures(address) [[P2:%.*]]) #[[ATTR6:[0-9]+]] {
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr [[P]], ptr [[P2]], i64 9, i1 true)
; CHECK-NEXT: ret void
;
@@ -541,9 +541,9 @@ define void @memmove(ptr %p, ptr %p2) {
}
define void @memmove_volatile(ptr %p, ptr %p2) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; CHECK-LABEL: define void @memmove_volatile(
-; CHECK-SAME: ptr nofree writeonly captures(address) [[P:%.*]], ptr nofree readonly captures(address) [[P2:%.*]]) #[[ATTR2]] {
+; CHECK-SAME: ptr nofree writeonly captures(address) [[P:%.*]], ptr nofree readonly captures(address) [[P2:%.*]]) #[[ATTR6]] {
; CHECK-NEXT: call void @llvm.memmove.p0.p0.i64(ptr [[P]], ptr [[P2]], i64 9, i1 true)
; CHECK-NEXT: ret void
;
diff --git a/llvm/test/Transforms/FunctionAttrs/nocapture.ll b/llvm/test/Transforms/FunctionAttrs/nocapture.ll
index bf7904f4089155..ad981b1d76db77 100644
--- a/llvm/test/Transforms/FunctionAttrs/nocapture.ll
+++ b/llvm/test/Transforms/FunctionAttrs/nocapture.ll
@@ -20,7 +20,7 @@ define ptr @c1(ptr %q) {
; It would also be acceptable to mark %q as readnone. Update @c3 too.
define void @c2(ptr %q) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define void @c2(
; FNATTRS-SAME: ptr [[Q:%.*]]) #[[ATTR1:[0-9]+]] {
; FNATTRS-NEXT: store ptr [[Q]], ptr @g, align 8
@@ -37,7 +37,7 @@ define void @c2(ptr %q) {
}
define void @c3(ptr %q) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none)
; FNATTRS-LABEL: define void @c3(
; FNATTRS-SAME: ptr [[Q:%.*]]) #[[ATTR2:[0-9]+]] {
; FNATTRS-NEXT: call void @c2(ptr [[Q]])
@@ -127,7 +127,7 @@ l1:
@lookup_table = global [2 x i1] [ i1 0, i1 1 ]
define i1 @c5(ptr %q, i32 %bitno) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define i1 @c5(
; FNATTRS-SAME: ptr [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR3:[0-9]+]] {
; FNATTRS-NEXT: [[TMP:%.*]] = ptrtoint ptr [[Q]] to i32
@@ -222,7 +222,7 @@ define ptr @lookup_bit(ptr %q, i32 %bitno) readnone nounwind {
}
define i1 @c7(ptr %q, i32 %bitno) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none)
; FNATTRS-LABEL: define i1 @c7(
; FNATTRS-SAME: ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR6:[0-9]+]] {
; FNATTRS-NEXT: [[PTR:%.*]] = call ptr @lookup_bit(ptr [[Q]], i32 [[BITNO]])
@@ -243,7 +243,7 @@ define i1 @c7(ptr %q, i32 %bitno) {
define i32 @nc1(ptr %q, ptr %p, i1 %b) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
; FNATTRS-LABEL: define i32 @nc1(
; FNATTRS-SAME: ptr [[Q:%.*]], ptr nofree captures(none) [[P:%.*]], i1 [[B:%.*]]) #[[ATTR7:[0-9]+]] {
; FNATTRS-NEXT: [[E:.*]]:
@@ -284,7 +284,7 @@ l:
}
define i32 @nc1_addrspace(ptr %q, ptr addrspace(1) %p, i1 %b) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
; FNATTRS-LABEL: define i32 @nc1_addrspace(
; FNATTRS-SAME: ptr [[Q:%.*]], ptr addrspace(1) nofree captures(none) [[P:%.*]], i1 [[B:%.*]]) #[[ATTR7]] {
; FNATTRS-NEXT: [[E:.*]]:
@@ -328,7 +328,7 @@ l:
}
define void @nc2(ptr %p, ptr %q) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
; FNATTRS-LABEL: define void @nc2(
; FNATTRS-SAME: ptr nofree captures(none) [[P:%.*]], ptr [[Q:%.*]]) #[[ATTR7]] {
; FNATTRS-NEXT: [[TMP1:%.*]] = call i32 @nc1(ptr [[Q]], ptr [[P]], i1 false)
@@ -468,7 +468,7 @@ define void @self_readonly_nounwind_willreturn(ptr %p) readonly nounwind willret
; It would be acceptable to add readnone to %y1_1 and %y1_2.
define void @test1_1(ptr %x1_1, ptr %y1_1, i1 %c) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test1_1(
; FNATTRS-SAME: ptr nofree readnone captures(none) [[X1_1:%.*]], ptr [[Y1_1:%.*]], i1 [[C:%.*]]) #[[ATTR12:[0-9]+]] {
; FNATTRS-NEXT: [[TMP1:%.*]] = call ptr @test1_2(ptr [[X1_1]], ptr [[Y1_1]], i1 [[C]])
@@ -488,7 +488,7 @@ define void @test1_1(ptr %x1_1, ptr %y1_1, i1 %c) {
}
define ptr @test1_2(ptr %x1_2, ptr %y1_2, i1 %c) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define ptr @test1_2(
; FNATTRS-SAME: ptr nofree readnone captures(none) [[X1_2:%.*]], ptr returned [[Y1_2:%.*]], i1 [[C:%.*]]) #[[ATTR12]] {
; FNATTRS-NEXT: br i1 [[C]], label %[[T:.*]], label %[[F:.*]]
@@ -520,7 +520,7 @@ f:
}
define void @test2(ptr %x2) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test2(
; FNATTRS-SAME: ptr nofree readnone captures(none) [[X2:%.*]]) #[[ATTR12]] {
; FNATTRS-NEXT: call void @test2(ptr [[X2]])
@@ -540,7 +540,7 @@ define void @test2(ptr %x2) {
}
define void @test3(ptr %x3, ptr %y3, ptr %z3) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test3(
; FNATTRS-SAME: ptr nofree readnone captures(none) [[X3:%.*]], ptr nofree readnone captures(none) [[Y3:%.*]], ptr nofree readnone captures(none) [[Z3:%.*]]) #[[ATTR12]] {
; FNATTRS-NEXT: call void @test3(ptr [[Z3]], ptr [[Y3]], ptr [[X3]])
@@ -560,7 +560,7 @@ define void @test3(ptr %x3, ptr %y3, ptr %z3) {
}
define void @test4_1(ptr %x4_1, i1 %c) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define void @test4_1(
; FNATTRS-SAME: ptr [[X4_1:%.*]], i1 [[C:%.*]]) #[[ATTR12]] {
; FNATTRS-NEXT: [[TMP1:%.*]] = call ptr @test4_2(ptr [[X4_1]], ptr [[X4_1]], ptr [[X4_1]], i1 [[C]])
@@ -580,7 +580,7 @@ define void @test4_1(ptr %x4_1, i1 %c) {
}
define ptr @test4_2(ptr %x4_2, ptr %y4_2, ptr %z4_2, i1 %c) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define ptr @test4_2(
; FNATTRS-SAME: ptr nofree readnone captures(none) [[X4_2:%.*]], ptr nofree readnone returned captures(ret: address, provenance) [[Y4_2:%.*]], ptr nofree readnone captures(none) [[Z4_2:%.*]], i1 [[C:%.*]]) #[[ATTR12]] {
; FNATTRS-NEXT: br i1 [[C]], label %[[T:.*]], label %[[F:.*]]
@@ -697,7 +697,7 @@ define void @test_atomicrmw(ptr %p) {
}
define void @test_volatile(ptr %x) {
-; FNATTRS: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; FNATTRS: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; FNATTRS-LABEL: define void @test_volatile(
; FNATTRS-SAME: ptr nofree captures(address) [[X:%.*]]) #[[ATTR14:[0-9]+]] {
; FNATTRS-NEXT: [[ENTRY:.*:]]
@@ -744,7 +744,7 @@ entry:
@g2 = global ptr null
define void @captureLaunder(ptr %p) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite)
; FNATTRS-LABEL: define void @captureLaunder(
; FNATTRS-SAME: ptr [[P:%.*]]) #[[ATTR16:[0-9]+]] {
; FNATTRS-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[P]])
@@ -1042,7 +1042,7 @@ define i64 @captures_not_ret_only(ptr %p) {
;; Unlike ptrtoint, ptrtoaddr only captures the address
define i64 @captures_ptrtoaddr_stored(ptr %p) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define noundef i64 @captures_ptrtoaddr_stored(
; FNATTRS-SAME: ptr nofree readnone captures(address) [[P:%.*]]) #[[ATTR1]] {
; FNATTRS-NEXT: [[INT:%.*]] = ptrtoaddr ptr [[P]] to i64
@@ -1145,7 +1145,7 @@ define ptr @captures_used_ret(ptr %p) {
; Make sure this is does not produce captures(ret: ...). We need to take the
; return capture components into account when handling argument SCCs.
define ptr @scc_capture_via_ret(i1 %c, ptr %p) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define ptr @scc_capture_via_ret(
; FNATTRS-SAME: i1 [[C:%.*]], ptr [[P:%.*]]) #[[ATTR12]] {
; FNATTRS-NEXT: br i1 [[C]], label %[[IF:.*]], label %[[ELSE:.*]]
@@ -1247,7 +1247,7 @@ define void @dont_increase_existing_captures_scc2(ptr %p) {
}
define void @addr_only_scc(ptr %p) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none)
; FNATTRS-LABEL: define void @addr_only_scc(
; FNATTRS-SAME: ptr nofree readonly captures(address_is_null) [[P:%.*]]) #[[ATTR19:[0-9]+]] {
; FNATTRS-NEXT: [[V:%.*]] = load i8, ptr [[P]], align 1
@@ -1270,7 +1270,7 @@ define void @addr_only_scc(ptr %p) {
}
define void @addr_only_scc2(ptr %p) {
-; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none)
; FNATTRS-LABEL: define void @addr_only_scc2(
; FNATTRS-SAME: ptr nofree readonly captures(address_is_null) [[P:%.*]]) #[[ATTR19]] {
; FNATTRS-NEXT: [[CMP:%.*]] = icmp ne ptr [[P]], null
diff --git a/llvm/test/Transforms/FunctionAttrs/nofpclass.ll b/llvm/test/Transforms/FunctionAttrs/nofpclass.ll
index 2d5c87c526281c..5ff517427900a6 100644
--- a/llvm/test/Transforms/FunctionAttrs/nofpclass.ll
+++ b/llvm/test/Transforms/FunctionAttrs/nofpclass.ll
@@ -308,8 +308,8 @@ define float @caller_transitive_nonan(float %arg, ptr %ptr) {
ret float %ret
}
;.
-; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite) }
-; CHECK: attributes #[[ATTR1]] = { nofree nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite) }
+; CHECK: attributes #[[ATTR1]] = { nofree nosync nounwind memory(argmem: readwrite, controlmem: readwrite) }
; CHECK: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CHECK: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
;.
diff --git a/llvm/test/Transforms/FunctionAttrs/nosync.ll b/llvm/test/Transforms/FunctionAttrs/nosync.ll
index 0579d2eabd3fa2..598e4333bf29d6 100644
--- a/llvm/test/Transforms/FunctionAttrs/nosync.ll
+++ b/llvm/test/Transforms/FunctionAttrs/nosync.ll
@@ -182,7 +182,7 @@ define void @load_volatile_release(ptr nocapture %0) norecurse nounwind uwtable
; volatile store.
define void @volatile_store(ptr %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite) uwtable
; CHECK-LABEL: @volatile_store(
; CHECK-NEXT: store volatile i32 14, ptr [[TMP0:%.*]], align 4
; CHECK-NEXT: ret void
@@ -194,7 +194,7 @@ define void @volatile_store(ptr %0) norecurse nounwind uwtable {
; negative, should not deduce nosync
; volatile load.
define i32 @volatile_load(ptr %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite) uwtable
; CHECK-LABEL: @volatile_load(
; CHECK-NEXT: [[TMP2:%.*]] = load volatile i32, ptr [[TMP0:%.*]], align 4
; CHECK-NEXT: ret i32 [[TMP2]]
@@ -232,7 +232,7 @@ declare void @llvm.memset(ptr %dest, i8 %val, i32 %len, i1 %isvolatile)
; negative, checking volatile intrinsics.
define i32 @memcpy_volatile(ptr %ptr1, ptr %ptr2) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; CHECK-LABEL: @memcpy_volatile(
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr [[PTR1:%.*]], ptr [[PTR2:%.*]], i32 8, i1 true)
; CHECK-NEXT: ret i32 4
diff --git a/llvm/test/Transforms/FunctionAttrs/read-write-scc.ll b/llvm/test/Transforms/FunctionAttrs/read-write-scc.ll
index 36baf6be754c95..be61990fd6278b 100644
--- a/llvm/test/Transforms/FunctionAttrs/read-write-scc.ll
+++ b/llvm/test/Transforms/FunctionAttrs/read-write-scc.ll
@@ -4,7 +4,7 @@
@i = global i32 0
define void @foo() {
-; CHECK: Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none, target_mem: none)
+; CHECK: Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none)
; CHECK-LABEL: define {{[^@]+}}@foo
; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: store i32 1, ptr @i, align 4
@@ -17,7 +17,7 @@ define void @foo() {
}
define void @bar() {
-; CHECK: Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none, target_mem: none)
+; CHECK: Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none)
; CHECK-LABEL: define {{[^@]+}}@bar
; CHECK-SAME: () #[[ATTR0]] {
; CHECK-NEXT: [[I:%.*]] = load i32, ptr @i, align 4
diff --git a/llvm/test/Transforms/FunctionAttrs/readattrs.ll b/llvm/test/Transforms/FunctionAttrs/readattrs.ll
index fbd7b7436ce6d1..33a74fe790ed31 100644
--- a/llvm/test/Transforms/FunctionAttrs/readattrs.ll
+++ b/llvm/test/Transforms/FunctionAttrs/readattrs.ll
@@ -33,7 +33,7 @@ define void @test1_2(ptr %x1_2, ptr %y1_2, ptr %z1_2) {
; TODO: Missing with attributor-light: argmem: none, inaccessiblemem: none
define ptr @test2(ptr %p) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define {{[^@]+}}@test2
; FNATTRS-SAME: (ptr nofree readnone returned captures(ret: address, provenance) [[P:%.*]]) #[[ATTR0:[0-9]+]] {
; FNATTRS-NEXT: store i32 0, ptr @x, align 4
@@ -346,7 +346,7 @@ define <4 x i32> @test12_2(<4 x ptr> %ptrs) {
}
define i32 @volatile_load(ptr %p) {
-; FNATTRS: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; FNATTRS: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; FNATTRS-LABEL: define {{[^@]+}}@volatile_load
; FNATTRS-SAME: (ptr nofree captures(address) [[P:%.*]]) #[[ATTR11:[0-9]+]] {
; FNATTRS-NEXT: [[LOAD:%.*]] = load volatile i32, ptr [[P]], align 4
diff --git a/llvm/test/Transforms/FunctionAttrs/writeonly.ll b/llvm/test/Transforms/FunctionAttrs/writeonly.ll
index 9d6fa0ef0efe8a..8bc642e8083eb3 100644
--- a/llvm/test/Transforms/FunctionAttrs/writeonly.ll
+++ b/llvm/test/Transforms/FunctionAttrs/writeonly.ll
@@ -38,7 +38,7 @@ nouses-argworn-funro_entry:
@d-ccc = internal global %_type_of_d-ccc <{ ptr null, i8 1, i8 13, i8 0, i8 -127 }>, align 8
define void @nouses-argworn-funwo(ptr writeonly %.aaa) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none)
; FNATTRS-LABEL: define {{[^@]+}}@nouses-argworn-funwo
; FNATTRS-SAME: (ptr nofree readnone captures(none) [[DOTAAA:%.*]]) #[[ATTR2:[0-9]+]] {
; FNATTRS-NEXT: nouses-argworn-funwo_entry:
@@ -76,7 +76,7 @@ define void @test_store(ptr %p) {
@G = external global ptr
define i8 @test_store_capture(ptr %p) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none, target_mem: none)
+; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: read, inaccessiblemem: none)
; FNATTRS-LABEL: define {{[^@]+}}@test_store_capture
; FNATTRS-SAME: (ptr [[P:%.*]]) #[[ATTR4:[0-9]+]] {
; FNATTRS-NEXT: store ptr [[P]], ptr @G, align 8
@@ -139,7 +139,7 @@ define void @test_readwrite(ptr %p) {
}
define void @test_volatile(ptr %p) {
-; FNATTRS: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, inaccessiblemem: readwrite)
+; FNATTRS: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite, controlmem: readwrite)
; FNATTRS-LABEL: define {{[^@]+}}@test_volatile
; FNATTRS-SAME: (ptr nofree captures(address) [[P:%.*]]) #[[ATTR6:[0-9]+]] {
; FNATTRS-NEXT: store volatile i8 0, ptr [[P]], align 1
diff --git a/llvm/test/Transforms/GlobalOpt/disable-globals-aa.ll b/llvm/test/Transforms/GlobalOpt/disable-globals-aa.ll
index df620416154d72..f64204cd43700f 100644
--- a/llvm/test/Transforms/GlobalOpt/disable-globals-aa.ll
+++ b/llvm/test/Transforms/GlobalOpt/disable-globals-aa.ll
@@ -44,11 +44,11 @@ define i8 @dummy() !prof !0 {
!0 = !{!"function_entry_count", i32 10}
;.
-; WITHGLOBALSAA: attributes #[[ATTR0:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none, target_mem: none) }
-; WITHGLOBALSAA: attributes #[[ATTR1:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none, target_mem: none) }
+; WITHGLOBALSAA: attributes #[[ATTR0:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) }
+; WITHGLOBALSAA: attributes #[[ATTR1:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) }
;.
-; NOGLOBALSAA: attributes #[[ATTR0:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none) }
-; NOGLOBALSAA: attributes #[[ATTR1:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none, target_mem: none) }
+; NOGLOBALSAA: attributes #[[ATTR0:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) }
+; NOGLOBALSAA: attributes #[[ATTR1:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) }
;.
; WITHGLOBALSAA: [[META0:![0-9]+]] = !{!"function_entry_count", i32 10}
; WITHGLOBALSAA: [[PROF1]] = !{!"unknown", !"globalopt"}
diff --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
index 86c1ae3ed67fed..1c189dd23e4ef9 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -1248,20 +1248,20 @@ declare void @memset_pattern16(ptr, ptr, i64)
; CHECK-DAG: attributes [[ERRNOMEMONLY_NOFREE_NOSYNC_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nosync nounwind willreturn memory(errnomem: write) }
; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOSYNC_NOUNWIND_WILLRETURN_WRITEONLY]] = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: write) }
; CHECK-DAG: attributes [[NOFREE_NOUNWIND]] = { nofree nounwind }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE1_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized,aligned") allocsize(1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCZEROED_ALLOCSIZE01_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE1_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized,aligned") allocsize(1) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="malloc" }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCZEROED_ALLOCSIZE01_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="malloc" }
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(read) }
; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOSYNC_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY]] = { nofree nounwind memory(read) }
; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_FREE_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="malloc" }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="malloc" }
; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOSYNC_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; CHECK-DAG: attributes [[NOFREE]] = { nofree }
; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOSYNC_NOUNWIND]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMORERRNOMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE1_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMORERRNOMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE12_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("realloc") allocsize(1,2) memory(argmem: readwrite, inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMORERRNOMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE1_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, errnomem: write, inaccessiblemem: readwrite) "alloc-family"="malloc" }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMORERRNOMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_REALLOC_ALLOCSIZE12_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("realloc") allocsize(1,2) memory(argmem: readwrite, errnomem: write, inaccessiblemem: readwrite) "alloc-family"="malloc" }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, errnomem: write, inaccessiblemem: readwrite) "alloc-family"="malloc" }
; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
; CHECK-DAG: attributes [[NOFREE_COLD_NORETURN_NOUNWIND]] = { cold nofree noreturn nounwind }
; CHECK-DAG: attributes [[NOFREE_COLD_NORETURN]] = { cold nofree noreturn }
@@ -1269,7 +1269,7 @@ declare void @memset_pattern16(ptr, ptr, i64)
; CHECK-NVPTX-DAG: attributes [[NOFREE_NOUNWIND_READNONE]] = { nofree nosync nounwind memory(none) }
-; CHECK-AIX-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCSIZE0_FAMILY_VEC_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="vec_malloc" }
+; CHECK-AIX-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCSIZE0_FAMILY_VEC_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="vec_malloc" }
; CHECK-AIX-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_FAMILY_VEC_MALLOC]] = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="vec_malloc" }
-; CHECK-AIX-DAG: attributes [[INACCESSIBLEMEMORARGMEMORERRNOMEMONLY_NOUNWIND_WILLRETURN_ALLOCSIZE_FAMILY_VEC_MALLOC]] = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite, errnomem: write) "alloc-family"="vec_malloc" }
-; CHECK-AIX-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCSIZE01_FAMILY_VEC_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="vec_malloc" }
+; CHECK-AIX-DAG: attributes [[INACCESSIBLEMEMORARGMEMORERRNOMEMONLY_NOUNWIND_WILLRETURN_ALLOCSIZE_FAMILY_VEC_MALLOC]] = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, errnomem: write, inaccessiblemem: readwrite) "alloc-family"="vec_malloc" }
+; CHECK-AIX-DAG: attributes [[INACCESSIBLEMEMORERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCSIZE01_FAMILY_VEC_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="vec_malloc" }
diff --git a/llvm/test/Transforms/InferFunctionAttrs/enable-builtin.ll b/llvm/test/Transforms/InferFunctionAttrs/enable-builtin.ll
index 459a2eab6a13fd..4c1f21625aa3a2 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/enable-builtin.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/enable-builtin.ll
@@ -7,7 +7,7 @@
; NOBUILTIN: declare ptr @malloc(i64)
; WITHBUILTIN: declare noalias noundef ptr @malloc(i64 noundef) #0
-; WITHBUILTIN: attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; WITHBUILTIN: attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, inaccessiblemem: readwrite) "alloc-family"="malloc" }
declare ptr @malloc(i64)
diff --git a/llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll b/llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll
index 0a0fdc0d4d42af..c8568272d320fb 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll
@@ -52,5 +52,5 @@ attributes #1 = { nounwind readnone speculatable }
!28 = !DILocation(line: 9, column: 18, scope: !2)
!29 = !DILocation(line: 10, column: 1, scope: !2)
-; CHECK: attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: none, target_mem: none) }
+; CHECK: attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: none) }
; CHECK-NOT: foo.coefficient1
diff --git a/llvm/test/Transforms/LowerTypeTests/cfi-nounwind-direct-call.ll b/llvm/test/Transforms/LowerTypeTests/cfi-nounwind-direct-call.ll
index c626a5f4d59c9c..2f50f71ecc2a00 100644
--- a/llvm/test/Transforms/LowerTypeTests/cfi-nounwind-direct-call.ll
+++ b/llvm/test/Transforms/LowerTypeTests/cfi-nounwind-direct-call.ll
@@ -117,7 +117,7 @@ attributes #6 = { noreturn nounwind }
; CHECK-NEXT: ret i32 [[DOT]]
;
;
-; CHECK: Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
+; CHECK: Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(write, argmem: none, inaccessiblemem: none)
; CHECK-LABEL: define dso_local noundef range(i32 0, 2) i32 @_Z10call_catchi
; CHECK-SAME: (i32 noundef [[NUM:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] !type [[META4]] !type [[META5]] !type [[META6]] {
; CHECK-NEXT: entry:
diff --git a/llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll b/llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll
index 4e7597e9302073..14c504718e75e3 100644
--- a/llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll
+++ b/llvm/test/Transforms/SCCP/ipscp-drop-argmemonly.ll
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --tool /ext/nvme/arbeit/space4/build/bin/opt --check-attributes --check-globals
; RUN: opt -passes=ipsccp -S %s | FileCheck %s
; Test cases to ensure argmemonly/inaccessiblemem_or_argmemonly attributes are
@@ -10,11 +10,9 @@
; Here the pointer argument %arg will be replaced by a constant. We need to
; drop argmemonly.
-;.
; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0
-;.
define internal void @ptrarg.1(ptr %arg, i32 %val) argmemonly nounwind {
-; CHECK: Function Attrs: nounwind memory(readwrite, inaccessiblemem: none, target_mem: none)
+; CHECK: Function Attrs: nounwind memory(readwrite, inaccessiblemem: none)
; CHECK-LABEL: @ptrarg.1(
; CHECK-NEXT: store i32 10, ptr @g, align 4
; CHECK-NEXT: ret void
@@ -62,7 +60,7 @@ define void @caller.2(ptr %ptr) {
; Here the pointer argument %arg will be replaced by a constant. We need to
; drop inaccessiblemem_or_argmemonly.
define internal void @ptrarg.3(ptr %arg, i32 %val) inaccessiblemem_or_argmemonly nounwind {
-; CHECK: Function Attrs: nounwind memory(readwrite, target_mem: none)
+; CHECK: Function Attrs: nounwind memory(readwrite)
; CHECK-LABEL: @ptrarg.3(
; CHECK-NEXT: store i32 10, ptr @g, align 4
; CHECK-NEXT: ret void
@@ -110,7 +108,7 @@ define void @caller.4(ptr %ptr) {
; Here the pointer argument %arg will be replaced by a constant. We need to
; drop inaccessiblemem_or_argmemonly.
define internal void @ptrarg.5(ptr %arg, i32 %val) argmemonly inaccessiblemem_or_argmemonly nounwind {
-; CHECK: Function Attrs: nounwind memory(readwrite, inaccessiblemem: none, target_mem: none)
+; CHECK: Function Attrs: nounwind memory(readwrite, inaccessiblemem: none)
; CHECK-LABEL: @ptrarg.5(
; CHECK-NEXT: store i32 10, ptr @g, align 4
; CHECK-NEXT: ret void
@@ -162,10 +160,8 @@ define i32 @caller.6.cs.attributes(i32 %n) {
ret i32 %g.val
}
-;.
-; CHECK: attributes #[[ATTR0]] = { nounwind memory(readwrite, inaccessiblemem: none, target_mem: none) }
+; CHECK: attributes #[[ATTR0]] = { nounwind memory(readwrite, inaccessiblemem: none) }
; CHECK: attributes #[[ATTR1:[0-9]+]] = { nounwind memory(argmem: readwrite) }
-; CHECK: attributes #[[ATTR2]] = { nounwind memory(readwrite, target_mem: none) }
+; CHECK: attributes #[[ATTR2]] = { nounwind memory(readwrite) }
; CHECK: attributes #[[ATTR3:[0-9]+]] = { nounwind memory(argmem: readwrite, inaccessiblemem: readwrite) }
; CHECK: attributes #[[ATTR4]] = { nounwind }
-;.
diff --git a/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/basic.ll b/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/basic.ll
index ee8ffbda6ac4e7..04633a3a6fd3dd 100644
--- a/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/basic.ll
+++ b/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/basic.ll
@@ -84,8 +84,8 @@ define float @sinf(float %x) {
; CHECK: attributes [[ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write) }
; CHECK: attributes [[CHK_ARGMEM_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
; CHECK: attributes [[CHK_ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: write) }
-; CHECK: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; CHECK: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; CHECK: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; CHECK: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
+; CHECK: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, controlmem: readwrite) "alloc-family"="malloc" }
+; CHECK: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
; CHECK: attributes [[ARGMEM_READ_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; CHECK: attributes [[ARGMEM_ERRNO_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write, errnomem: write) }
diff --git a/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/bsd.ll b/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/bsd.ll
index 160f7c8c5dc2fd..a889a8b87b44b2 100644
--- a/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/bsd.ll
+++ b/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/bsd.ll
@@ -559,9 +559,9 @@
; LINUX-NEXT: attributes [[CHK_ARGMEM_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
; LINUX-NEXT: attributes [[CHK_ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: write) }
; LINUX-NEXT: attributes [[NORETURN_ATTRS]] = { nofree noreturn nounwind }
-; LINUX-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; LINUX-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; LINUX-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; LINUX-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
+; LINUX-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, controlmem: readwrite) "alloc-family"="malloc" }
+; LINUX-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
; LINUX-NEXT: attributes [[ARGMEM_READ_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; LINUX-NEXT: attributes [[ARGMEM_ERRNO_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write, errnomem: write) }
@@ -1065,9 +1065,9 @@
; FREEBSD-NEXT: attributes [[CHK_ARGMEM_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
; FREEBSD-NEXT: attributes [[CHK_ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: write) }
; FREEBSD-NEXT: attributes [[NORETURN_ATTRS]] = { nofree noreturn nounwind }
-; FREEBSD-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; FREEBSD-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; FREEBSD-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; FREEBSD-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
+; FREEBSD-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, controlmem: readwrite) "alloc-family"="malloc" }
+; FREEBSD-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
; FREEBSD-NEXT: attributes [[ARGMEM_READ_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; FREEBSD-NEXT: attributes [[ARGMEM_ERRNO_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write, errnomem: write) }
@@ -1571,8 +1571,8 @@
; OPENBSD-NEXT: attributes [[CHK_ARGMEM_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
; OPENBSD-NEXT: attributes [[CHK_ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: write) }
; OPENBSD-NEXT: attributes [[NORETURN_ATTRS]] = { nofree noreturn nounwind }
-; OPENBSD-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; OPENBSD-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; OPENBSD-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; OPENBSD-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
+; OPENBSD-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, controlmem: readwrite) "alloc-family"="malloc" }
+; OPENBSD-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
; OPENBSD-NEXT: attributes [[ARGMEM_READ_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; OPENBSD-NEXT: attributes [[ARGMEM_ERRNO_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write, errnomem: write) }
diff --git a/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/windows.ll b/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/windows.ll
index 0fcd9d38fb7fa6..5828e7da6f8bcf 100644
--- a/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/windows.ll
+++ b/llvm/test/Transforms/Util/DeclareRuntimeLibcalls/windows.ll
@@ -446,9 +446,9 @@
; MSVC-NEXT: attributes [[CHK_ARGMEM_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
; MSVC-NEXT: attributes [[CHK_ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: write) }
; MSVC-NEXT: attributes [[NOUNWIND_ATTRS]] = { nounwind }
-; MSVC-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; MSVC-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; MSVC-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; MSVC-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
+; MSVC-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, controlmem: readwrite) "alloc-family"="malloc" }
+; MSVC-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
; MSVC-NEXT: attributes [[ARGMEM_READ_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; MSVC-NEXT: attributes [[ARGMEM_ERRNO_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write, errnomem: write) }
@@ -1003,9 +1003,9 @@
; MINGW-NEXT: attributes [[CHK_ARGMEM_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
; MINGW-NEXT: attributes [[CHK_ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: write) }
; MINGW-NEXT: attributes [[NORETURN_ATTRS]] = { nofree noreturn nounwind }
-; MINGW-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; MINGW-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; MINGW-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; MINGW-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
+; MINGW-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, controlmem: readwrite) "alloc-family"="malloc" }
+; MINGW-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
; MINGW-NEXT: attributes [[ARGMEM_READ_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; MINGW-NEXT: attributes [[ARGMEM_ERRNO_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write, errnomem: write) }
@@ -1510,9 +1510,9 @@
; CYGWIN-NEXT: attributes [[CHK_ARGMEM_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
; CYGWIN-NEXT: attributes [[CHK_ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: write) }
; CYGWIN-NEXT: attributes [[NORETURN_ATTRS]] = { nofree noreturn nounwind }
-; CYGWIN-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; CYGWIN-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; CYGWIN-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; CYGWIN-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
+; CYGWIN-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, controlmem: readwrite) "alloc-family"="malloc" }
+; CYGWIN-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
; CYGWIN-NEXT: attributes [[ARGMEM_READ_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; CYGWIN-NEXT: attributes [[ARGMEM_ERRNO_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write, errnomem: write) }
@@ -1960,8 +1960,8 @@
; UEFI-NEXT: attributes [[CHK_ARGMEM_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: readwrite) }
; UEFI-NEXT: attributes [[CHK_ARGMEM_WRITE_ATTRS]] = { nocallback nofree nosync nounwind memory(argmem: write) }
; UEFI-NEXT: attributes [[NORETURN_ATTRS]] = { nofree noreturn nounwind }
-; UEFI-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
-; UEFI-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
-; UEFI-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite, errnomem: write) "alloc-family"="malloc" }
+; UEFI-NEXT: attributes [[CALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
+; UEFI-NEXT: attributes [[FREE_ATTRS]] = { nounwind willreturn allockind("free") memory(argmem: readwrite, controlmem: readwrite) "alloc-family"="malloc" }
+; UEFI-NEXT: attributes [[MALLOC_ATTRS]] = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(errnomem: write, controlmem: readwrite) "alloc-family"="malloc" }
; UEFI-NEXT: attributes [[ARGMEM_READ_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
; UEFI-NEXT: attributes [[ARGMEM_ERRNO_WRITE_ATTRS]] = { nocallback nofree nosync nounwind willreturn memory(argmem: write, errnomem: write) }
diff --git a/llvm/unittests/Support/ModRefTest.cpp b/llvm/unittests/Support/ModRefTest.cpp
index 128501bf2d9572..20fbae8c5213e9 100644
--- a/llvm/unittests/Support/ModRefTest.cpp
+++ b/llvm/unittests/Support/ModRefTest.cpp
@@ -1,27 +1,28 @@
-//===- llvm/unittest/Support/ModRefTest.cpp - ModRef tests ----------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/ModRef.h"
-#include "llvm/Support/raw_ostream.h"
-#include "gtest/gtest.h"
-#include <string>
-
-using namespace llvm;
-
-namespace {
-
-// Verify that printing a MemoryEffects does not end with a ,.
-TEST(ModRefTest, PrintMemoryEffects) {
- std::string S;
- raw_string_ostream OS(S);
- OS << MemoryEffects::none();
- EXPECT_EQ(S, "ArgMem: NoModRef, InaccessibleMem: NoModRef, ErrnoMem: "
- "NoModRef, Other: NoModRef, TargetMem0: NoModRef, TargetMem1: NoModRef");
-}
-
-} // namespace
+//===- llvm/unittest/Support/ModRefTest.cpp - ModRef tests ----------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/ModRef.h"
+#include "llvm/Support/raw_ostream.h"
+#include "gtest/gtest.h"
+#include <string>
+
+using namespace llvm;
+
+namespace {
+
+// Verify that printing a MemoryEffects does not end with a ,.
+TEST(ModRefTest, PrintMemoryEffects) {
+ std::string S;
+ raw_string_ostream OS(S);
+ OS << MemoryEffects::none();
+ EXPECT_EQ(S,
+ "ArgMem: NoModRef, ErrnoMem: NoModRef, Other: NoModRef, "
+ "ControlMem: NoModRef, TargetMem0: NoModRef, TargetMem1: NoModRef");
+}
+
+} // namespace
diff --git a/llvm/utils/TableGen/Basic/CodeGenIntrinsics.cpp b/llvm/utils/TableGen/Basic/CodeGenIntrinsics.cpp
index f50a9636680209..3571fcb19f3677 100644
--- a/llvm/utils/TableGen/Basic/CodeGenIntrinsics.cpp
+++ b/llvm/utils/TableGen/Basic/CodeGenIntrinsics.cpp
@@ -502,6 +502,8 @@ void CodeGenIntrinsic::setProperty(const Record *R) {
ME &= MemoryEffects::argMemOnly();
else if (R->getName() == "IntrInaccessibleMemOnly")
ME &= MemoryEffects::inaccessibleMemOnly();
+ else if (R->getName() == "IntrControlMemOnly")
+ ME &= MemoryEffects::controlMemOnly();
else if (R->isSubClassOf("IntrRead")) {
MemoryEffects ReadMask = MemoryEffects::writeOnly();
for (const Record *RLoc : R->getValueAsListOfDefs("MemLoc"))
@@ -516,6 +518,8 @@ void CodeGenIntrinsic::setProperty(const Record *R) {
ME &= WriteMask;
} else if (R->getName() == "IntrInaccessibleMemOrArgMemOnly")
ME &= MemoryEffects::inaccessibleOrArgMemOnly();
+ else if (R->getName() == "IntrControlMemOrArgMemOnly")
+ ME &= MemoryEffects::controlOrArgMemOnly();
else if (R->getName() == "Commutative")
isCommutative = true;
else if (R->getName() == "Throws")
@@ -612,13 +616,12 @@ void CodeGenIntrinsic::setProperty(const Record *R) {
llvm::IRMemLocation
CodeGenIntrinsic::getValueAsIRMemLocation(const Record *R) const {
StringRef Name = R->getName();
- IRMemLocation Loc =
- StringSwitch<IRMemLocation>(Name)
- .Case("ArgMem", IRMemLocation::ArgMem)
- .Case("TargetMem0", IRMemLocation::TargetMem0)
- .Case("TargetMem1", IRMemLocation::TargetMem1)
- .Case("InaccessibleMem", IRMemLocation::InaccessibleMem)
- .Default(IRMemLocation::Other); // fallback enum
+ IRMemLocation Loc = StringSwitch<IRMemLocation>(Name)
+ .Case("ArgMem", IRMemLocation::ArgMem)
+ .Case("TargetMem0", IRMemLocation::TargetMem0)
+ .Case("TargetMem1", IRMemLocation::TargetMem1)
+ .Case("ControlMem", IRMemLocation::ControlMem)
+ .Default(IRMemLocation::Other); // fallback enum
if (Loc == IRMemLocation::Other)
PrintFatalError(R->getLoc(), "unknown IRMemLocation: " + Name);
diff --git a/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp b/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
index 045dad66dda36c..b25dafb5475be7 100644
--- a/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
@@ -634,7 +634,7 @@ static std::optional<uint32_t> getMemoryEffects(const Record *R) {
const Record *Memory = R->getValueAsDef("Memory");
static constexpr std::pair<IRMemLocation, StringRef> Locations[] = {
{IRMemLocation::ArgMem, "ArgMem"},
- {IRMemLocation::InaccessibleMem, "InaccessibleMem"},
+ {IRMemLocation::ControlMem, "ControlMem"},
{IRMemLocation::ErrnoMem, "ErrnoMem"},
{IRMemLocation::Other, "Other"},
{IRMemLocation::TargetMem0, "TargetMem0"},
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
index 59efb1017f5d32..1fa2ac7d75be47 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
@@ -1088,7 +1088,7 @@ def LLVM_DIStringTypeAttr : LLVM_Attr<"DIStringType", "di_string_type",
def LLVM_MemoryEffectsAttr : LLVM_Attr<"MemoryEffects", "memory_effects"> {
let parameters = (ins "ModRefInfo":$other, "ModRefInfo":$argMem,
- "ModRefInfo":$inaccessibleMem, "ModRefInfo":$errnoMem,
+ "ModRefInfo":$controlMem, "ModRefInfo":$errnoMem,
"ModRefInfo":$targetMem0, "ModRefInfo":$targetMem1);
let extraClassDeclaration = [{
bool isReadWrite();
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
index 91c6dfc65d94ae..7a5f3f4d682cbd 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
@@ -312,7 +312,7 @@ MemoryEffectsAttr MemoryEffectsAttr::get(MLIRContext *context,
bool MemoryEffectsAttr::isReadWrite() {
if (this->getArgMem() != ModRefInfo::ModRef)
return false;
- if (this->getInaccessibleMem() != ModRefInfo::ModRef)
+ if (this->getControlMem() != ModRefInfo::ModRef)
return false;
if (this->getOther() != ModRefInfo::ModRef)
return false;
diff --git a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
index 1ed860f2aba167..ad0f1e8b519c0b 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
@@ -604,8 +604,8 @@ convertOperationImpl(Operation &opInst, llvm::IRBuilderBase &builder,
llvm::MemoryEffects(llvm::MemoryEffects::Location::ArgMem,
convertModRefInfoToLLVM(memAttr.getArgMem())) |
llvm::MemoryEffects(
- llvm::MemoryEffects::Location::InaccessibleMem,
- convertModRefInfoToLLVM(memAttr.getInaccessibleMem())) |
+ llvm::MemoryEffects::Location::ControlMem,
+ convertModRefInfoToLLVM(memAttr.getControlMem())) |
llvm::MemoryEffects(llvm::MemoryEffects::Location::Other,
convertModRefInfoToLLVM(memAttr.getOther())) |
llvm::MemoryEffects(llvm::MemoryEffects::Location::ErrnoMem,
diff --git a/mlir/lib/Target/LLVMIR/ModuleImport.cpp b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
index f4475ba1282742..f625eaac770ac0 100644
--- a/mlir/lib/Target/LLVMIR/ModuleImport.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
@@ -3002,8 +3002,8 @@ static void processMemoryEffects(llvm::Function *func, LLVMFuncOp funcOp) {
memEffects.getModRef(llvm::MemoryEffects::Location::Other));
auto argMem = convertModRefInfoFromLLVM(
memEffects.getModRef(llvm::MemoryEffects::Location::ArgMem));
- auto inaccessibleMem = convertModRefInfoFromLLVM(
- memEffects.getModRef(llvm::MemoryEffects::Location::InaccessibleMem));
+ auto controlMem = convertModRefInfoFromLLVM(
+ memEffects.getModRef(llvm::MemoryEffects::Location::ControlMem));
auto errnoMem = convertModRefInfoFromLLVM(
memEffects.getModRef(llvm::MemoryEffects::Location::ErrnoMem));
auto targetMem0 = convertModRefInfoFromLLVM(
@@ -3011,8 +3011,8 @@ static void processMemoryEffects(llvm::Function *func, LLVMFuncOp funcOp) {
auto targetMem1 = convertModRefInfoFromLLVM(
memEffects.getModRef(llvm::MemoryEffects::Location::TargetMem1));
auto memAttr =
- MemoryEffectsAttr::get(funcOp.getContext(), othermem, argMem,
- inaccessibleMem, errnoMem, targetMem0, targetMem1);
+ MemoryEffectsAttr::get(funcOp.getContext(), othermem, argMem, controlMem,
+ errnoMem, targetMem0, targetMem1);
// Only set the attr when it does not match the default value.
if (memAttr.isReadWrite())
return;
@@ -3466,8 +3466,8 @@ LogicalResult ModuleImport::convertCallAttributes(llvm::CallInst *inst,
memEffects.getModRef(llvm::MemoryEffects::Location::Other));
ModRefInfo argMem = convertModRefInfoFromLLVM(
memEffects.getModRef(llvm::MemoryEffects::Location::ArgMem));
- ModRefInfo inaccessibleMem = convertModRefInfoFromLLVM(
- memEffects.getModRef(llvm::MemoryEffects::Location::InaccessibleMem));
+ ModRefInfo controlMem = convertModRefInfoFromLLVM(
+ memEffects.getModRef(llvm::MemoryEffects::Location::ControlMem));
ModRefInfo errnoMem = convertModRefInfoFromLLVM(
memEffects.getModRef(llvm::MemoryEffects::Location::ErrnoMem));
ModRefInfo targetMem0 = convertModRefInfoFromLLVM(
@@ -3475,7 +3475,7 @@ LogicalResult ModuleImport::convertCallAttributes(llvm::CallInst *inst,
ModRefInfo targetMem1 = convertModRefInfoFromLLVM(
memEffects.getModRef(llvm::MemoryEffects::Location::TargetMem1));
auto memAttr =
- MemoryEffectsAttr::get(op.getContext(), othermem, argMem, inaccessibleMem,
+ MemoryEffectsAttr::get(op.getContext(), othermem, argMem, controlMem,
errnoMem, targetMem0, targetMem1);
// Only set the attribute when it does not match the default value.
if (!memAttr.isReadWrite())
diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index 4a9e48e7e9fb8e..8dd1dfbfd60ba8 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -1820,9 +1820,9 @@ static void convertFunctionMemoryAttributes(LLVMFuncOp func,
llvm::MemoryEffects newMemEffects =
llvm::MemoryEffects(llvm::MemoryEffects::Location::ArgMem,
convertModRefInfoToLLVM(memEffects.getArgMem()));
- newMemEffects |= llvm::MemoryEffects(
- llvm::MemoryEffects::Location::InaccessibleMem,
- convertModRefInfoToLLVM(memEffects.getInaccessibleMem()));
+ newMemEffects |=
+ llvm::MemoryEffects(llvm::MemoryEffects::Location::ControlMem,
+ convertModRefInfoToLLVM(memEffects.getControlMem()));
newMemEffects |=
llvm::MemoryEffects(llvm::MemoryEffects::Location::Other,
convertModRefInfoToLLVM(memEffects.getOther()));
More information about the cfe-commits
mailing list