llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-llvm-transforms Author: Nikita Popov (nikic) <details> <summary>Changes</summary> The fact that a volatile access was performed on a certain address is an observable effect in the abstract machine, so volatile operations capture the address of the accessed pointer. However, they do not capture the provenance. This matches what we document in LangRef. While I'm pretty sure that this models the semantics correctly, I'm slightly concerned that we might be using the provenance capture here to paper over some other issue, though nothing specific comes to mind (and the test changes don't show anything problematic). --- Patch is 31.37 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/201316.diff 15 Files Affected: - (modified) clang/test/CodeGen/ms-intrinsics-other.c (+1-1) - (modified) llvm/lib/Analysis/CaptureTracking.cpp (+18-13) - (modified) llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.ll (+1-1) - (modified) llvm/test/Transforms/Attributor/nofpclass.ll (+28-61) - (modified) llvm/test/Transforms/Attributor/nonnull.ll (+1-1) - (modified) llvm/test/Transforms/Attributor/nosync.ll (+2-2) - (modified) llvm/test/Transforms/FunctionAttrs/atomic.ll (+2-2) - (modified) llvm/test/Transforms/FunctionAttrs/initializes.ll (+4-4) - (modified) llvm/test/Transforms/FunctionAttrs/nocapture.ll (+1-1) - (modified) llvm/test/Transforms/FunctionAttrs/nofpclass.ll (+13-13) - (modified) llvm/test/Transforms/FunctionAttrs/nonnull.ll (+11-5) - (modified) llvm/test/Transforms/FunctionAttrs/readattrs.ll (+1-1) - (modified) llvm/test/Transforms/FunctionAttrs/writeonly.ll (+1-1) - (modified) llvm/test/Transforms/PhaseOrdering/AArch64/constraint-elimination-placement.ll (+1-1) - (modified) llvm/test/Transforms/PhaseOrdering/branch-dom-cond.ll (+1-1) ``````````diff diff --git a/clang/test/CodeGen/ms-intrinsics-other.c b/clang/test/CodeGen/ms-intrinsics-other.c index 013277cbf6a2d..9f183aee85824 100644 --- a/clang/test/CodeGen/ms-intrinsics-other.c +++ b/clang/test/CodeGen/ms-intrinsics-other.c @@ -159,7 +159,7 @@ LONG test_InterlockedAnd(LONG volatile *value, LONG mask) { LONG test_InterlockedCompareExchange(LONG volatile *Destination, LONG Exchange, LONG Comperand) { return _InterlockedCompareExchange(Destination, Exchange, Comperand); } -// CHECK: define{{.*}}i32 @test_InterlockedCompareExchange(ptr{{[a-z_ ]*}}%Destination, i32{{[a-z_ ]*}}%Exchange, i32{{[a-z_ ]*}}%Comperand){{.*}}{ +// CHECK: define{{.*}}i32 @test_InterlockedCompareExchange(ptr{{[^%]*}}%Destination, i32{{[a-z_ ]*}}%Exchange, i32{{[a-z_ ]*}}%Comperand){{.*}}{ // CHECK: [[TMP:%[0-9]+]] = cmpxchg volatile ptr %Destination, i32 %Comperand, i32 %Exchange seq_cst seq_cst, align 4 // CHECK: [[RESULT:%[0-9]+]] = extractvalue { i32, i1 } [[TMP]], 0 // CHECK: ret i32 [[RESULT]] diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp index b5ee2430796cf..2af6dbe44dde0 100644 --- a/llvm/lib/Analysis/CaptureTracking.cpp +++ b/llvm/lib/Analysis/CaptureTracking.cpp @@ -284,12 +284,6 @@ UseCaptureInfo llvm::DetermineUseCaptureKind(const Use &U, const Value *Base) { Call, /*MustPreserveOffset=*/false)) return UseCaptureInfo::passthrough(); - // Volatile operations effectively capture the memory location that they - // load and store to. - if (auto *MI = dyn_cast<MemIntrinsic>(Call)) - if (MI->isVolatile()) - return CaptureComponents::All; - // Calling a function pointer does not in itself cause the pointer to // be captured. This is a subtle point considering that (for example) // the callee might return its own address. It is analogous to saying @@ -299,6 +293,13 @@ UseCaptureInfo llvm::DetermineUseCaptureKind(const Use &U, const Value *Base) { if (Call->isCallee(&U)) return CaptureComponents::None; + // Volatile operations make the address observable. + // TODO: This should probably get sunk into CallBase::getCaptureInfo(). + CaptureComponents VolatileCC = CaptureComponents::None; + if (auto *MI = dyn_cast<MemIntrinsic>(Call)) + if (MI->isVolatile()) + VolatileCC |= CaptureComponents::Address; + assert(Call->isDataOperand(&U) && "Non-callee must be data operand"); CaptureInfo CI = Call->getCaptureInfo(Call->getDataOperandNo(&U)); @@ -308,13 +309,13 @@ UseCaptureInfo llvm::DetermineUseCaptureKind(const Use &U, const Value *Base) { if (Call->onlyReadsMemory() && Call->getType()->isVoidTy()) Mask = CaptureComponents::Address; - return UseCaptureInfo(CI.getOtherComponents() & Mask, + return UseCaptureInfo((CI.getOtherComponents() & Mask) | VolatileCC, CI.getRetComponents()); } case Instruction::Load: // Volatile loads make the address observable. if (cast<LoadInst>(I)->isVolatile()) - return CaptureComponents::All; + return CaptureComponents::Address; return CaptureComponents::None; case Instruction::VAArg: // "va-arg" from a pointer does not cause it to be captured. @@ -327,17 +328,19 @@ UseCaptureInfo llvm::DetermineUseCaptureKind(const Use &U, const Value *Base) { // Volatile stores make the address observable. if (cast<StoreInst>(I)->isVolatile()) - return CaptureComponents::All; + return CaptureComponents::Address; return CaptureComponents::None; case Instruction::AtomicRMW: { // atomicrmw conceptually includes both a load and store from // the same location. // As with a store, the location being accessed is not captured, // but the value being stored is. - // Volatile stores make the address observable. auto *ARMWI = cast<AtomicRMWInst>(I); - if (U.getOperandNo() == 1 || ARMWI->isVolatile()) + if (U.getOperandNo() == 1) return CaptureComponents::All; + // Volatile stores make the address observable. + if (ARMWI->isVolatile()) + return CaptureComponents::Address; return CaptureComponents::None; } case Instruction::AtomicCmpXchg: { @@ -345,10 +348,12 @@ UseCaptureInfo llvm::DetermineUseCaptureKind(const Use &U, const Value *Base) { // the same location. // As with a store, the location being accessed is not captured, // but the value being stored is. - // Volatile stores make the address observable. auto *ACXI = cast<AtomicCmpXchgInst>(I); - if (U.getOperandNo() == 1 || U.getOperandNo() == 2 || ACXI->isVolatile()) + if (U.getOperandNo() == 1 || U.getOperandNo() == 2) return CaptureComponents::All; + // Volatile stores make the address observable. + if (ACXI->isVolatile()) + return CaptureComponents::Address; return CaptureComponents::None; } case Instruction::GetElementPtr: diff --git a/llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.ll b/llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.ll index 5f14afc017060..0b8ea0a4dd131 100644 --- a/llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.ll +++ b/llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.ll @@ -910,7 +910,7 @@ entry: define void @sincos_f32_repeated_uses(float %x, ptr addrspace(1) %sin_out, ptr addrspace(1) %cos_out) { ; CHECK-LABEL: define void @sincos_f32_repeated_uses -; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) [[SIN_OUT:%.*]], ptr addrspace(1) [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { +; CHECK-SAME: (float [[X:%.*]], ptr addrspace(1) captures(address) [[SIN_OUT:%.*]], ptr addrspace(1) captures(address) [[COS_OUT:%.*]]) local_unnamed_addr #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[__SINCOS_:%.*]] = alloca float, align 4, addrspace(5) ; CHECK-NEXT: [[TMP0:%.*]] = call contract float @_Z6sincosfPU3AS5f(float [[X]], ptr addrspace(5) [[__SINCOS_]]) diff --git a/llvm/test/Transforms/Attributor/nofpclass.ll b/llvm/test/Transforms/Attributor/nofpclass.ll index 028a4eed39dc5..ac0aedc7716d5 100644 --- a/llvm/test/Transforms/Attributor/nofpclass.ll +++ b/llvm/test/Transforms/Attributor/nofpclass.ll @@ -275,7 +275,7 @@ define float @mutually_recursive1(float %arg) { define float @recursive_phi(ptr %ptr) { ; CHECK-LABEL: define nofpclass(nan) float @recursive_phi -; CHECK-SAME: (ptr [[PTR:%.*]]) { +; CHECK-SAME: (ptr nofree [[PTR:%.*]]) { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[RET:%.*]] = call nofpclass(nan) float @ret_nofpclass_nan() ; CHECK-NEXT: br label [[LOOP:%.*]] @@ -3655,21 +3655,13 @@ define float @fadd_double_no_zero__output_only_is_dynamic(float noundef nofpclas ; Implies return must be 0 define float @assume_select_condition_not_nan(float noundef %arg) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) -; TUNIT-LABEL: define noundef nofpclass(nan inf nzero sub norm) float @assume_select_condition_not_nan -; TUNIT-SAME: (float noundef [[ARG:%.*]]) #[[ATTR19:[0-9]+]] { -; TUNIT-NEXT: [[ORD:%.*]] = fcmp ord float [[ARG]], 0.000000e+00 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR28:[0-9]+]] -; TUNIT-NEXT: [[SELECT:%.*]] = select i1 [[ORD]], float 0.000000e+00, float [[ARG]] -; TUNIT-NEXT: ret float [[SELECT]] -; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) -; CGSCC-LABEL: define noundef nofpclass(nan inf nzero sub norm) float @assume_select_condition_not_nan -; CGSCC-SAME: (float noundef [[ARG:%.*]]) #[[ATTR19:[0-9]+]] { -; CGSCC-NEXT: [[ORD:%.*]] = fcmp ord float [[ARG]], 0.000000e+00 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR27:[0-9]+]] -; CGSCC-NEXT: [[SELECT:%.*]] = select i1 [[ORD]], float 0.000000e+00, float [[ARG]] -; CGSCC-NEXT: ret float [[SELECT]] +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) +; CHECK-LABEL: define noundef nofpclass(nan inf nzero sub norm) float @assume_select_condition_not_nan +; CHECK-SAME: (float noundef [[ARG:%.*]]) #[[ATTR19:[0-9]+]] { +; CHECK-NEXT: [[ORD:%.*]] = fcmp ord float [[ARG]], 0.000000e+00 +; CHECK-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR22]] +; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[ORD]], float 0.000000e+00, float [[ARG]] +; CHECK-NEXT: ret float [[SELECT]] ; %ord = fcmp ord float %arg, 0.0 call void @llvm.assume(i1 %ord) @@ -3678,21 +3670,13 @@ define float @assume_select_condition_not_nan(float noundef %arg) { } define float @assume_select_condition_not_nan_commute(float noundef %arg) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) -; TUNIT-LABEL: define noundef nofpclass(inf nzero sub norm) float @assume_select_condition_not_nan_commute -; TUNIT-SAME: (float noundef [[ARG:%.*]]) #[[ATTR19]] { -; TUNIT-NEXT: [[UNO:%.*]] = fcmp uno float [[ARG]], 0.000000e+00 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[UNO]]) #[[ATTR28]] -; TUNIT-NEXT: [[SELECT:%.*]] = select i1 [[UNO]], float [[ARG]], float 0.000000e+00 -; TUNIT-NEXT: ret float [[SELECT]] -; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) -; CGSCC-LABEL: define noundef nofpclass(inf nzero sub norm) float @assume_select_condition_not_nan_commute -; CGSCC-SAME: (float noundef [[ARG:%.*]]) #[[ATTR19]] { -; CGSCC-NEXT: [[UNO:%.*]] = fcmp uno float [[ARG]], 0.000000e+00 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[UNO]]) #[[ATTR27]] -; CGSCC-NEXT: [[SELECT:%.*]] = select i1 [[UNO]], float [[ARG]], float 0.000000e+00 -; CGSCC-NEXT: ret float [[SELECT]] +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) +; CHECK-LABEL: define noundef nofpclass(inf nzero sub norm) float @assume_select_condition_not_nan_commute +; CHECK-SAME: (float noundef [[ARG:%.*]]) #[[ATTR19]] { +; CHECK-NEXT: [[UNO:%.*]] = fcmp uno float [[ARG]], 0.000000e+00 +; CHECK-NEXT: call void @llvm.assume(i1 noundef [[UNO]]) #[[ATTR22]] +; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[UNO]], float [[ARG]], float 0.000000e+00 +; CHECK-NEXT: ret float [[SELECT]] ; %uno = fcmp uno float %arg, 0.0 call void @llvm.assume(i1 %uno) @@ -3702,21 +3686,13 @@ define float @assume_select_condition_not_nan_commute(float noundef %arg) { ; Implies no return nan define float @assume_load(ptr %ptr) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) -; TUNIT-LABEL: define nofpclass(nan) float @assume_load -; TUNIT-SAME: (ptr nofree noundef nonnull readonly align 4 captures(none) dereferenceable(4) [[PTR:%.*]]) #[[ATTR20:[0-9]+]] { -; TUNIT-NEXT: [[VAL:%.*]] = load float, ptr [[PTR]], align 4 -; TUNIT-NEXT: [[ORD:%.*]] = fcmp ord float [[VAL]], 0.000000e+00 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR28]] -; TUNIT-NEXT: ret float [[VAL]] -; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) -; CGSCC-LABEL: define nofpclass(nan) float @assume_load -; CGSCC-SAME: (ptr nofree noundef nonnull readonly align 4 captures(none) dereferenceable(4) [[PTR:%.*]]) #[[ATTR20:[0-9]+]] { -; CGSCC-NEXT: [[VAL:%.*]] = load float, ptr [[PTR]], align 4 -; CGSCC-NEXT: [[ORD:%.*]] = fcmp ord float [[VAL]], 0.000000e+00 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR27]] -; CGSCC-NEXT: ret float [[VAL]] +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) +; CHECK-LABEL: define nofpclass(nan) float @assume_load +; CHECK-SAME: (ptr nofree noundef nonnull readonly align 4 captures(none) dereferenceable(4) [[PTR:%.*]]) #[[ATTR20:[0-9]+]] { +; CHECK-NEXT: [[VAL:%.*]] = load float, ptr [[PTR]], align 4 +; CHECK-NEXT: [[ORD:%.*]] = fcmp ord float [[VAL]], 0.000000e+00 +; CHECK-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR22]] +; CHECK-NEXT: ret float [[VAL]] ; %val = load float, ptr %ptr %ord = fcmp ord float %val, 0.0 @@ -3726,19 +3702,12 @@ define float @assume_load(ptr %ptr) { ; FIXME: Why is this not working? define float @assume_returned_arg(float noundef %arg) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) -; TUNIT-LABEL: define noundef float @assume_returned_arg -; TUNIT-SAME: (float noundef returned [[ARG:%.*]]) #[[ATTR19]] { -; TUNIT-NEXT: [[ORD:%.*]] = fcmp ord float [[ARG]], 0.000000e+00 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR28]] -; TUNIT-NEXT: ret float [[ARG]] -; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) -; CGSCC-LABEL: define noundef float @assume_returned_arg -; CGSCC-SAME: (float noundef returned [[ARG:%.*]]) #[[ATTR19]] { -; CGSCC-NEXT: [[ORD:%.*]] = fcmp ord float [[ARG]], 0.000000e+00 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR27]] -; CGSCC-NEXT: ret float [[ARG]] +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write) +; CHECK-LABEL: define noundef float @assume_returned_arg +; CHECK-SAME: (float noundef returned [[ARG:%.*]]) #[[ATTR19]] { +; CHECK-NEXT: [[ORD:%.*]] = fcmp ord float [[ARG]], 0.000000e+00 +; CHECK-NEXT: call void @llvm.assume(i1 noundef [[ORD]]) #[[ATTR22]] +; CHECK-NEXT: ret float [[ARG]] ; %ord = fcmp ord float %arg, 0.0 call void @llvm.assume(i1 %ord) @@ -4012,7 +3981,5 @@ attributes #9 = { denormal_fpenv(ieee|dynamic) } !2 = !{i32 512} ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: -; CGSCC-CI: {{.*}} ; CGSCC-CV: {{.*}} -; TUNIT-CI: {{.*}} ; TUNIT-CV: {{.*}} diff --git a/llvm/test/Transforms/Attributor/nonnull.ll b/llvm/test/Transforms/Attributor/nonnull.ll index aa0cea33d02d0..0aa0e72d403ab 100644 --- a/llvm/test/Transforms/Attributor/nonnull.ll +++ b/llvm/test/Transforms/Attributor/nonnull.ll @@ -843,7 +843,7 @@ f: define i8 @parent6(ptr %a, ptr %b) { ; CHECK-LABEL: define {{[^@]+}}@parent6 -; CHECK-SAME: (ptr [[A:%.*]], ptr noundef [[B:%.*]]) { +; CHECK-SAME: (ptr [[A:%.*]], ptr nofree noundef [[B:%.*]]) { ; CHECK-NEXT: [[C:%.*]] = load volatile i8, ptr [[B]], align 1 ; CHECK-NEXT: call void @use1nonnull(ptr nonnull [[A]]) ; CHECK-NEXT: ret i8 [[C]] diff --git a/llvm/test/Transforms/Attributor/nosync.ll b/llvm/test/Transforms/Attributor/nosync.ll index 49b02beb8d181..bce49fcca913e 100644 --- a/llvm/test/Transforms/Attributor/nosync.ll +++ b/llvm/test/Transforms/Attributor/nosync.ll @@ -105,7 +105,7 @@ define i32 @load_acquire(ptr nocapture readonly %arg) norecurse nounwind uwtable define void @load_release(ptr nocapture %arg) norecurse nounwind uwtable { ; CHECK: Function Attrs: norecurse nounwind memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@load_release -; CHECK-SAME: (ptr noundef writeonly align 4 captures(none) [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-SAME: (ptr nofree noundef writeonly align 4 captures(none) [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: store atomic volatile i32 10, ptr [[ARG]] release, align 4 ; CHECK-NEXT: ret void ; @@ -118,7 +118,7 @@ define void @load_release(ptr nocapture %arg) norecurse nounwind uwtable { define void @load_volatile_release(ptr nocapture %arg) norecurse nounwind uwtable { ; CHECK: Function Attrs: norecurse nounwind memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@load_volatile_release -; CHECK-SAME: (ptr noundef writeonly align 4 captures(none) [[ARG:%.*]]) #[[ATTR3]] { +; CHECK-SAME: (ptr nofree noundef writeonly align 4 captures(none) [[ARG:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: store atomic volatile i32 10, ptr [[ARG]] release, align 4 ; CHECK-NEXT: ret void ; diff --git a/llvm/test/Transforms/FunctionAttrs/atomic.ll b/llvm/test/Transforms/FunctionAttrs/atomic.ll index 8d62a8d20388c..2b6a8e8e8ae37 100644 --- a/llvm/test/Transforms/FunctionAttrs/atomic.ll +++ b/llvm/test/Transforms/FunctionAttrs/atomic.ll @@ -112,7 +112,7 @@ define void @atomicrmw_acq_rel_arg(ptr %x) { define void @atomicrmw_monotonic_volatile_arg(ptr %x) { ; CHECK: Function Attrs: norecurse nounwind memory(argmem: readwrite, inaccessiblemem: readwrite) ; CHECK-LABEL: define void @atomicrmw_monotonic_volatile_arg( -; CHECK-SAME: ptr [[X:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-SAME: ptr captures(address) [[X:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: [[TMP1:%.*]] = atomicrmw volatile add ptr [[X]], i32 1 monotonic, align 4 ; CHECK-NEXT: ret void ; @@ -145,7 +145,7 @@ define void @cmpxchg_acq_rel_arg(ptr %x) { define void @cmpxchg_monotonic_volatile_arg(ptr %x) { ; CHECK: Function Attrs: norecurse nounwind memory(argmem: readwrite, inaccessiblemem: readwrite) ; CHECK-LABEL: define void @cmpxchg_monotonic_volatile_arg( -; CHECK-SAME: ptr [[X:%.*]]) #[[ATTR3]] { +; CHECK-SAME: ptr captures(address) [[X:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: [[TMP1:%.*]] = cmpxchg volatile ptr [[X]], i32 0, i32 1 monotonic monotonic, align 4 ; CHECK-NEXT: ret void ; diff --git a/llvm/test/Transforms/FunctionAttrs/initializes.ll b/llvm/test/Transforms/FunctionAttrs/initializes.ll index 0e1028c18db33..98dc61ca82b2d 100644 --- a/llvm/test/Transforms/FunctionAttrs/initializes.ll +++ b/llvm/test/Transforms/FunctionAttrs/initializes.ll @@ -130,7 +130,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-LABEL: define void @store_volatile( -; CHECK-SAME: ptr [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-SAME: ptr captures(address) [[P:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: [[G:%.*]] = getelementptr i8, ptr [[P]], i64 8 ; CHECK-NEXT: store volatile i32 123, ptr [[G]], align 4 ; CHECK-NEXT: ret void @@ -445,7 +445,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-LABEL: define void @memset_volatile( -; CHECK-SAME: ptr writeonly [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-SAME: ptr writeonly captures(address) [[P:%.*]]) #[[ATTR5:[0-9]+]] { ; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[P]], i8 2, i64 9, i1 true) ; CHECK-NEXT: ret void ; @@ -480,7 +480,7 @@ 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-LABEL: define void @memcpy_volatile( -; CHECK-SAME: ptr writeonly [[P:%.*]], ptr readonly [[P2:%.*]]) #[[ATTR2]] { +; CHECK-SAME: ptr writeonly captures(address) [[P:%.*]], ptr readonly captures(address) [[P2:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr [[P]], ptr [[P2]], i64 9, i1 true) ; CHECK-NEXT: ret void ; @@ -543,7 +543,7 @@ 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-LABEL: define void @memmove_volatile( -; CHECK-SAME: ptr writeonly [[P:%.*]], ptr readonly [[P2:%.*]]) #[[ATTR2]] { +; CHECK-SAME: ptr writeonly captures(address) [[P:%.*]], ptr readonly captures(address) [[P2:%.*]]) #[[ATTR2]] { ; 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 aab801a9a7bf7..d291d6d2d387d 100644 --- a/llvm/test/Transforms/FunctionAttrs/nocapture.ll +++ b/llvm/test/Transforms/FunctionAttrs/nocapture.ll @@ -699,7 +699,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-LABEL: define void @test_volatile -; FNATTRS-SAME: (ptr [[X:%... [truncated] `````````` </details> https://github.com/llvm/llvm-project/pull/201316 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
