This PR removes the old `nocapture` attribute, replacing it with the new `captures` attribute introduced in #116990. This change is intended to be essentially NFC, replacing existing uses of `nocapture` with `captures(none)` without adding any new analysis capabilities. Making use of non-`none` values is left for a followup. Some notes: * `nocapture` will be upgraded to `captures(none)` by the bitcode reader. * `nocapture` will also be upgraded by the textual IR reader. This is to make it easier to use old IR files and somewhat reduce the test churn in this PR. * Helper APIs like `doesNotCapture()` will check for `captures(none)`. * MLIR import will convert `captures(none)` into an `llvm.nocapture` attribute. The representation in the LLVM IR dialect should be updated separately.
45 lines
1.6 KiB
LLVM
45 lines
1.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
|
|
; RUN: opt < %s -O3 -S | FileCheck %s
|
|
|
|
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
%Zip = type { { ptr, ptr }, { [32 x i8], { i64, i64 } } }
|
|
|
|
define void @foo(ptr %a, <32 x i8> %_0) #0 {
|
|
; CHECK-LABEL: define void @foo(
|
|
; CHECK-SAME: ptr writeonly captures(none) initializes((0, 32)) [[A:%.*]], <32 x i8> [[_0:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
|
|
; CHECK-NEXT: start:
|
|
; CHECK-NEXT: store <32 x i8> [[_0]], ptr [[A]], align 1
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
start:
|
|
%z = alloca %Zip, align 8
|
|
%sroa_1 = getelementptr i8, ptr %z, i64 16
|
|
store <32 x i8> %_0, ptr %sroa_1, align 8
|
|
%len_ = getelementptr i8, ptr %z, i64 56
|
|
store i64 32, ptr %len_, align 8
|
|
%_1 = getelementptr %Zip, ptr %z, i64 0, i32 1, i32 1
|
|
%_2 = getelementptr %Zip, ptr %z, i64 0, i32 1, i32 1, i32 1
|
|
%len = load i64, ptr %_2, align 8
|
|
%_10 = getelementptr %Zip, ptr %z, i64 0, i32 1
|
|
br label %body
|
|
|
|
body: ; preds = %body, %start
|
|
%_34 = phi ptr [ %_34i, %body ], [ %a, %start ]
|
|
%idx = phi i64 [ %idx_, %body ], [ 0, %start ]
|
|
%_34i = getelementptr i8, ptr %_34, i64 1
|
|
%idx_ = add i64 %idx, 1
|
|
store i64 0, ptr %_1, align 8
|
|
%_24 = getelementptr i8, ptr %_10, i64 %idx
|
|
%_18 = load i8, ptr %_24, align 1
|
|
store i8 %_18, ptr %_34, align 1
|
|
%_6 = icmp eq i64 %len, %idx_
|
|
br i1 %_6, label %exit, label %body
|
|
|
|
exit: ; preds = %body
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { "target-cpu"="znver3" }
|