[llvm] eda6ff3 - [test][Transform/Utils] Update tests to opaque pointer syntax. NFC
Bjorn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 3 14:02:32 PDT 2022
Author: Bjorn Pettersson
Date: 2022-10-03T23:01:43+02:00
New Revision: eda6ff347272f52e1344d43d956e383a1c039155
URL: https://github.com/llvm/llvm-project/commit/eda6ff347272f52e1344d43d956e383a1c039155
DIFF: https://github.com/llvm/llvm-project/commit/eda6ff347272f52e1344d43d956e383a1c039155.diff
LOG: [test][Transform/Utils] Update tests to opaque pointer syntax. NFC
This patch converts test cases that simly could be rewritten
using the script at
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
Added:
Modified:
llvm/test/Transforms/Util/PredicateInfo/condprop.ll
llvm/test/Transforms/Util/PredicateInfo/pr33456.ll
llvm/test/Transforms/Util/PredicateInfo/pr33457.ll
llvm/test/Transforms/Util/PredicateInfo/unreachable.ll
llvm/test/Transforms/Util/annotation-remarks-dbg-info.ll
llvm/test/Transforms/Util/annotation-remarks.ll
llvm/test/Transforms/Util/assume-builder-counter.ll
llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll
llvm/test/Transforms/Util/call-promotion-utils-ptrcast.ll
llvm/test/Transforms/Util/clone-dicompileunit.ll
llvm/test/Transforms/Util/combine-alias-scope-metadata.ll
llvm/test/Transforms/Util/dbg-call-bitcast.ll
llvm/test/Transforms/Util/dbg-user-of-aext.ll
llvm/test/Transforms/Util/flattencfg.ll
llvm/test/Transforms/Util/libcalls-fast-math-inf-loop.ll
llvm/test/Transforms/Util/libcalls-opt-remarks.ll
llvm/test/Transforms/Util/lowerinvoke-funclet.ll
llvm/test/Transforms/Util/pr49185.ll
llvm/test/Transforms/Util/salvage-debuginfo.ll
llvm/test/Transforms/Util/simplify-dbg-declare-load.ll
llvm/test/Transforms/Util/store-first-op.ll
llvm/test/Transforms/Util/strip-gc-relocates.ll
llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll
llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll
llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll
llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-loops.ll
llvm/test/Transforms/Util/trivial-auto-var-init-call.ll
llvm/test/Transforms/Util/trivial-auto-var-init-store.ll
llvm/test/Transforms/Util/trivial-auto-var-init-unknown.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Util/PredicateInfo/condprop.ll b/llvm/test/Transforms/Util/PredicateInfo/condprop.ll
index 87301606a5f0e..e8bb8d410bf88 100644
--- a/llvm/test/Transforms/Util/PredicateInfo/condprop.ll
+++ b/llvm/test/Transforms/Util/PredicateInfo/condprop.ll
@@ -1,40 +1,40 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=print-predicateinfo -disable-output < %s 2>&1 | FileCheck %s
- at a = external global i32 ; <i32*> [#uses=7]
+ at a = external global i32 ; <ptr> [#uses=7]
define i32 @test1() nounwind {
; CHECK-LABEL: @test1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 4
; CHECK-NEXT: br i1 [[TMP1]], label [[BB:%.*]], label [[BB1:%.*]]
; CHECK: bb:
; CHECK-NEXT: br label [[BB8:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP2]], 5
; CHECK-NEXT: br i1 [[TMP3]], label [[BB2:%.*]], label [[BB3:%.*]]
; CHECK: bb2:
; CHECK-NEXT: br label [[BB8]]
; CHECK: bb3:
-; CHECK-NEXT: [[TMP4:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP4]], 4
; CHECK-NEXT: br i1 [[TMP5]], label [[BB4:%.*]], label [[BB5:%.*]]
; CHECK: bb4:
-; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], 5
; CHECK-NEXT: br label [[BB8]]
; CHECK: bb5:
-; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 5
; CHECK-NEXT: br i1 [[TMP9]], label [[BB6:%.*]], label [[BB7:%.*]]
; CHECK: bb6:
-; CHECK-NEXT: [[TMP10:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TMP11:%.*]] = add i32 [[TMP10]], 4
; CHECK-NEXT: br label [[BB8]]
; CHECK: bb7:
-; CHECK-NEXT: [[TMP12:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: br label [[BB8]]
; CHECK: bb8:
; CHECK-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP12]], [[BB7]] ], [ [[TMP11]], [[BB6]] ], [ [[TMP7]], [[BB4]] ], [ 4, [[BB2]] ], [ 5, [[BB]] ]
@@ -43,7 +43,7 @@ define i32 @test1() nounwind {
; CHECK-NEXT: ret i32 [[DOT0]]
;
entry:
- %0 = load i32, i32* @a, align 4
+ %0 = load i32, ptr @a, align 4
%1 = icmp eq i32 %0, 4
br i1 %1, label %bb, label %bb1
@@ -51,7 +51,7 @@ bb: ; preds = %entry
br label %bb8
bb1: ; preds = %entry
- %2 = load i32, i32* @a, align 4
+ %2 = load i32, ptr @a, align 4
%3 = icmp eq i32 %2, 5
br i1 %3, label %bb2, label %bb3
@@ -59,27 +59,27 @@ bb2: ; preds = %bb1
br label %bb8
bb3: ; preds = %bb1
- %4 = load i32, i32* @a, align 4
+ %4 = load i32, ptr @a, align 4
%5 = icmp eq i32 %4, 4
br i1 %5, label %bb4, label %bb5
bb4: ; preds = %bb3
- %6 = load i32, i32* @a, align 4
+ %6 = load i32, ptr @a, align 4
%7 = add i32 %6, 5
br label %bb8
bb5: ; preds = %bb3
- %8 = load i32, i32* @a, align 4
+ %8 = load i32, ptr @a, align 4
%9 = icmp eq i32 %8, 5
br i1 %9, label %bb6, label %bb7
bb6: ; preds = %bb5
- %10 = load i32, i32* @a, align 4
+ %10 = load i32, ptr @a, align 4
%11 = add i32 %10, 4
br label %bb8
bb7: ; preds = %bb5
- %12 = load i32, i32* @a, align 4
+ %12 = load i32, ptr @a, align 4
br label %bb8
bb8: ; preds = %bb7, %bb6, %bb4, %bb2, %bb
diff --git a/llvm/test/Transforms/Util/PredicateInfo/pr33456.ll b/llvm/test/Transforms/Util/PredicateInfo/pr33456.ll
index c99928d7dc392..14bfbb12f5ada 100644
--- a/llvm/test/Transforms/Util/PredicateInfo/pr33456.ll
+++ b/llvm/test/Transforms/Util/PredicateInfo/pr33456.ll
@@ -9,33 +9,33 @@
define i32 @main() {
; CHECK-LABEL: @main(
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* @d, align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr @d, align 4
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP13:%.*]]
-; CHECK: [[TMP4:%.*]] = load i32, i32* @a, align 4
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* @c, align 4
+; CHECK: [[TMP4:%.*]] = load i32, ptr @a, align 4
+; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr @c, align 4
; CHECK-NEXT: [[TMP6:%.*]] = icmp slt i32 [[TMP5]], 1
; CHECK-NEXT: br i1 [[TMP6]], label [[TMP7:%.*]], label [[TMP9:%.*]]
; CHECK: [[TMP8:%.*]] = icmp eq i32 [[TMP4]], 0
; CHECK-NEXT: br i1 [[TMP8]], label [[TMP9]], label [[TMP9]]
; CHECK: [[DOT0:%.*]] = phi i32 [ [[TMP4]], [[TMP7]] ], [ [[TMP4]], [[TMP7]] ], [ [[DOT1:%.*]], [[TMP13]] ], [ [[TMP4]], [[TMP3]] ]
-; CHECK-NEXT: [[TMP10:%.*]] = load i32, i32* @b, align 4
+; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr @b, align 4
; CHECK-NEXT: [[TMP11:%.*]] = sdiv i32 [[TMP10]], [[DOT0]]
; CHECK-NEXT: [[TMP12:%.*]] = icmp eq i32 [[TMP11]], 0
; CHECK-NEXT: br i1 [[TMP12]], label [[TMP13]], label [[TMP13]]
; CHECK: [[DOT1]] = phi i32 [ [[DOT0]], [[TMP9]] ], [ [[DOT0]], [[TMP9]] ], [ undef, [[TMP0:%.*]] ]
-; CHECK-NEXT: [[TMP14:%.*]] = load i32, i32* @e, align 4
+; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr @e, align 4
; CHECK-NEXT: [[TMP15:%.*]] = icmp eq i32 [[TMP14]], 0
; CHECK-NEXT: br i1 [[TMP15]], label [[TMP16:%.*]], label [[TMP9]]
; CHECK: ret i32 0
;
- %1 = load i32, i32* @d, align 4
+ %1 = load i32, ptr @d, align 4
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %13
; <label>:3: ; preds = %0
- %4 = load i32, i32* @a, align 4
- %5 = load i32, i32* @c, align 4
+ %4 = load i32, ptr @a, align 4
+ %5 = load i32, ptr @c, align 4
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %9
@@ -45,14 +45,14 @@ define i32 @main() {
; <label>:9: ; preds = %13, %7, %7, %3
%.0 = phi i32 [ %4, %7 ], [ %4, %7 ], [ %.1, %13 ], [ %4, %3 ]
- %10 = load i32, i32* @b, align 4
+ %10 = load i32, ptr @b, align 4
%11 = sdiv i32 %10, %.0
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %13
; <label>:13: ; preds = %9, %9, %0
%.1 = phi i32 [ %.0, %9 ], [ %.0, %9 ], [ undef, %0 ]
- %14 = load i32, i32* @e, align 4
+ %14 = load i32, ptr @e, align 4
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %9
@@ -61,8 +61,8 @@ define i32 @main() {
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
diff --git a/llvm/test/Transforms/Util/PredicateInfo/pr33457.ll b/llvm/test/Transforms/Util/PredicateInfo/pr33457.ll
index 1eabea74dc697..bc1d39f371515 100644
--- a/llvm/test/Transforms/Util/PredicateInfo/pr33457.ll
+++ b/llvm/test/Transforms/Util/PredicateInfo/pr33457.ll
@@ -11,21 +11,21 @@
; Function Attrs: nounwind ssp uwtable
define i32 @main() {
; CHECK-LABEL: @main(
-; CHECK-NEXT: store i32 6, i32* @e, align 4
+; CHECK-NEXT: store i32 6, ptr @e, align 4
; CHECK-NEXT: br label [[TMP1:%.*]]
-; CHECK: [[TMP2:%.*]] = load i32, i32* @d, align 4
+; CHECK: [[TMP2:%.*]] = load i32, ptr @d, align 4
; CHECK-NEXT: [[TMP3:%.*]] = sext i32 [[TMP2]] to i64
-; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds [6 x i32], [6 x i32]* @b, i64 0, i64 [[TMP3]]
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
-; CHECK-NEXT: [[TMP6:%.*]] = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 [[TMP5]])
-; CHECK-NEXT: [[TMP7:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds [6 x i32], ptr @b, i64 0, i64 [[TMP3]]
+; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
+; CHECK-NEXT: [[TMP6:%.*]] = call i32 (ptr, ...) @printf(ptr @.str, i32 [[TMP5]])
+; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 0
; CHECK-NEXT: br i1 [[TMP8]], label %thread-pre-split, label [[TMP9:%.*]]
-; CHECK: [[TMP10:%.*]] = load i32, i32* @e, align 4
+; CHECK: [[TMP10:%.*]] = load i32, ptr @e, align 4
; CHECK-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], 0
; CHECK-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP12]]
; CHECK: thread-pre-split:
-; CHECK-NEXT: [[DOTPR:%.*]] = load i32, i32* @e, align 4
+; CHECK-NEXT: [[DOTPR:%.*]] = load i32, ptr @e, align 4
; CHECK-NEXT: br label [[TMP12]]
; CHECK: [[TMP13:%.*]] = phi i32 [ [[DOTPR]], %thread-pre-split ], [ [[TMP10]], [[TMP9]] ], [ [[TMP10]], [[TMP9]] ]
; CHECK-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
@@ -34,34 +34,34 @@ define i32 @main() {
; CHECK: br label [[TMP17]]
; CHECK: [[DOT0:%.*]] = phi i32 [ 1, [[TMP16]] ], [ -1, [[TMP15]] ]
; CHECK-NEXT: [[TMP18:%.*]] = and i32 [[DOT0]], 8693
-; CHECK-NEXT: [[TMP19:%.*]] = load i32, i32* @c, align 4
+; CHECK-NEXT: [[TMP19:%.*]] = load i32, ptr @c, align 4
; CHECK-NEXT: [[TMP20:%.*]] = xor i32 [[TMP18]], [[TMP19]]
; CHECK-NEXT: [[TMP21:%.*]] = xor i32 [[TMP20]], -1
-; CHECK-NEXT: store i32 [[TMP21]], i32* @d, align 4
+; CHECK-NEXT: store i32 [[TMP21]], ptr @d, align 4
; CHECK-NEXT: [[TMP22:%.*]] = icmp slt i32 [[TMP20]], -2
; CHECK-NEXT: br i1 [[TMP22]], label [[TMP1]], label [[TMP23:%.*]]
; CHECK: ret i32 0
;
- store i32 6, i32* @e, align 4
+ store i32 6, ptr @e, align 4
br label %1
; <label>:1: ; preds = %17, %0
- %2 = load i32, i32* @d, align 4
+ %2 = load i32, ptr @d, align 4
%3 = sext i32 %2 to i64
- %4 = getelementptr inbounds [6 x i32], [6 x i32]* @b, i64 0, i64 %3
- %5 = load i32, i32* %4, align 4
- %6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5) #2
- %7 = load i32, i32* @a, align 4
+ %4 = getelementptr inbounds [6 x i32], ptr @b, i64 0, i64 %3
+ %5 = load i32, ptr %4, align 4
+ %6 = call i32 (ptr, ...) @printf(ptr @.str, i32 %5) #2
+ %7 = load i32, ptr @a, align 4
%8 = icmp eq i32 %7, 0
br i1 %8, label %thread-pre-split, label %9
; <label>:9: ; preds = %1
- %10 = load i32, i32* @e, align 4
+ %10 = load i32, ptr @e, align 4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %12
thread-pre-split: ; preds = %1
- %.pr = load i32, i32* @e, align 4
+ %.pr = load i32, ptr @e, align 4
br label %12
; <label>:12: ; preds = %thread-pre-split, %9, %9
@@ -78,10 +78,10 @@ thread-pre-split: ; preds = %1
; <label>:17: ; preds = %16, %15
%.0 = phi i32 [ 1, %16 ], [ -1, %15 ]
%18 = and i32 %.0, 8693
- %19 = load i32, i32* @c, align 4
+ %19 = load i32, ptr @c, align 4
%20 = xor i32 %18, %19
%21 = xor i32 %20, -1
- store i32 %21, i32* @d, align 4
+ store i32 %21, ptr @d, align 4
%22 = icmp slt i32 %20, -2
br i1 %22, label %1, label %23
@@ -89,5 +89,5 @@ thread-pre-split: ; preds = %1
ret i32 0
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
diff --git a/llvm/test/Transforms/Util/PredicateInfo/unreachable.ll b/llvm/test/Transforms/Util/PredicateInfo/unreachable.ll
index 00f1063f6b40a..99314d45913e0 100644
--- a/llvm/test/Transforms/Util/PredicateInfo/unreachable.ll
+++ b/llvm/test/Transforms/Util/PredicateInfo/unreachable.ll
@@ -3,19 +3,19 @@
declare void @foo()
declare void @llvm.assume(i1)
-define void @bar(i32* %p) {
+define void @bar(ptr %p) {
entry:
; CHECK-LABEL: @bar
br label %end
unreachable1:
- %v1 = load i32, i32* %p, align 4
+ %v1 = load i32, ptr %p, align 4
%c1 = icmp eq i32 %v1, 0
call void @llvm.assume(i1 %c1)
br label %unreachable2
unreachable2:
- %v2 = load i32, i32* %p, align 4
+ %v2 = load i32, ptr %p, align 4
%c2 = icmp eq i32 %v2, 0
call void @llvm.assume(i1 %c2)
br label %end
diff --git a/llvm/test/Transforms/Util/annotation-remarks-dbg-info.ll b/llvm/test/Transforms/Util/annotation-remarks-dbg-info.ll
index 25e5729dd70d5..88ebe6040b82a 100644
--- a/llvm/test/Transforms/Util/annotation-remarks-dbg-info.ll
+++ b/llvm/test/Transforms/Util/annotation-remarks-dbg-info.ll
@@ -40,17 +40,17 @@
; CHECK-NEXT: - type: _remarks1
; CHECK-NEXT: ...
-define void @test1(float* %a) !dbg !7 {
+define void @test1(ptr %a) !dbg !7 {
entry:
- %a.addr = alloca float*, align 8, !dbg !16, !annotation !5
- store float* null, float** %a.addr, align 8, !annotation !6
- store float* %a, float** %a.addr, align 8, !annotation !5
+ %a.addr = alloca ptr, align 8, !dbg !16, !annotation !5
+ store ptr null, ptr %a.addr, align 8, !annotation !6
+ store ptr %a, ptr %a.addr, align 8, !annotation !5
ret void, !annotation !5
}
-define void @test2(float* %a) !dbg !17 {
+define void @test2(ptr %a) !dbg !17 {
entry:
- %a.addr = alloca float*, align 8, !annotation !6
+ %a.addr = alloca ptr, align 8, !annotation !6
ret void, !dbg !18, !annotation !6
}
diff --git a/llvm/test/Transforms/Util/annotation-remarks.ll b/llvm/test/Transforms/Util/annotation-remarks.ll
index 38f5a071f55c8..8415c40f90a38 100644
--- a/llvm/test/Transforms/Util/annotation-remarks.ll
+++ b/llvm/test/Transforms/Util/annotation-remarks.ll
@@ -34,17 +34,17 @@
; CHECK-NEXT: - type: _remarks1
; CHECK-NEXT: ...
-define void @test1(float* %a) {
+define void @test1(ptr %a) {
entry:
- %a.addr = alloca float*, align 8, !annotation !0
- store float* null, float** %a.addr, align 8, !annotation !1
- store float* %a, float** %a.addr, align 8, !annotation !0
+ %a.addr = alloca ptr, align 8, !annotation !0
+ store ptr null, ptr %a.addr, align 8, !annotation !1
+ store ptr %a, ptr %a.addr, align 8, !annotation !0
ret void, !annotation !0
}
-define void @test2(float* %a) {
+define void @test2(ptr %a) {
entry:
- %a.addr = alloca float*, align 8, !annotation !1
+ %a.addr = alloca ptr, align 8, !annotation !1
ret void, !annotation !1
}
diff --git a/llvm/test/Transforms/Util/assume-builder-counter.ll b/llvm/test/Transforms/Util/assume-builder-counter.ll
index bf9b2994a05dc..794a8d0b8443f 100644
--- a/llvm/test/Transforms/Util/assume-builder-counter.ll
+++ b/llvm/test/Transforms/Util/assume-builder-counter.ll
@@ -7,88 +7,88 @@
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
-declare void @func(i32*, i32*)
-declare void @func_cold(i32*) cold willreturn nounwind
-declare void @func_strbool(i32*) "no-jump-tables"
-declare void @func_many(i32*) "no-jump-tables" nounwind "less-precise-fpmad" willreturn norecurse
-declare void @func_argattr(i32* align 8, i32* nonnull) nounwind
-declare void @func_argattr2(i32* noundef align 8, i32* noundef nonnull) nounwind
+declare void @func(ptr, ptr)
+declare void @func_cold(ptr) cold willreturn nounwind
+declare void @func_strbool(ptr) "no-jump-tables"
+declare void @func_many(ptr) "no-jump-tables" nounwind "less-precise-fpmad" willreturn norecurse
+declare void @func_argattr(ptr align 8, ptr nonnull) nounwind
+declare void @func_argattr2(ptr noundef align 8, ptr noundef nonnull) nounwind
declare void @may_throw()
-define void @test(i32* %P, i32* %P1, i32* %P2, i32* %P3) {
+define void @test(ptr %P, ptr %P1, ptr %P2, ptr %P3) {
; COUNTER1-LABEL: define {{[^@]+}}@test
-; COUNTER1-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]]) {
-; COUNTER1-NEXT: call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
-; COUNTER1-NEXT: call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
-; COUNTER1-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]]) [[ATTR5:#.*]]
-; COUNTER1-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]])
-; COUNTER1-NEXT: call void @func(i32* [[P1]], i32* [[P]])
-; COUNTER1-NEXT: call void @func_strbool(i32* [[P1]])
-; COUNTER1-NEXT: call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
-; COUNTER1-NEXT: call void @func_many(i32* align 8 [[P1]])
-; COUNTER1-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; COUNTER1-NEXT: call void @func_many(i32* noundef align 8 [[P1]])
-; COUNTER1-NEXT: call void @func_argattr(i32* [[P2]], i32* [[P3]])
-; COUNTER1-NEXT: call void @func_argattr2(i32* [[P2]], i32* [[P3]])
-; COUNTER1-NEXT: call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
-; COUNTER1-NEXT: call void @func(i32* noundef nonnull [[P1]], i32* noundef nonnull [[P]])
+; COUNTER1-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], ptr [[P2:%.*]], ptr [[P3:%.*]]) {
+; COUNTER1-NEXT: call void @func(ptr nonnull dereferenceable(16) [[P]], ptr null)
+; COUNTER1-NEXT: call void @func(ptr dereferenceable(12) [[P1]], ptr nonnull [[P]])
+; COUNTER1-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]]) [[ATTR5:#.*]]
+; COUNTER1-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]])
+; COUNTER1-NEXT: call void @func(ptr [[P1]], ptr [[P]])
+; COUNTER1-NEXT: call void @func_strbool(ptr [[P1]])
+; COUNTER1-NEXT: call void @func(ptr dereferenceable(32) [[P]], ptr dereferenceable(8) [[P]])
+; COUNTER1-NEXT: call void @func_many(ptr align 8 [[P1]])
+; COUNTER1-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; COUNTER1-NEXT: call void @func_many(ptr noundef align 8 [[P1]])
+; COUNTER1-NEXT: call void @func_argattr(ptr [[P2]], ptr [[P3]])
+; COUNTER1-NEXT: call void @func_argattr2(ptr [[P2]], ptr [[P3]])
+; COUNTER1-NEXT: call void @func(ptr nonnull [[P1]], ptr nonnull [[P]])
+; COUNTER1-NEXT: call void @func(ptr noundef nonnull [[P1]], ptr noundef nonnull [[P]])
; COUNTER1-NEXT: ret void
;
; COUNTER2-LABEL: define {{[^@]+}}@test
-; COUNTER2-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]]) {
-; COUNTER2-NEXT: call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
-; COUNTER2-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12) ]
-; COUNTER2-NEXT: call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
+; COUNTER2-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], ptr [[P2:%.*]], ptr [[P3:%.*]]) {
+; COUNTER2-NEXT: call void @func(ptr nonnull dereferenceable(16) [[P]], ptr null)
+; COUNTER2-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 12) ]
+; COUNTER2-NEXT: call void @func(ptr dereferenceable(12) [[P1]], ptr nonnull [[P]])
; COUNTER2-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; COUNTER2-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]]) [[ATTR5:#.*]]
+; COUNTER2-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]]) [[ATTR5:#.*]]
; COUNTER2-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; COUNTER2-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]])
-; COUNTER2-NEXT: call void @func(i32* [[P1]], i32* [[P]])
-; COUNTER2-NEXT: call void @func_strbool(i32* [[P1]])
-; COUNTER2-NEXT: call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
-; COUNTER2-NEXT: call void @func_many(i32* align 8 [[P1]])
-; COUNTER2-NEXT: call void @func_many(i32* noundef align 8 [[P1]])
-; COUNTER2-NEXT: call void @func_argattr(i32* [[P2]], i32* [[P3]])
-; COUNTER2-NEXT: call void @func_argattr2(i32* [[P2]], i32* [[P3]])
-; COUNTER2-NEXT: call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
-; COUNTER2-NEXT: call void @func(i32* noundef nonnull [[P1]], i32* noundef nonnull [[P]])
+; COUNTER2-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]])
+; COUNTER2-NEXT: call void @func(ptr [[P1]], ptr [[P]])
+; COUNTER2-NEXT: call void @func_strbool(ptr [[P1]])
+; COUNTER2-NEXT: call void @func(ptr dereferenceable(32) [[P]], ptr dereferenceable(8) [[P]])
+; COUNTER2-NEXT: call void @func_many(ptr align 8 [[P1]])
+; COUNTER2-NEXT: call void @func_many(ptr noundef align 8 [[P1]])
+; COUNTER2-NEXT: call void @func_argattr(ptr [[P2]], ptr [[P3]])
+; COUNTER2-NEXT: call void @func_argattr2(ptr [[P2]], ptr [[P3]])
+; COUNTER2-NEXT: call void @func(ptr nonnull [[P1]], ptr nonnull [[P]])
+; COUNTER2-NEXT: call void @func(ptr noundef nonnull [[P1]], ptr noundef nonnull [[P]])
; COUNTER2-NEXT: ret void
;
; COUNTER3-LABEL: define {{[^@]+}}@test
-; COUNTER3-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]]) {
-; COUNTER3-NEXT: call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
-; COUNTER3-NEXT: call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
-; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12), "cold"() ]
-; COUNTER3-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]]) [[ATTR5:#.*]]
+; COUNTER3-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], ptr [[P2:%.*]], ptr [[P3:%.*]]) {
+; COUNTER3-NEXT: call void @func(ptr nonnull dereferenceable(16) [[P]], ptr null)
+; COUNTER3-NEXT: call void @func(ptr dereferenceable(12) [[P1]], ptr nonnull [[P]])
+; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 12), "cold"() ]
+; COUNTER3-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]]) [[ATTR5:#.*]]
; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; COUNTER3-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]])
-; COUNTER3-NEXT: call void @func(i32* [[P1]], i32* [[P]])
-; COUNTER3-NEXT: call void @func_strbool(i32* [[P1]])
-; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 32) ]
-; COUNTER3-NEXT: call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
-; COUNTER3-NEXT: call void @func_many(i32* align 8 [[P1]])
-; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; COUNTER3-NEXT: call void @func_many(i32* noundef align 8 [[P1]])
-; COUNTER3-NEXT: call void @func_argattr(i32* [[P2]], i32* [[P3]])
-; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P2]]), "align"(i32* [[P2]], i64 8), "noundef"(i32* [[P3]]), "nonnull"(i32* [[P3]]) ]
-; COUNTER3-NEXT: call void @func_argattr2(i32* [[P2]], i32* [[P3]])
-; COUNTER3-NEXT: call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
-; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P1]]), "noundef"(i32* [[P]]), "nonnull"(i32* [[P]]) ]
-; COUNTER3-NEXT: call void @func(i32* noundef nonnull [[P1]], i32* noundef nonnull [[P]])
+; COUNTER3-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]])
+; COUNTER3-NEXT: call void @func(ptr [[P1]], ptr [[P]])
+; COUNTER3-NEXT: call void @func_strbool(ptr [[P1]])
+; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 32) ]
+; COUNTER3-NEXT: call void @func(ptr dereferenceable(32) [[P]], ptr dereferenceable(8) [[P]])
+; COUNTER3-NEXT: call void @func_many(ptr align 8 [[P1]])
+; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; COUNTER3-NEXT: call void @func_many(ptr noundef align 8 [[P1]])
+; COUNTER3-NEXT: call void @func_argattr(ptr [[P2]], ptr [[P3]])
+; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P2]]), "align"(ptr [[P2]], i64 8), "noundef"(ptr [[P3]]), "nonnull"(ptr [[P3]]) ]
+; COUNTER3-NEXT: call void @func_argattr2(ptr [[P2]], ptr [[P3]])
+; COUNTER3-NEXT: call void @func(ptr nonnull [[P1]], ptr nonnull [[P]])
+; COUNTER3-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P1]]), "noundef"(ptr [[P]]), "nonnull"(ptr [[P]]) ]
+; COUNTER3-NEXT: call void @func(ptr noundef nonnull [[P1]], ptr noundef nonnull [[P]])
; COUNTER3-NEXT: ret void
;
- call void @func(i32* nonnull dereferenceable(16) %P, i32* null)
- call void @func(i32* dereferenceable(12) %P1, i32* nonnull %P)
- call void @func_cold(i32* dereferenceable(12) %P1) cold
- call void @func_cold(i32* dereferenceable(12) %P1)
- call void @func(i32* %P1, i32* %P)
- call void @func_strbool(i32* %P1)
- call void @func(i32* dereferenceable(32) %P, i32* dereferenceable(8) %P)
- call void @func_many(i32* align 8 %P1)
- call void @func_many(i32* align 8 noundef %P1)
- call void @func_argattr(i32* %P2, i32* %P3)
- call void @func_argattr2(i32* %P2, i32* %P3)
- call void @func(i32* nonnull %P1, i32* nonnull %P)
- call void @func(i32* nonnull noundef %P1, i32* nonnull noundef %P)
+ call void @func(ptr nonnull dereferenceable(16) %P, ptr null)
+ call void @func(ptr dereferenceable(12) %P1, ptr nonnull %P)
+ call void @func_cold(ptr dereferenceable(12) %P1) cold
+ call void @func_cold(ptr dereferenceable(12) %P1)
+ call void @func(ptr %P1, ptr %P)
+ call void @func_strbool(ptr %P1)
+ call void @func(ptr dereferenceable(32) %P, ptr dereferenceable(8) %P)
+ call void @func_many(ptr align 8 %P1)
+ call void @func_many(ptr align 8 noundef %P1)
+ call void @func_argattr(ptr %P2, ptr %P3)
+ call void @func_argattr2(ptr %P2, ptr %P3)
+ call void @func(ptr nonnull %P1, ptr nonnull %P)
+ call void @func(ptr nonnull noundef %P1, ptr nonnull noundef %P)
ret void
}
diff --git a/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll b/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll
index 71eec73be862f..dc00a5ef0e6e5 100644
--- a/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll
+++ b/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll
@@ -3,7 +3,7 @@
; Test that CallPromotionUtils will promote calls which require pointer cast
; safely, i.e. drop incompatible attributes.
- at foo = common global i8* (i8*)* null, align 8
+ at foo = common global ptr null, align 8
; casting to i64 and pointer attribute at callsite dropped.
define i64 @func2(i64 %a) {
@@ -11,22 +11,22 @@ define i64 @func2(i64 %a) {
}
; no casting needed, attribute at callsite preserved.
-define i8* @func4(i8* %a) {
- ret i8* undef
+define ptr @func4(ptr %a) {
+ ret ptr undef
}
-define i8* @bar(i8* %arg) {
- %tmp = load i8* (i8*)*, i8* (i8*)** @foo, align 8
+define ptr @bar(ptr %arg) {
+ %tmp = load ptr, ptr @foo, align 8
; Make sure callsite attributes are preserved on arguments and retval.
-; CHECK: call noalias i8* @func4(i8* nonnull
+; CHECK: call noalias ptr @func4(ptr nonnull
; Make sure callsite attributes are dropped on arguments and retval.
-; CHECK: [[ARG:%[0-9]+]] = ptrtoint i8* %arg to i64
+; CHECK: [[ARG:%[0-9]+]] = ptrtoint ptr %arg to i64
; CHECK-NEXT: call i64 @func2(i64 [[ARG]])
- %call = call noalias i8* %tmp(i8* nonnull %arg), !prof !1
- ret i8* %call
+ %call = call noalias ptr %tmp(ptr nonnull %arg), !prof !1
+ ret ptr %call
}
!1 = !{!"VP", i32 0, i64 1440, i64 7651369219802541373, i64 1030, i64 -4377547752858689819, i64 410}
diff --git a/llvm/test/Transforms/Util/call-promotion-utils-ptrcast.ll b/llvm/test/Transforms/Util/call-promotion-utils-ptrcast.ll
index e26384a044b81..d4801c2946eed 100644
--- a/llvm/test/Transforms/Util/call-promotion-utils-ptrcast.ll
+++ b/llvm/test/Transforms/Util/call-promotion-utils-ptrcast.ll
@@ -2,44 +2,44 @@
; Test that CallPromotionUtils will promote calls which require pointer casts.
- at foo = common global i64 (i64)* null, align 8
+ at foo = common global ptr null, align 8
; Check ptrcast arguments.
-define i64 @func1(i8* %a) {
+define i64 @func1(ptr %a) {
ret i64 undef
}
; Check ptrcast return.
-define i8* @func2(i64 %a) {
- ret i8* undef
+define ptr @func2(i64 %a) {
+ ret ptr undef
}
; Check ptrcast arguments and return.
-define i8* @func3(i8 *%a) {
- ret i8* undef
+define ptr @func3(ptr %a) {
+ ret ptr undef
}
; Check mixed ptrcast and bitcast.
-define i8* @func4(double %f) {
- ret i8* undef
+define ptr @func4(double %f) {
+ ret ptr undef
}
define i64 @bar() {
- %tmp = load i64 (i64)*, i64 (i64)** @foo, align 8
+ %tmp = load ptr, ptr @foo, align 8
; CHECK: [[ARG:%[0-9]+]] = bitcast i64 1 to double
-; CHECK-NEXT: [[RET:%[0-9]+]] = call i8* @func4(double [[ARG]])
-; CHECK-NEXT: ptrtoint i8* [[RET]] to i64
+; CHECK-NEXT: [[RET:%[0-9]+]] = call ptr @func4(double [[ARG]])
+; CHECK-NEXT: ptrtoint ptr [[RET]] to i64
-; CHECK: [[RET:%[0-9]+]] = call i8* @func2(i64 1)
-; CHECK-NEXT: ptrtoint i8* [[RET]] to i64
+; CHECK: [[RET:%[0-9]+]] = call ptr @func2(i64 1)
+; CHECK-NEXT: ptrtoint ptr [[RET]] to i64
-; CHECK: [[ARG:%[0-9]+]] = inttoptr i64 1 to i8*
-; CHECK-NEXT: [[RET:%[0-9]+]] = call i8* @func3(i8* [[ARG]])
-; CHECK-NEXT: ptrtoint i8* [[RET]] to i64
+; CHECK: [[ARG:%[0-9]+]] = inttoptr i64 1 to ptr
+; CHECK-NEXT: [[RET:%[0-9]+]] = call ptr @func3(ptr [[ARG]])
+; CHECK-NEXT: ptrtoint ptr [[RET]] to i64
-; CHECK: [[ARG:%[0-9]+]] = inttoptr i64 1 to i8*
-; CHECK-NEXT: call i64 @func1(i8* [[ARG]])
+; CHECK: [[ARG:%[0-9]+]] = inttoptr i64 1 to ptr
+; CHECK-NEXT: call i64 @func1(ptr [[ARG]])
; CHECK-NOT: ptrtoint
; CHECK-NOT: bitcast
diff --git a/llvm/test/Transforms/Util/clone-dicompileunit.ll b/llvm/test/Transforms/Util/clone-dicompileunit.ll
index 13a2abffa87bd..9c775bf69d452 100644
--- a/llvm/test/Transforms/Util/clone-dicompileunit.ll
+++ b/llvm/test/Transforms/Util/clone-dicompileunit.ll
@@ -2,7 +2,7 @@
; Generated using:
; $ cat p.cpp
-; void sink(void *);
+; void sink(ptr);
; class A {
; public:
; template <typename> void m_fn2() { static int a; }
diff --git a/llvm/test/Transforms/Util/combine-alias-scope-metadata.ll b/llvm/test/Transforms/Util/combine-alias-scope-metadata.ll
index cb6ff700edc21..7d6dd44cd90b9 100644
--- a/llvm/test/Transforms/Util/combine-alias-scope-metadata.ll
+++ b/llvm/test/Transforms/Util/combine-alias-scope-metadata.ll
@@ -1,19 +1,19 @@
; RUN: opt < %s -S -basic-aa -memcpyopt | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-define void @test(i8* noalias dereferenceable(1) %in, i8* noalias dereferenceable(1) %out) {
+define void @test(ptr noalias dereferenceable(1) %in, ptr noalias dereferenceable(1) %out) {
%tmp = alloca i8
%tmp2 = alloca i8
-; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %out, i8* align 8 %in, i64 1, i1 false)
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %tmp, i8* align 8 %in, i64 1, i1 false), !alias.scope !4
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %tmp2, i8* align 8 %tmp, i64 1, i1 false), !alias.scope !5
+; CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %out, ptr align 8 %in, i64 1, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr align 8 %tmp, ptr align 8 %in, i64 1, i1 false), !alias.scope !4
+ call void @llvm.memcpy.p0.p0.i64(ptr align 8 %tmp2, ptr align 8 %tmp, i64 1, i1 false), !alias.scope !5
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %out, i8* align 8 %tmp2, i64 1, i1 false), !noalias !6
+ call void @llvm.memcpy.p0.p0.i64(ptr align 8 %out, ptr align 8 %tmp2, i64 1, i1 false), !noalias !6
ret void
}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr, ptr, i64, i1)
!0 = !{!0}
!1 = distinct !{!1, !0, !"in"}
diff --git a/llvm/test/Transforms/Util/dbg-call-bitcast.ll b/llvm/test/Transforms/Util/dbg-call-bitcast.ll
index 2d602c13635e2..42ced41f7f573 100644
--- a/llvm/test/Transforms/Util/dbg-call-bitcast.ll
+++ b/llvm/test/Transforms/Util/dbg-call-bitcast.ll
@@ -2,45 +2,41 @@
define dso_local void @_Z1fv() {
%1 = alloca i32, align 4
- %2 = bitcast i32* %1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %2)
- call void @llvm.dbg.declare(metadata i32* %1, metadata !16, metadata !DIExpression()), !dbg !19
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1)
+ call void @llvm.dbg.declare(metadata ptr %1, metadata !16, metadata !DIExpression()), !dbg !19
; CHECK: %[[A:.*]] = alloca i32, align 4
-; CHECK: call void @llvm.dbg.value(metadata i32* %[[A]], {{.*}}, metadata !DIExpression(DW_OP_deref)
+; CHECK: call void @llvm.dbg.value(metadata ptr %[[A]], {{.*}}, metadata !DIExpression(DW_OP_deref)
; CHECK: call void @_Z1gPv
- call void @_Z1gPv(i8* nonnull %2)
- %3 = bitcast i32* %1 to i8*
+ call void @_Z1gPv(ptr nonnull %1)
; CHECK-NOT: call void @llvm.dbg.value
; CHECK: call void @_Z1gPv
- call void @_Z1gPv(i8* nonnull %3)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2)
+ call void @_Z1gPv(ptr nonnull %1)
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1)
ret void, !dbg !21
}
define dso_local void @_Z2fv() {
%1 = alloca i32, align 4
- %2 = bitcast i32* %1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %2)
- call void @llvm.dbg.declare(metadata i32* %1, metadata !16, metadata !DIExpression()), !dbg !19
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1)
+ call void @llvm.dbg.declare(metadata ptr %1, metadata !16, metadata !DIExpression()), !dbg !19
; CHECK: %[[A:.*]] = alloca i32, align 4
-; CHECK: call void @llvm.dbg.value(metadata i32* %[[A]], {{.*}}, metadata !DIExpression(DW_OP_deref)
+; CHECK: call void @llvm.dbg.value(metadata ptr %[[A]], {{.*}}, metadata !DIExpression(DW_OP_deref)
; CHECK: call void @_Z1gPv
- call void @_Z1gPv(i8* nonnull %2)
+ call void @_Z1gPv(ptr nonnull %1)
br label %block2
block2:
- %3 = bitcast i32* %1 to i8*
-; CHECK: call void @llvm.dbg.value(metadata i32* %[[A]], {{.*}}, metadata !DIExpression(DW_OP_deref)
+; CHECK: call void @llvm.dbg.value(metadata ptr %[[A]], {{.*}}, metadata !DIExpression(DW_OP_deref)
; CHECK: call void @_Z1gPv
- call void @_Z1gPv(i8* nonnull %3)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2)
+ call void @_Z1gPv(ptr nonnull %1)
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1)
ret void, !dbg !21
}
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
declare void @llvm.dbg.declare(metadata, metadata, metadata)
-declare dso_local void @_Z1gPv(i8*)
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare dso_local void @_Z1gPv(ptr)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!8, !9, !10}
diff --git a/llvm/test/Transforms/Util/dbg-user-of-aext.ll b/llvm/test/Transforms/Util/dbg-user-of-aext.ll
index f991518375f1e..d27d9c532b31c 100644
--- a/llvm/test/Transforms/Util/dbg-user-of-aext.ll
+++ b/llvm/test/Transforms/Util/dbg-user-of-aext.ll
@@ -32,18 +32,17 @@ entry:
%g = alloca %struct.foo, align 8
%b.addr = alloca i8, align 1
%frag.addr = alloca i8, align 1
- %0 = bitcast %struct.foo* %g to { i8, i64 }*
- %1 = getelementptr inbounds { i8, i64 }, { i8, i64 }* %0, i32 0, i32 0
- store i8 %g.coerce0, i8* %1, align 8
- %2 = getelementptr inbounds { i8, i64 }, { i8, i64 }* %0, i32 0, i32 1
- store i64 %g.coerce1, i64* %2, align 8
+ %0 = getelementptr inbounds { i8, i64 }, ptr %g, i32 0, i32 0
+ store i8 %g.coerce0, ptr %0, align 8
+ %1 = getelementptr inbounds { i8, i64 }, ptr %g, i32 0, i32 1
+ store i64 %g.coerce1, ptr %1, align 8
%frombool = zext i1 %b to i8
- store i8 %frombool, i8* %b.addr, align 1
- call void @llvm.dbg.declare(metadata i8* %b.addr, metadata !15, metadata !16), !dbg !17
+ store i8 %frombool, ptr %b.addr, align 1
+ call void @llvm.dbg.declare(metadata ptr %b.addr, metadata !15, metadata !16), !dbg !17
%frombool1 = sext i1 %frag to i8
- store i8 %frombool1, i8* %frag.addr, align 1
- call void @llvm.dbg.declare(metadata i8* %frag.addr, metadata !18, metadata !23), !dbg !19
- call void @llvm.dbg.declare(metadata %struct.foo* %g, metadata !20, metadata !16), !dbg !21
+ store i8 %frombool1, ptr %frag.addr, align 1
+ call void @llvm.dbg.declare(metadata ptr %frag.addr, metadata !18, metadata !23), !dbg !19
+ call void @llvm.dbg.declare(metadata ptr %g, metadata !20, metadata !16), !dbg !21
ret void, !dbg !22
}
diff --git a/llvm/test/Transforms/Util/flattencfg.ll b/llvm/test/Transforms/Util/flattencfg.ll
index 03a45b3a075ff..662fdcaa96abb 100644
--- a/llvm/test/Transforms/Util/flattencfg.ll
+++ b/llvm/test/Transforms/Util/flattencfg.ll
@@ -95,7 +95,7 @@ bb3: ; preds = %bb2, %bb1
; CHECK-NEXT: [[COND:%[a-z0-9]+]] = or i1 %cmp.x, %cmp.y
; CHECK-NEXT: br i1 [[COND]], label %if.then.y, label %exit
; CHECK: if.then.y:
-; CHECK-NEXT: store i32 %z, i32* @g, align 4
+; CHECK-NEXT: store i32 %z, ptr @g, align 4
; CHECK-NEXT: br label %exit
; CHECK: exit:
; CHECK-NEXT: ret void
@@ -105,7 +105,7 @@ entry.x:
br i1 %cmp.x, label %if.then.x, label %entry.y
if.then.x:
- store i32 %z, i32* @g, align 4
+ store i32 %z, ptr @g, align 4
br label %entry.y
entry.y:
@@ -113,7 +113,7 @@ entry.y:
br i1 %cmp.y, label %if.then.y, label %exit
if.then.y:
- store i32 %z, i32* @g, align 4
+ store i32 %z, ptr @g, align 4
br label %exit
exit:
@@ -127,7 +127,7 @@ exit:
; CHECK-NEXT: [[COND:%[a-z0-9]+]] = and i1 %cmp.x, %cmp.y
; CHECK-NEXT: br i1 [[COND]], label %exit, label %if.else.y
; CHECK: if.else.y:
-; CHECK-NEXT: store i32 %z, i32* @g, align 4
+; CHECK-NEXT: store i32 %z, ptr @g, align 4
; CHECK-NEXT: br label %exit
; CHECK: exit:
; CHECK-NEXT: ret void
@@ -137,7 +137,7 @@ entry.x:
br i1 %cmp.x, label %entry.y, label %if.else.x
if.else.x:
- store i32 %z, i32* @g, align 4
+ store i32 %z, ptr @g, align 4
br label %entry.y
entry.y:
@@ -145,7 +145,7 @@ entry.y:
br i1 %cmp.y, label %exit, label %if.else.y
if.else.y:
- store i32 %z, i32* @g, align 4
+ store i32 %z, ptr @g, align 4
br label %exit
exit:
@@ -159,7 +159,7 @@ exit:
; CHECK-NEXT: [[COND:%[a-z0-9]+]] = and i1 %cmp.x, %cmp.y
; CHECK-NEXT: br i1 [[COND]], label %exit, label %if.then.y
; CHECK: if.then.y:
-; CHECK-NEXT: store i32 %z, i32* @g, align 4
+; CHECK-NEXT: store i32 %z, ptr @g, align 4
; CHECK-NEXT: br label %exit
; CHECK: exit:
; CHECK-NEXT: ret void
@@ -169,7 +169,7 @@ entry.x:
br i1 %cmp.x, label %entry.y, label %if.else.x
if.else.x:
- store i32 %z, i32* @g, align 4
+ store i32 %z, ptr @g, align 4
br label %entry.y
entry.y:
@@ -177,7 +177,7 @@ entry.y:
br i1 %cmp.y, label %if.then.y, label %exit
if.then.y:
- store i32 %z, i32* @g, align 4
+ store i32 %z, ptr @g, align 4
br label %exit
exit:
@@ -191,7 +191,7 @@ exit:
; CHECK-NEXT: [[COND:%[a-z0-9]+]] = or i1 %cmp.x, %cmp.y
; CHECK-NEXT: br i1 [[COND]], label %if.else.y, label %exit
; CHECK: if.else.y:
-; CHECK-NEXT: store i32 %z, i32* @g, align 4
+; CHECK-NEXT: store i32 %z, ptr @g, align 4
; CHECK-NEXT: br label %exit
; CHECK: exit:
; CHECK-NEXT: ret void
@@ -201,7 +201,7 @@ entry.x:
br i1 %cmp.x, label %if.then.x, label %entry.y
if.then.x:
- store i32 %z, i32* @g, align 4
+ store i32 %z, ptr @g, align 4
br label %entry.y
entry.y:
@@ -209,7 +209,7 @@ entry.y:
br i1 %cmp.y, label %exit, label %if.else.y
if.else.y:
- store i32 %z, i32* @g, align 4
+ store i32 %z, ptr @g, align 4
br label %exit
exit:
diff --git a/llvm/test/Transforms/Util/libcalls-fast-math-inf-loop.ll b/llvm/test/Transforms/Util/libcalls-fast-math-inf-loop.ll
index abbc7b7da44f7..1efbcfa299831 100644
--- a/llvm/test/Transforms/Util/libcalls-fast-math-inf-loop.ll
+++ b/llvm/test/Transforms/Util/libcalls-fast-math-inf-loop.ll
@@ -23,8 +23,8 @@ define float @fn(float %f) #0 {
; CHECK: define float @fn(
; CHECK: call fast float @expf(
%f.addr = alloca float, align 4
- store float %f, float* %f.addr, align 4, !tbaa !1
- %1 = load float, float* %f.addr, align 4, !tbaa !1
+ store float %f, ptr %f.addr, align 4, !tbaa !1
+ %1 = load float, ptr %f.addr, align 4, !tbaa !1
%call = call fast float @expf(float %1) #3
ret float %call
}
@@ -36,8 +36,8 @@ define available_externally float @expf(float %x) #1 {
; CHECK: call fast double @exp(
; CHECK: fptrunc double
%x.addr = alloca float, align 4
- store float %x, float* %x.addr, align 4, !tbaa !1
- %1 = load float, float* %x.addr, align 4, !tbaa !1
+ store float %x, ptr %x.addr, align 4, !tbaa !1
+ %1 = load float, ptr %x.addr, align 4, !tbaa !1
%conv = fpext float %1 to double
%call = call fast double @exp(double %conv) #3
%conv1 = fptrunc double %call to float
diff --git a/llvm/test/Transforms/Util/libcalls-opt-remarks.ll b/llvm/test/Transforms/Util/libcalls-opt-remarks.ll
index 4d44e6dd24d29..7edafa8295237 100644
--- a/llvm/test/Transforms/Util/libcalls-opt-remarks.ll
+++ b/llvm/test/Transforms/Util/libcalls-opt-remarks.ll
@@ -19,16 +19,14 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-declare i32 @strlen(i8*)
+declare i32 @strlen(ptr)
@hello = constant [6 x i8] c"hello\00"
@longer = constant [7 x i8] c"longer\00"
define i32 @f1(i1) !dbg !7 {
- %hello = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0, !dbg !10
- %longer = getelementptr [7 x i8], [7 x i8]* @longer, i32 0, i32 0, !dbg !12
- %2 = select i1 %0, i8* %hello, i8* %longer, !dbg !9
- %3 = call i32 @strlen(i8* %2), !dbg !14
+ %2 = select i1 %0, ptr @hello, ptr @longer, !dbg !9
+ %3 = call i32 @strlen(ptr %2), !dbg !14
ret i32 %3, !dbg !16
}
diff --git a/llvm/test/Transforms/Util/lowerinvoke-funclet.ll b/llvm/test/Transforms/Util/lowerinvoke-funclet.ll
index 1aa2fc8e7a2c4..dfa3e98167a1b 100644
--- a/llvm/test/Transforms/Util/lowerinvoke-funclet.ll
+++ b/llvm/test/Transforms/Util/lowerinvoke-funclet.ll
@@ -4,7 +4,7 @@
%struct.Cleanup = type { i8 }
-define void @lowerinvoke_funclet() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+define void @lowerinvoke_funclet() personality ptr @__CxxFrameHandler3 {
; CHECK-LABEL: @lowerinvoke_funclet
entry:
%c = alloca %struct.Cleanup, align 1
@@ -15,13 +15,13 @@ catch.dispatch: ; preds = %entry
%0 = catchswitch within none [label %catch] unwind to caller
catch: ; preds = %catch.dispatch
- %1 = catchpad within %0 [i8* null, i32 64, i8* null]
+ %1 = catchpad within %0 [ptr null, i32 64, ptr null]
invoke void @bar(i32 3) [ "funclet"(token %1), "test"(i32 0) ]
to label %invoke.cont1 unwind label %ehcleanup
; CHECK: call void @bar(i32 3) [ "funclet"(token %1), "test"(i32 0) ]
invoke.cont1: ; preds = %catch
- call void @"??1Cleanup@@QEAA at XZ"(%struct.Cleanup* %c) #3 [ "funclet"(token %1) ]
+ call void @"??1Cleanup@@QEAA at XZ"(ptr %c) #3 [ "funclet"(token %1) ]
catchret from %1 to label %try.cont
try.cont: ; preds = %entry, %invoke.cont1
@@ -29,11 +29,11 @@ try.cont: ; preds = %entry, %invoke.cont
ehcleanup: ; preds = %catch
%2 = cleanuppad within %1 []
- call void @"??1Cleanup@@QEAA at XZ"(%struct.Cleanup* %c) #3 [ "funclet"(token %2) ]
+ call void @"??1Cleanup@@QEAA at XZ"(ptr %c) #3 [ "funclet"(token %2) ]
cleanupret from %2 unwind to caller
}
declare void @foo()
declare void @bar(i32)
declare i32 @__CxxFrameHandler3(...)
-declare void @"??1Cleanup@@QEAA at XZ"(%struct.Cleanup*) unnamed_addr
+declare void @"??1Cleanup@@QEAA at XZ"(ptr) unnamed_addr
diff --git a/llvm/test/Transforms/Util/pr49185.ll b/llvm/test/Transforms/Util/pr49185.ll
index 402835340a768..76bef2db425d8 100644
--- a/llvm/test/Transforms/Util/pr49185.ll
+++ b/llvm/test/Transforms/Util/pr49185.ll
@@ -9,7 +9,7 @@
@g_315 = external dso_local global %struct0, align 1
@g_359 = external dso_local global %struct0, align 1
-define dso_local i16 @main(i16 %argc, i16** %argv) #0 {
+define dso_local i16 @main(i16 %argc, ptr %argv) #0 {
entry:
%call2 = call i16 @func_1()
unreachable
@@ -17,55 +17,55 @@ entry:
define internal i16 @func_1() #0 {
entry:
- %call = call i16 @func_21(i32* undef, i32 undef, i32* undef)
+ %call = call i16 @func_21(ptr undef, i32 undef, ptr undef)
ret i16 undef
}
-define internal i16 @func_21(i32* %p_22, i32 %p_23, i32* %p_24) #0 {
+define internal i16 @func_21(ptr %p_22, i32 %p_23, ptr %p_24) #0 {
entry:
- call void @func_34(%struct0* align 1 undef, i32 undef, i32 undef, i32* @g_6, %union0* byval(%union0) align 1 undef)
+ call void @func_34(ptr align 1 undef, i32 undef, i32 undef, ptr @g_6, ptr byval(%union0) align 1 undef)
unreachable
}
-define internal void @func_34(%struct0* %agg.result, i32 %p_35, i32 %p_36, i32* %p_37, %union0* %p_38) #0 {
+define internal void @func_34(ptr %agg.result, i32 %p_35, i32 %p_36, ptr %p_37, ptr %p_38) #0 {
entry:
- %p_37.addr = alloca i32*, align 1
+ %p_37.addr = alloca ptr, align 1
%cleanup.dest.slot = alloca i32, align 1
- store i32* %p_37, i32** %p_37.addr, align 1
+ store ptr %p_37, ptr %p_37.addr, align 1
br label %lbl_898
lbl_898: ; preds = %cleanup3097, %entry
br label %lbl_1111
lbl_1111: ; preds = %cleanup3097, %lbl_898
- %0 = load i32, i32* getelementptr inbounds (%struct0, %struct0* @g_359, i32 0, i32 4), align 1
+ %0 = load i32, ptr getelementptr inbounds (%struct0, ptr @g_359, i32 0, i32 4), align 1
%tobool1833 = icmp ne i32 %0, 0
br i1 %tobool1833, label %land.rhs1834, label %land.end1851
land.rhs1834: ; preds = %lbl_1111
- store i16 0, i16* @g_60, align 1
+ store i16 0, ptr @g_60, align 1
br label %land.end1851
land.end1851: ; preds = %land.rhs1834, %lbl_1111
- %1 = load i32*, i32** %p_37.addr, align 1
- %2 = load i32, i32* %1, align 1
+ %1 = load ptr, ptr %p_37.addr, align 1
+ %2 = load i32, ptr %1, align 1
%tobool2351 = icmp ne i32 %2, 0
br i1 %tobool2351, label %if.then2352, label %if.else3029
if.then2352: ; preds = %land.end1851
- %3 = load i16, i16* getelementptr inbounds ({ i16, i16 }, { i16, i16 }* @g_79, i32 0, i32 0), align 1, !tbaa !1
+ %3 = load i16, ptr getelementptr inbounds ({ i16, i16 }, ptr @g_79, i32 0, i32 0), align 1, !tbaa !1
%tobool3011 = icmp ne i16 %3, 0
call void @llvm.assume(i1 %tobool3011)
- store i32 11, i32* %cleanup.dest.slot, align 1
+ store i32 11, ptr %cleanup.dest.slot, align 1
br label %cleanup3097
if.else3029: ; preds = %land.end1851
- store i32 3, i32* getelementptr inbounds (%struct0, %struct0* @g_315, i32 0, i32 4), align 1
- store i32 132, i32* %cleanup.dest.slot, align 1
+ store i32 3, ptr getelementptr inbounds (%struct0, ptr @g_315, i32 0, i32 4), align 1
+ store i32 132, ptr %cleanup.dest.slot, align 1
br label %cleanup3097
cleanup3097: ; preds = %if.else3029, %if.then2352
- %cleanup.dest3113 = load i32, i32* %cleanup.dest.slot, align 1
+ %cleanup.dest3113 = load i32, ptr %cleanup.dest.slot, align 1
switch i32 %cleanup.dest3113, label %cleanup3402 [
i32 132, label %lbl_1111
i32 11, label %lbl_898
diff --git a/llvm/test/Transforms/Util/salvage-debuginfo.ll b/llvm/test/Transforms/Util/salvage-debuginfo.ll
index d72b239e31644..b877d1bded602 100644
--- a/llvm/test/Transforms/Util/salvage-debuginfo.ll
+++ b/llvm/test/Transforms/Util/salvage-debuginfo.ll
@@ -4,8 +4,8 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
target triple = "x86_64-apple-macosx"
define void @f(i32) !dbg !8 {
entry:
- %p_x = inttoptr i32 %0 to i8*
- %i_x = ptrtoint i8* %p_x to i32
+ %p_x = inttoptr i32 %0 to ptr
+ %i_x = ptrtoint ptr %p_x to i32
; CHECK: call void @llvm.dbg.value(metadata i32 %0,
; CHECK-SAME: !DIExpression(DW_OP_LLVM_convert, 32, DW_ATE_unsigned,
; CHECK-SAME: DW_OP_LLVM_convert, 64, DW_ATE_unsigned,
diff --git a/llvm/test/Transforms/Util/simplify-dbg-declare-load.ll b/llvm/test/Transforms/Util/simplify-dbg-declare-load.ll
index 483cf2f6dc8dc..7a37ac4f1053a 100644
--- a/llvm/test/Transforms/Util/simplify-dbg-declare-load.ll
+++ b/llvm/test/Transforms/Util/simplify-dbg-declare-load.ll
@@ -15,25 +15,25 @@ define void @julia_fastshortest_6256() #1 {
top:
%cp = alloca %foo, align 8
%sink = alloca %foo, align 8
- call void @llvm.dbg.declare(metadata %foo* %cp, metadata !1, metadata !16), !dbg !17
+ call void @llvm.dbg.declare(metadata ptr %cp, metadata !1, metadata !16), !dbg !17
br i1 undef, label %idxend, label %fail
fail: ; preds = %top
unreachable
idxend: ; preds = %top
-; CHECK-NOT: call void @llvm.dbg.value(metadata %foo* %cp,
- %0 = load %foo, %foo* %cp, align 8
- store volatile %foo %0, %foo *%sink, align 8
+; CHECK-NOT: call void @llvm.dbg.value(metadata ptr %cp,
+ %0 = load %foo, ptr %cp, align 8
+ store volatile %foo %0, ptr %sink, align 8
; CHECK: call void @llvm.dbg.value(metadata %foo %
- store %foo %0, %foo* undef, align 8
+ store %foo %0, ptr undef, align 8
ret void
}
; Keep the declare if we keep the alloca.
; DECLARE-LABEL: define void @julia_fastshortest_6256()
; DECLARE: %cp = alloca %foo, align 8
-; DECLARE: call void @llvm.dbg.declare(metadata %foo* %cp,
+; DECLARE: call void @llvm.dbg.declare(metadata ptr %cp,
attributes #0 = { nounwind readnone }
attributes #1 = { sspreq }
diff --git a/llvm/test/Transforms/Util/store-first-op.ll b/llvm/test/Transforms/Util/store-first-op.ll
index c4ef2a14262e3..d88138d55e5a4 100644
--- a/llvm/test/Transforms/Util/store-first-op.ll
+++ b/llvm/test/Transforms/Util/store-first-op.ll
@@ -10,9 +10,9 @@ entry:
; %getU is a store TO %getU. There are valid reasons to have an llvm.dbg.value here, but if the pass
; is changed to emit such, a more specific check should be added to make sure that any llvm.dbg.value
; is correct.
-; CHECK-NOT: @llvm.dbg.value(metadata %foo* %getU
- call void @llvm.dbg.declare(metadata %foo* %getU, metadata !3, metadata !6), !dbg !7
- store %foo* %getU, %foo** undef, align 8, !tbaa !8
+; CHECK-NOT: @llvm.dbg.value(metadata ptr %getU
+ call void @llvm.dbg.declare(metadata ptr %getU, metadata !3, metadata !6), !dbg !7
+ store ptr %getU, ptr undef, align 8, !tbaa !8
unreachable
}
diff --git a/llvm/test/Transforms/Util/strip-gc-relocates.ll b/llvm/test/Transforms/Util/strip-gc-relocates.ll
index f94312602c3a0..215a4fafd0e3a 100644
--- a/llvm/test/Transforms/Util/strip-gc-relocates.ll
+++ b/llvm/test/Transforms/Util/strip-gc-relocates.ll
@@ -1,77 +1,70 @@
; RUN: opt -S -strip-gc-relocates -instcombine < %s | FileCheck %s
; RUN: opt -S -passes=strip-gc-relocates,instcombine < %s | FileCheck %s
; test utility/debugging pass which removes gc.relocates, inserted by -rewrite-statepoints-for-gc
-declare void @use_obj32(i32 addrspace(1)*) "gc-leaf-function"
+declare void @use_obj32(ptr addrspace(1)) "gc-leaf-function"
declare void @g()
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
-declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32) #0
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) #0
declare void @do_safepoint()
-declare i32 addrspace(1)* @new_instance() #1
+declare ptr addrspace(1) @new_instance() #1
; Simple case: remove gc.relocate
-define i32 addrspace(1)* @test1(i32 addrspace(1)* %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test1(ptr addrspace(1) %arg) gc "statepoint-example" {
entry:
; CHECK-LABEL: test1
; CHECK: gc.statepoint
; CHECK-NOT: gc.relocate
-; CHECK: ret i32 addrspace(1)* %arg
- %statepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i32 addrspace(1)* %arg), "deopt" (i32 100)]
- %arg.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
- %arg.relocated.casted = bitcast i8 addrspace(1)* %arg.relocated to i32 addrspace(1)*
- ret i32 addrspace(1)* %arg.relocated.casted
+; CHECK: ret ptr addrspace(1) %arg
+ %statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg), "deopt" (i32 100)]
+ %arg.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
+ ret ptr addrspace(1) %arg.relocated
}
; Remove gc.relocates in presence of nested relocates.
-define void @test2(i32 addrspace(1)* %base) gc "statepoint-example" {
+define void @test2(ptr addrspace(1) %base) gc "statepoint-example" {
entry:
; CHECK-LABEL: test2
; CHECK: statepoint
; CHECK-NOT: gc.relocate
-; CHECK: call void @use_obj32(i32 addrspace(1)* %ptr.gep1)
-; CHECK: call void @use_obj32(i32 addrspace(1)* %ptr.gep1)
- %ptr.gep = getelementptr i32, i32 addrspace(1)* %base, i32 15
- %ptr.gep1 = getelementptr i32, i32 addrspace(1)* %ptr.gep, i32 15
- %statepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i32 addrspace(1)* %ptr.gep1, i32 addrspace(1)* %base)]
- %ptr.gep1.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 1, i32 0) ; (%base, %ptr.gep1)
- %ptr.gep1.relocated.casted = bitcast i8 addrspace(1)* %ptr.gep1.relocated to i32 addrspace(1)*
- %base.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 1, i32 1) ; (%base, %base)
- %base.relocated.casted = bitcast i8 addrspace(1)* %base.relocated to i32 addrspace(1)*
- call void @use_obj32(i32 addrspace(1)* %ptr.gep1.relocated.casted)
- %statepoint_token1 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i32 addrspace(1)* %ptr.gep1.relocated.casted, i32 addrspace(1)* %base.relocated.casted)]
- %ptr.gep1.relocated2 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token1, i32 1, i32 0) ; (%base.relocated.casted, %ptr.gep1.relocated.casted)
- %ptr.gep1.relocated2.casted = bitcast i8 addrspace(1)* %ptr.gep1.relocated2 to i32 addrspace(1)*
- %base.relocated3 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token1, i32 1, i32 1) ; (%base.relocated.casted, %base.relocated.casted)
- %base.relocated3.casted = bitcast i8 addrspace(1)* %base.relocated3 to i32 addrspace(1)*
- call void @use_obj32(i32 addrspace(1)* %ptr.gep1.relocated2.casted)
+; CHECK: call void @use_obj32(ptr addrspace(1) %ptr.gep1)
+; CHECK: call void @use_obj32(ptr addrspace(1) %ptr.gep1)
+ %ptr.gep = getelementptr i32, ptr addrspace(1) %base, i32 15
+ %ptr.gep1 = getelementptr i32, ptr addrspace(1) %ptr.gep, i32 15
+ %statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %ptr.gep1, ptr addrspace(1) %base)]
+ %ptr.gep1.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 1, i32 0) ; (%base, %ptr.gep1)
+ %base.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 1, i32 1) ; (%base, %base)
+ call void @use_obj32(ptr addrspace(1) %ptr.gep1.relocated)
+ %statepoint_token1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %ptr.gep1.relocated, ptr addrspace(1) %base.relocated)]
+ %ptr.gep1.relocated2 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token1, i32 1, i32 0) ; (%base.relocated, %ptr.gep1.relocated)
+ %base.relocated3 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token1, i32 1, i32 1) ; (%base.relocated, %base.relocated)
+ call void @use_obj32(ptr addrspace(1) %ptr.gep1.relocated2)
ret void
}
; landing pad gc.relocates removed by instcombine since it has no uses.
-define i32 addrspace(1)* @test3(i32 addrspace(1)* %arg) gc "statepoint-example" personality i32 8 {
+define ptr addrspace(1) @test3(ptr addrspace(1) %arg) gc "statepoint-example" personality i32 8 {
; CHECK-LABEL: test3(
; CHECK: gc.statepoint
; CHECK-LABEL: normal_dest:
; CHECK-NOT: gc.relocate
-; CHECK: ret i32 addrspace(1)* %arg
+; CHECK: ret ptr addrspace(1) %arg
; CHECK-LABEL: unwind_dest:
; CHECK-NOT: gc.relocate
entry:
- %statepoint_token = invoke token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i32 addrspace(1)* %arg), "deopt" (i32 100)]
+ %statepoint_token = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg), "deopt" (i32 100)]
to label %normal_dest unwind label %unwind_dest
normal_dest: ; preds = %entry
- %arg.relocated1 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
- %arg.relocated1.casted = bitcast i8 addrspace(1)* %arg.relocated1 to i32 addrspace(1)*
- ret i32 addrspace(1)* %arg.relocated1.casted
+ %arg.relocated1 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
+ ret ptr addrspace(1) %arg.relocated1
unwind_dest: ; preds = %entry
%lpad = landingpad token
cleanup
- %arg.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %lpad, i32 0, i32 0) ; (%arg, %arg)
- %arg.relocated.casted = bitcast i8 addrspace(1)* %arg.relocated to i32 addrspace(1)*
+ %arg.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %lpad, i32 0, i32 0) ; (%arg, %arg)
resume token undef
}
@@ -79,8 +72,8 @@ unwind_dest: ; preds = %entry
define void @test4(i1 %cond) gc "statepoint-example" {
; CHECK-LABEL: test4
entry:
- %base1 = call i32 addrspace(1)* @new_instance()
- %base2 = call i32 addrspace(1)* @new_instance()
+ %base1 = call ptr addrspace(1) @new_instance()
+ %base2 = call ptr addrspace(1) @new_instance()
br i1 %cond, label %here, label %there
here: ; preds = %entry
@@ -92,28 +85,27 @@ there: ; preds = %entry
merge: ; preds = %there, %here
; CHECK-LABEL: merge:
; CHECK-NOT: gc.relocate
-; CHECK: %ptr.gep.remat = getelementptr i32, i32 addrspace(1)* %basephi.base
- %basephi.base = phi i32 addrspace(1)* [ %base1, %here ], [ %base2, %there ], !is_base_value !0
- %basephi = phi i32 addrspace(1)* [ %base1, %here ], [ %base2, %there ]
- %ptr.gep = getelementptr i32, i32 addrspace(1)* %basephi, i32 15
- %statepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i32 addrspace(1)* %basephi.base)]
- %basephi.base.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 0, i32 0) ; (%basephi.base, %basephi.base)
- %basephi.base.relocated.casted = bitcast i8 addrspace(1)* %basephi.base.relocated to i32 addrspace(1)*
- %ptr.gep.remat = getelementptr i32, i32 addrspace(1)* %basephi.base.relocated.casted, i32 15
- call void @use_obj32(i32 addrspace(1)* %ptr.gep.remat)
+; CHECK: %ptr.gep.remat = getelementptr i32, ptr addrspace(1) %basephi.base
+ %basephi.base = phi ptr addrspace(1) [ %base1, %here ], [ %base2, %there ], !is_base_value !0
+ %basephi = phi ptr addrspace(1) [ %base1, %here ], [ %base2, %there ]
+ %ptr.gep = getelementptr i32, ptr addrspace(1) %basephi, i32 15
+ %statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %basephi.base)]
+ %basephi.base.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%basephi.base, %basephi.base)
+ %ptr.gep.remat = getelementptr i32, ptr addrspace(1) %basephi.base.relocated, i32 15
+ call void @use_obj32(ptr addrspace(1) %ptr.gep.remat)
ret void
}
; The gc.relocate type is
diff erent from %arg, but removing the gc.relocate,
-; needs a bitcast to be added from i32 addrspace(1)* to i8 addrspace(1)*
-define i8 addrspace(1)* @test5(i32 addrspace(1)* %arg) gc "statepoint-example" {
+; needs a bitcast to be added from ptr addrspace(1) to ptr addrspace(1)
+define ptr addrspace(1) @test5(ptr addrspace(1) %arg) gc "statepoint-example" {
entry:
; CHECK-LABEL: test5
; CHECK: gc.statepoint
; CHECK-NOT: gc.relocate
- %statepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i32 addrspace(1)* %arg), "deopt" (i32 100)]
- %arg.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
- ret i8 addrspace(1)* %arg.relocated
+ %statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg), "deopt" (i32 100)]
+ %arg.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
+ ret ptr addrspace(1) %arg.relocated
}
attributes #0 = { nounwind readonly }
diff --git a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll
index 7a666764d1f3e..286491bdcbe77 100644
--- a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll
+++ b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll
@@ -16,29 +16,29 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
%struct.B = type { %struct.A }
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
; CHECK: @b = global
; CHECK-NOT: !dbg
@b = global %struct.B zeroinitializer, align 8, !dbg !0
-declare void @_ZN1BC2Ev(%struct.B*) unnamed_addr
+declare void @_ZN1BC2Ev(ptr) unnamed_addr
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
; CHECK: define
; Function Attrs: inlinehint nounwind ssp uwtable
-define linkonce_odr void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #1 align 2 !dbg !25 {
+define linkonce_odr void @_ZN1BC1Ev(ptr %this) unnamed_addr #1 align 2 !dbg !25 {
entry:
- %this.addr = alloca %struct.B*, align 8
- store %struct.B* %this, %struct.B** %this.addr, align 8
+ %this.addr = alloca ptr, align 8
+ store ptr %this, ptr %this.addr, align 8
; CHECK-NOT: @llvm.dbg.declare
- call void @llvm.dbg.declare(metadata %struct.B** %this.addr, metadata !30, metadata !32), !dbg !33
- %this1 = load %struct.B*, %struct.B** %this.addr, align 8
- call void @_ZN1BC2Ev(%struct.B* %this1) #2, !dbg !34
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !30, metadata !32), !dbg !33
+ %this1 = load ptr, ptr %this.addr, align 8
+ call void @_ZN1BC2Ev(ptr %this1) #2, !dbg !34
ret void, !dbg !34
- ; CHECK: call void @_ZN1BC2Ev(%struct.B* %this1){{.*}} !dbg !
+ ; CHECK: call void @_ZN1BC2Ev(ptr %this1){{.*}} !dbg !
}
attributes #0 = { nounwind readnone }
diff --git a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll
index ceb18addace4e..02d96764a8b73 100644
--- a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll
+++ b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll
@@ -7,17 +7,16 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
target triple = "x86_64-apple-macosx11.0.0"
; Function Attrs: noinline optnone ssp uwtable mustprogress
-define dso_local i32* @_Z3getv() #0 !dbg !8 {
+define dso_local ptr @_Z3getv() #0 !dbg !8 {
entry:
; CHECK-LABEL: entry:
; CHECK-NOT: !heapallocsite
- %call = call noalias nonnull i8* @_Znam(i64 1024) #2, !dbg !14, !heapallocsite !13
- %0 = bitcast i8* %call to i32*, !dbg !14
- ret i32* %0, !dbg !15
+ %call = call noalias nonnull ptr @_Znam(i64 1024) #2, !dbg !14, !heapallocsite !13
+ ret ptr %call, !dbg !15
}
; Function Attrs: nobuiltin allocsize(0)
-declare nonnull i8* @_Znam(i64) #1
+declare nonnull ptr @_Znam(i64) #1
attributes #0 = { noinline optnone ssp uwtable mustprogress }
attributes #1 = { nobuiltin allocsize(0) "frame-pointer"="all" }
diff --git a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll
index c2642c312ccdc..fa687a4730a39 100644
--- a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll
+++ b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-localvars.ll
@@ -4,9 +4,9 @@ define void @f() !dbg !4 {
entry:
%i = alloca i32, align 4
; CHECK-NOT: llvm.dbg.{{addr|declare|value}}
- call void @llvm.dbg.declare(metadata i32* %i, metadata !11, metadata !13), !dbg !14
- call void @llvm.dbg.addr(metadata i32* %i, metadata !16, metadata !13), !dbg !14
- store i32 42, i32* %i, align 4, !dbg !14
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !11, metadata !13), !dbg !14
+ call void @llvm.dbg.addr(metadata ptr %i, metadata !16, metadata !13), !dbg !14
+ store i32 42, ptr %i, align 4, !dbg !14
call void @llvm.dbg.value(metadata i32 0, metadata !16, metadata !13), !dbg !15
ret void, !dbg !15
}
diff --git a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-loops.ll b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-loops.ll
index 7144f9cb96af6..5dc4b1d5dd2de 100644
--- a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-loops.ll
+++ b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-loops.ll
@@ -8,15 +8,15 @@ source_filename = "/tmp/loop.c"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
-define void @f(i32* %i) local_unnamed_addr #0 !dbg !7 {
+define void @f(ptr %i) local_unnamed_addr #0 !dbg !7 {
entry:
- tail call void @llvm.dbg.value(metadata i32* %i, metadata !14, metadata !15), !dbg !16
+ tail call void @llvm.dbg.value(metadata ptr %i, metadata !14, metadata !15), !dbg !16
br label %while.cond, !dbg !17
while.cond: ; preds = %while.cond, %entry
- %0 = load volatile i32, i32* %i, align 4, !dbg !18, !tbaa !19
+ %0 = load volatile i32, ptr %i, align 4, !dbg !18, !tbaa !19
%dec = add nsw i32 %0, -1, !dbg !18
- store volatile i32 %dec, i32* %i, align 4, !dbg !18, !tbaa !19
+ store volatile i32 %dec, ptr %i, align 4, !dbg !18, !tbaa !19
%tobool = icmp eq i32 %dec, 0, !dbg !17
; CHECK: !llvm.loop ![[LOOP:[0-9]+]]
br i1 %tobool, label %while.end, label %while.cond, !dbg !17, !llvm.loop !23
diff --git a/llvm/test/Transforms/Util/trivial-auto-var-init-call.ll b/llvm/test/Transforms/Util/trivial-auto-var-init-call.ll
index 1097a751af9df..93c5564b94c70 100644
--- a/llvm/test/Transforms/Util/trivial-auto-var-init-call.ll
+++ b/llvm/test/Transforms/Util/trivial-auto-var-init-call.ll
@@ -2,7 +2,7 @@
; RUN: cat %t.opt.yaml | FileCheck -check-prefix=YAML %s
; Emit remarks for memcpy, memmove, memset, bzero.
-define void @known_call(i8* %src, i8* %dst, i64 %size) {
+define void @known_call(ptr %src, ptr %dst, i64 %size) {
; CHECK: Call to memset inserted by -ftrivial-auto-var-init.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -23,7 +23,7 @@ define void @known_call(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memset.p0i8.i64(i8* %dst, i8 0, i64 %size, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 %size, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -44,7 +44,7 @@ define void @known_call(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %size, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %size, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -65,7 +65,7 @@ define void @known_call(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %size, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 %size, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -77,7 +77,7 @@ define void @known_call(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - Callee: bzero
; YAML-NEXT: - String: ' inserted by -ftrivial-auto-var-init.'
; YAML-NEXT: ...
- call void @bzero(i8* %dst, i64 %size), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %dst, i64 %size), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -92,12 +92,12 @@ define void @known_call(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreSize: '32'
; YAML-NEXT: - String: ' bytes.'
; YAML-NEXT: ...
- call i8* @memset(i8* %dst, i32 0, i64 32), !annotation !0, !dbg !DILocation(scope: !4)
+ call ptr @memset(ptr %dst, i32 0, i64 32), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes.
-define void @known_call_with_size(i8* %src, i8* %dst) {
+define void @known_call_with_size(ptr %src, ptr %dst) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 32 bytes.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -121,7 +121,7 @@ define void @known_call_with_size(i8* %src, i8* %dst) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memset.p0i8.i64(i8* %dst, i8 0, i64 32, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 32, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 32 bytes.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -145,7 +145,7 @@ define void @known_call_with_size(i8* %src, i8* %dst) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 32, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 32, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 32 bytes.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -169,7 +169,7 @@ define void @known_call_with_size(i8* %src, i8* %dst) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 32, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 32, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 32 bytes.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -184,13 +184,13 @@ define void @known_call_with_size(i8* %src, i8* %dst) {
; YAML-NEXT: - StoreSize: '32'
; YAML-NEXT: - String: ' bytes.'
; YAML-NEXT: ...
- call void @bzero(i8* %dst, i64 32), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %dst, i64 32), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset marked volatile.
-define void @known_call_volatile(i8* %src, i8* %dst, i64 %size) {
+define void @known_call_volatile(ptr %src, ptr %dst, i64 %size) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Volatile: true.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -211,7 +211,7 @@ define void @known_call_volatile(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memset.p0i8.i64(i8* %dst, i8 0, i64 %size, i1 true), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 %size, i1 true), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Volatile: true.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -232,7 +232,7 @@ define void @known_call_volatile(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %size, i1 true), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %size, i1 true), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Volatile: true.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -253,12 +253,12 @@ define void @known_call_volatile(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %size, i1 true), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 %size, i1 true), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset marked atomic.
-define void @known_call_atomic(i8* %src, i8* %dst, i64 %size) {
+define void @known_call_atomic(ptr %src, ptr %dst, i64 %size) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Atomic: true.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -279,7 +279,7 @@ define void @known_call_atomic(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreVolatile: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 1 %dst, i8 0, i64 %size, i32 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memset.element.unordered.atomic.p0.i64(ptr align 1 %dst, i8 0, i64 %size, i32 1), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Atomic: true.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -300,7 +300,7 @@ define void @known_call_atomic(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreVolatile: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %dst, i8* align 1 %src, i64 %size, i32 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr align 1 %dst, ptr align 1 %src, i64 %size, i32 1), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Atomic: true.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
@@ -321,13 +321,13 @@ define void @known_call_atomic(i8* %src, i8* %dst, i64 %size) {
; YAML-NEXT: - StoreVolatile: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %dst, i8* align 1 %src, i64 %size, i32 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.element.unordered.atomic.p0.p0.i64(ptr align 1 %dst, ptr align 1 %src, i64 %size, i32 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes to
; an alloca.
-define void @known_call_with_size_alloca(i8* %src) {
+define void @known_call_with_size_alloca(ptr %src) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (1 bytes).
; YAML-LABEL: --- !Missed
@@ -359,7 +359,7 @@ define void @known_call_with_size_alloca(i8* %src) {
; YAML-NEXT: - String: .
; YAML-NEXT: ...
%dst = alloca i8
- call void @llvm.memset.p0i8.i64(i8* %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (1 bytes).
; YAML-LABEL: --- !Missed
@@ -390,7 +390,7 @@ define void @known_call_with_size_alloca(i8* %src) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (1 bytes).
; YAML-LABEL: --- !Missed
@@ -421,7 +421,7 @@ define void @known_call_with_size_alloca(i8* %src) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (1 bytes).
; YAML-LABEL: --- !Missed
@@ -443,113 +443,110 @@ define void @known_call_with_size_alloca(i8* %src) {
; YAML-NEXT: - String: ' bytes)'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- call void @bzero(i8* %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes to
; an alloca through a GEP.
-define void @known_call_with_size_alloca_gep(i8* %src) {
+define void @known_call_with_size_alloca_gep(ptr %src) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (1 bytes).
%dst = alloca i8
- %gep = getelementptr i8, i8* %dst, i32 0
- call void @llvm.memset.p0i8.i64(i8* %gep, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (1 bytes).
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %gep, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (1 bytes).
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %gep, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (1 bytes).
- call void @bzero(i8* %gep, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes to
; an alloca through a GEP in an array.
-define void @known_call_with_size_alloca_gep_array(i8* %src) {
+define void @known_call_with_size_alloca_gep_array(ptr %src) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (2 bytes).
%dst = alloca [2 x i8]
- %gep = getelementptr [2 x i8], [2 x i8]* %dst, i64 0, i64 0
- call void @llvm.memset.p0i8.i64(i8* %gep, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (2 bytes).
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %gep, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (2 bytes).
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %gep, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (2 bytes).
- call void @bzero(i8* %gep, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes to
; an alloca through a bitcast.
-define void @known_call_with_size_alloca_bitcast(i8* %src) {
+define void @known_call_with_size_alloca_bitcast(ptr %src) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (2 bytes).
%dst = alloca [2 x i8]
- %bc = bitcast [2 x i8]* %dst to i8*
- call void @llvm.memset.p0i8.i64(i8* %bc, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (2 bytes).
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %bc, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (2 bytes).
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %bc, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst (2 bytes).
- call void @bzero(i8* %bc, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes to an alloca that has a DILocalVariable attached.
-define void @known_call_with_size_alloca_di(i8* %src) {
+define void @known_call_with_size_alloca_di(ptr %src) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: destination (1 bytes).
%dst = alloca i8
- call void @llvm.dbg.declare(metadata i8* %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
- call void @llvm.memset.p0i8.i64(i8* %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: destination (1 bytes).
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: destination (1 bytes).
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: destination (1 bytes).
- call void @bzero(i8* %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes to
; an alloca that has more than one DILocalVariable attached.
-define void @known_call_with_size_alloca_di_multiple(i8* %src) {
+define void @known_call_with_size_alloca_di_multiple(ptr %src) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: destination (1 bytes).
%dst = alloca i8
- call void @llvm.dbg.declare(metadata i8* %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
- call void @llvm.memset.p0i8.i64(i8* %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ call void @llvm.memset.p0.i64(ptr %dst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: destination (1 bytes).
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: destination (1 bytes).
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: destination (1 bytes).
- call void @bzero(i8* %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %dst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes to
; a PHI node that can be two
diff erent allocas.
-define void @known_call_with_size_alloca_phi(i8* %src) {
+define void @known_call_with_size_alloca_phi(ptr %src) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst2 (1 bytes), dst (1 bytes).
entry:
@@ -562,31 +559,31 @@ l0:
l1:
br label %l2
l2:
- %phidst = phi i8* [ %dst, %l0 ], [ %dst2, %l1 ]
- call void @llvm.memset.p0i8.i64(i8* %phidst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ %phidst = phi ptr [ %dst, %l0 ], [ %dst2, %l1 ]
+ call void @llvm.memset.p0.i64(ptr %phidst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst2 (1 bytes), dst (1 bytes).
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %phidst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %phidst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst2 (1 bytes), dst (1 bytes).
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %phidst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %phidst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst2 (1 bytes), dst (1 bytes).
- call void @bzero(i8* %phidst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %phidst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit remarks for memcpy, memmove, memset, bzero with known constant sizes to
; a PHI node that can be two
diff erent allocas, where one of it has multiple
; DILocalVariable.
-define void @known_call_with_size_alloca_phi_di_multiple(i8* %src) {
+define void @known_call_with_size_alloca_phi_di_multiple(ptr %src) {
; CHECK-NEXT: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst2 (1 bytes), destination2 (1 bytes), destination (1 bytes).
entry:
%dst = alloca i8
%dst2 = alloca i8
- call void @llvm.dbg.declare(metadata i8* %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
- call void @llvm.dbg.declare(metadata i8* %dst, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !4)
%cmp = icmp eq i32 undef, undef
br i1 %cmp, label %l0, label %l1
l0:
@@ -594,31 +591,31 @@ l0:
l1:
br label %l2
l2:
- %phidst = phi i8* [ %dst, %l0 ], [ %dst2, %l1 ]
- call void @llvm.memset.p0i8.i64(i8* %phidst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ %phidst = phi ptr [ %dst, %l0 ], [ %dst2, %l1 ]
+ call void @llvm.memset.p0.i64(ptr %phidst, i8 0, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memcpy inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst2 (1 bytes), destination2 (1 bytes), destination (1 bytes).
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %phidst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memcpy.p0.p0.i64(ptr %phidst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to memmove inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst2 (1 bytes), destination2 (1 bytes), destination (1 bytes).
- call void @llvm.memmove.p0i8.p0i8.i64(i8* %phidst, i8* %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.memmove.p0.p0.i64(ptr %phidst, ptr %src, i64 1, i1 false), !annotation !0, !dbg !DILocation(scope: !4)
; CHECK-NEXT: Call to bzero inserted by -ftrivial-auto-var-init. Memory operation size: 1 bytes.
; CHECK-NEXT: Variables: dst2 (1 bytes), destination2 (1 bytes), destination (1 bytes).
- call void @bzero(i8* %phidst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
+ call void @bzero(ptr %phidst, i64 1), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone speculatable willreturn
-declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) argmemonly nounwind willreturn writeonly
-declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1 immarg) argmemonly nounwind willreturn
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) argmemonly nounwind willreturn
+declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) argmemonly nounwind willreturn writeonly
+declare void @llvm.memmove.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1 immarg) argmemonly nounwind willreturn
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) argmemonly nounwind willreturn
-declare void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* nocapture writeonly, i8, i64, i32 immarg) argmemonly nounwind willreturn writeonly
-declare void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32 immarg) argmemonly nounwind willreturn
-declare void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32 immarg) argmemonly nounwind willreturn
+declare void @llvm.memset.element.unordered.atomic.p0.i64(ptr nocapture writeonly, i8, i64, i32 immarg) argmemonly nounwind willreturn writeonly
+declare void @llvm.memcpy.element.unordered.atomic.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i32 immarg) argmemonly nounwind willreturn
+declare void @llvm.memmove.element.unordered.atomic.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i32 immarg) argmemonly nounwind willreturn
-declare void @bzero(i8* nocapture, i64) nofree nounwind
-declare i8* @memset(i8*, i32, i64)
+declare void @bzero(ptr nocapture, i64) nofree nounwind
+declare ptr @memset(ptr, i32, i64)
!llvm.module.flags = !{!1}
!0 = !{ !"auto-init" }
diff --git a/llvm/test/Transforms/Util/trivial-auto-var-init-store.ll b/llvm/test/Transforms/Util/trivial-auto-var-init-store.ll
index abdaba5e2e67a..595130bd6c428 100644
--- a/llvm/test/Transforms/Util/trivial-auto-var-init-store.ll
+++ b/llvm/test/Transforms/Util/trivial-auto-var-init-store.ll
@@ -2,7 +2,7 @@
; RUN: cat %t.opt.yaml | FileCheck -check-prefix=YAML %s
; Emit a remark that reports a store.
-define void @store(i32* %dst) {
+define void @store(ptr %dst) {
; CHECK: Store inserted by -ftrivial-auto-var-init.
; CHECK-NEXT: Store size: 4 bytes.
; YAML-LABEL: --- !Missed
@@ -22,12 +22,12 @@ define void @store(i32* %dst) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- store i32 0, i32* %dst, !annotation !0, !dbg !DILocation(scope: !4)
+ store i32 0, ptr %dst, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit a remark that reports a volatile store.
-define void @volatile_store(i32* %dst) {
+define void @volatile_store(ptr %dst) {
; CHECK-NEXT: Store inserted by -ftrivial-auto-var-init.
; CHECK-NEXT: Store size: 4 bytes. Volatile: true.
; YAML-LABEL: --- !Missed
@@ -47,12 +47,12 @@ define void @volatile_store(i32* %dst) {
; YAML-NEXT: - StoreAtomic: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- store volatile i32 0, i32* %dst, !annotation !0, !dbg !DILocation(scope: !4)
+ store volatile i32 0, ptr %dst, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
; Emit a remark that reports an atomic store.
-define void @atomic_store(i32* %dst) {
+define void @atomic_store(ptr %dst) {
; CHECK-NEXT: Store inserted by -ftrivial-auto-var-init.
; CHECK-NEXT: Store size: 4 bytes. Atomic: true.
; YAML-LABEL: --- !Missed
@@ -72,7 +72,7 @@ define void @atomic_store(i32* %dst) {
; YAML-NEXT: - StoreVolatile: 'false'
; YAML-NEXT: - String: .
; YAML-NEXT: ...
- store atomic i32 0, i32* %dst unordered, align 4, !annotation !0, !dbg !DILocation(scope: !4)
+ store atomic i32 0, ptr %dst unordered, align 4, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
@@ -105,7 +105,7 @@ define void @store_alloca() {
; YAML-NEXT: - String: .
; YAML-NEXT: ...
%dst = alloca i32
- store i32 0, i32* %dst, !annotation !0, !dbg !DILocation(scope: !4)
+ store i32 0, ptr %dst, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
@@ -115,8 +115,7 @@ define void @store_alloca_gep() {
; CHECK-NEXT: Store size: 4 bytes.
; CHECK-NEXT: Variables: dst (4 bytes).
%dst = alloca i32
- %gep = getelementptr i32, i32* %dst, i32 0
- store i32 0, i32* %gep, !annotation !0, !dbg !DILocation(scope: !4)
+ store i32 0, ptr %dst, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
@@ -126,10 +125,9 @@ define void @store_alloca_gep_inttoptr() {
; CHECK-NEXT: Store size: 4 bytes.
; CHECK-NEXT: Variables: dst (4 bytes).
%dst = alloca i32
- %gep = getelementptr i32, i32* %dst, i32 0
- %p2i = ptrtoint i32* %gep to i64
- %i2p = inttoptr i64 %p2i to i32*
- store i32 0, i32* %i2p, !annotation !0, !dbg !DILocation(scope: !4)
+ %p2i = ptrtoint ptr %dst to i64
+ %i2p = inttoptr i64 %p2i to ptr
+ store i32 0, ptr %i2p, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
@@ -139,8 +137,7 @@ define void @store_alloca_gep_array() {
; CHECK-NEXT: Store size: 4 bytes.
; CHECK-NEXT: Variables: dst (8 bytes).
%dst = alloca [2 x i32]
- %gep = getelementptr [2 x i32], [2 x i32]* %dst, i64 0, i64 0
- store i32 0, i32* %gep, !annotation !0, !dbg !DILocation(scope: !4)
+ store i32 0, ptr %dst, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
@@ -150,8 +147,7 @@ define void @store_alloca_bitcast() {
; CHECK-NEXT: Store size: 4 bytes.
; CHECK-NEXT: Variables: dst (4 bytes).
%dst = alloca [2 x i16]
- %bc = bitcast [2 x i16]* %dst to i32*
- store i32 0, i32* %bc, !annotation !0, !dbg !DILocation(scope: !4)
+ store i32 0, ptr %dst, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
@@ -162,8 +158,8 @@ define void @store_alloca_di() {
; CHECK-NEXT: Store size: 4 bytes.
; CHECK-NEXT: Variables: destination (4 bytes).
%dst = alloca i32
- store i32 0, i32* %dst, !annotation !0, !dbg !DILocation(scope: !4)
- call void @llvm.dbg.declare(metadata i32* %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ store i32 0, ptr %dst, !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
ret void
}
@@ -174,9 +170,9 @@ define void @store_alloca_di_multiple() {
; CHECK-NEXT: Store size: 4 bytes.
; CHECK-NEXT: Variables: destination2 (4 bytes), destination (4 bytes).
%dst = alloca i32
- store i32 0, i32* %dst, !annotation !0, !dbg !DILocation(scope: !4)
- call void @llvm.dbg.declare(metadata i32* %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
- call void @llvm.dbg.declare(metadata i32* %dst, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ store i32 0, ptr %dst, !annotation !0, !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !4)
ret void
}
@@ -196,8 +192,8 @@ l0:
l1:
br label %l2
l2:
- %phidst = phi i32* [ %dst, %l0 ], [ %dst2, %l1 ]
- store i32 0, i32* %phidst, !annotation !0, !dbg !DILocation(scope: !4)
+ %phidst = phi ptr [ %dst, %l0 ], [ %dst2, %l1 ]
+ store i32 0, ptr %phidst, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
@@ -210,8 +206,8 @@ define void @store_alloca_phi_di_multiple() {
entry:
%dst = alloca i32
%dst2 = alloca i32
- call void @llvm.dbg.declare(metadata i32* %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
- call void @llvm.dbg.declare(metadata i32* %dst, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !6, metadata !DIExpression()), !dbg !DILocation(scope: !4)
+ call void @llvm.dbg.declare(metadata ptr %dst, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !4)
%cmp = icmp eq i32 undef, undef
br i1 %cmp, label %l0, label %l1
l0:
@@ -219,8 +215,8 @@ l0:
l1:
br label %l2
l2:
- %phidst = phi i32* [ %dst, %l0 ], [ %dst2, %l1 ]
- store i32 0, i32* %phidst, !annotation !0, !dbg !DILocation(scope: !4)
+ %phidst = phi ptr [ %dst, %l0 ], [ %dst2, %l1 ]
+ store i32 0, ptr %phidst, !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
diff --git a/llvm/test/Transforms/Util/trivial-auto-var-init-unknown.ll b/llvm/test/Transforms/Util/trivial-auto-var-init-unknown.ll
index fa3c520aa1928..dd380fa95a4d5 100644
--- a/llvm/test/Transforms/Util/trivial-auto-var-init-unknown.ll
+++ b/llvm/test/Transforms/Util/trivial-auto-var-init-unknown.ll
@@ -22,18 +22,18 @@ define void @unknown() {
}
; Emit a remark that reports an intrinsic call to an unknown intrinsic.
-define void @unknown_intrinsic(i32* %dst) {
+define void @unknown_intrinsic(ptr %dst) {
; CHECK-NEXT: Initialization inserted by -ftrivial-auto-var-init.
; YAML-LABEL: --- !Missed
; YAML-NEXT: Pass: annotation-remarks
; YAML-NEXT: Name: AutoInitUnknownInstruction
; YAML-NEXT: DebugLoc:
; YAML-NEXT: Function: unknown_intrinsic
- call i8* @llvm.returnaddress(i32 0), !annotation !0, !dbg !DILocation(scope: !4)
+ call ptr @llvm.returnaddress(i32 0), !annotation !0, !dbg !DILocation(scope: !4)
ret void
}
-declare i8* @llvm.returnaddress(i32) nounwind readnone
+declare ptr @llvm.returnaddress(i32) nounwind readnone
!llvm.module.flags = !{!1}
!0 = !{ !"auto-init" }
More information about the llvm-commits
mailing list