[llvm] 631432a - IRCE: Convert tests to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 06:47:57 PST 2022
Author: Matt Arsenault
Date: 2022-11-28T09:35:16-05:00
New Revision: 631432a3f5364021c9a494491ff01fe17f2d9a4e
URL: https://github.com/llvm/llvm-project/commit/631432a3f5364021c9a494491ff01fe17f2d9a4e
DIFF: https://github.com/llvm/llvm-project/commit/631432a3f5364021c9a494491ff01fe17f2d9a4e.diff
LOG: IRCE: Convert tests to opaque pointers
Added:
Modified:
llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll
llvm/test/Transforms/IRCE/bad_expander.ll
llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll
llvm/test/Transforms/IRCE/clamp.ll
llvm/test/Transforms/IRCE/conjunctive-checks.ll
llvm/test/Transforms/IRCE/correct-loop-info.ll
llvm/test/Transforms/IRCE/decrementing-loop.ll
llvm/test/Transforms/IRCE/empty_ranges.ll
llvm/test/Transforms/IRCE/eq_ne.ll
llvm/test/Transforms/IRCE/low-becount.ll
llvm/test/Transforms/IRCE/low-iterations.ll
llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll
llvm/test/Transforms/IRCE/non-loop-invariant-rhs-instr.ll
llvm/test/Transforms/IRCE/non_known_positive_end.ll
llvm/test/Transforms/IRCE/not-likely-taken.ll
llvm/test/Transforms/IRCE/only-lower-check.ll
llvm/test/Transforms/IRCE/only-upper-check.ll
llvm/test/Transforms/IRCE/pr40539.ll
llvm/test/Transforms/IRCE/pr57335.ll
llvm/test/Transforms/IRCE/pre_post_loops.ll
llvm/test/Transforms/IRCE/range_intersect_miscompile.ll
llvm/test/Transforms/IRCE/ranges_of_different_types.ll
llvm/test/Transforms/IRCE/rc-negative-bound.ll
llvm/test/Transforms/IRCE/single-access-no-preloop.ll
llvm/test/Transforms/IRCE/single-access-with-preloop.ll
llvm/test/Transforms/IRCE/skip-profitability-checks.ll
llvm/test/Transforms/IRCE/stride_more_than_1.ll
llvm/test/Transforms/IRCE/unhandled.ll
llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll
llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll
llvm/test/Transforms/IRCE/variable-loop-bounds.ll
llvm/test/Transforms/IRCE/wide_indvar.ll
llvm/test/Transforms/IRCE/with-parent-loops.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll b/llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll
index a63f97fe109da..61bb6805e4b49 100644
--- a/llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll
+++ b/llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll
@@ -6,13 +6,13 @@
; generates a post loop, which should have metadata !llvm.loop !2
; Function Attrs: alwaysinline
-define void @inner_loop(i32* %arr, i32* %a_len_ptr, i32 %n) #0 {
+define void @inner_loop(ptr %arr, ptr %a_len_ptr, i32 %n) #0 {
; CHECK-LABEL: inner_loop(
; CHECK-LABEL: in.bounds.postloop
; CHECK: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit.loopexit, !llvm.loop !2, !irce.loop.clone !7
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -23,8 +23,8 @@ loop: ; preds = %in.bounds, %entry
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds: ; preds = %loop
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -36,14 +36,14 @@ exit: ; preds = %in.bounds, %entry
}
; add loop metadata for pre and post loops
-define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %offset) {
+define void @single_access_with_preloop(ptr %arr, ptr %a_len_ptr, i32 %n, i32 %offset) {
; CHECK-LABEL: @single_access_with_preloop(
; CHECK-LABEL: in.bounds.preloop
; CHECK: br i1 [[COND:%[^ ]+]], label %loop.preloop, label %preloop.exit.selector, !llvm.loop !8, !irce.loop.clone !7
; CHECK-LABEL: in.bounds.postloop
; CHECK: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit.loopexit, !llvm.loop !9, !irce.loop.clone !7
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -57,8 +57,8 @@ define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %array.idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %array.idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/bad_expander.ll b/llvm/test/Transforms/IRCE/bad_expander.ll
index a3d6a054ef054..9c631760bceb3 100644
--- a/llvm/test/Transforms/IRCE/bad_expander.ll
+++ b/llvm/test/Transforms/IRCE/bad_expander.ll
@@ -47,7 +47,7 @@ guarded:
; safe to expand it to preheader: if we exit by maybe_exit condition, it is
; unsafe to execute it there.
-define void @test_02(i64* %p1, i64* %p2, i1 %maybe_exit) {
+define void @test_02(ptr %p1, ptr %p2, i1 %maybe_exit) {
; CHECK-LABEL: test_02
; CHECK-NOT: preloop
@@ -57,8 +57,8 @@ define void @test_02(i64* %p1, i64* %p2, i1 %maybe_exit) {
entry:
- %num = load i64, i64* %p1, align 4, !range !0
- %denom = load i64, i64* %p2, align 4, !range !0
+ %num = load i64, ptr %p1, align 4, !range !0
+ %denom = load i64, ptr %p2, align 4, !range !0
br label %loop
exit: ; preds = %guarded, %loop
@@ -75,19 +75,19 @@ range_check:
br i1 %rc, label %guarded, label %exit
guarded:
- %gep = getelementptr i64, i64* %p1, i64 %iv.next
- %loaded = load i64, i64* %gep, align 4
+ %gep = getelementptr i64, ptr %p1, i64 %iv.next
+ %loaded = load i64, ptr %gep, align 4
%tmp7 = icmp slt i64 %iv.next, 1000
br i1 %tmp7, label %loop, label %exit
}
-define void @test_03(i64* %p1, i64* %p2, i1 %maybe_exit) {
+define void @test_03(ptr %p1, ptr %p2, i1 %maybe_exit) {
; Show that IRCE would hit test_02 if the division was safe (denom not zero).
; CHECK-LABEL: test_03
; CHECK: entry:
-; CHECK-NEXT: %num = load i64, i64* %p1, align 4
+; CHECK-NEXT: %num = load i64, ptr %p1, align 4
; CHECK-NEXT: [[DIV:%[^ ]+]] = udiv i64 %num, 13
; CHECK-NEXT: [[DIV_MINUS_1:%[^ ]+]] = add nsw i64 [[DIV]], -1
; CHECK-NEXT: %exit.mainloop.at = call i64 @llvm.smax.i64(i64 [[DIV_MINUS_1]], i64 0)
@@ -101,15 +101,15 @@ define void @test_03(i64* %p1, i64* %p2, i1 %maybe_exit) {
; CHECK-NEXT: %or.cond = select i1 %maybe_exit, i1 true, i1 false
; CHECK-NEXT: br i1 %or.cond, label %guarded, label %exit.loopexit1
; CHECK: guarded:
-; CHECK-NEXT: %gep = getelementptr i64, i64* %p1, i64 %iv.next
-; CHECK-NEXT: %loaded = load i64, i64* %gep, align 4
+; CHECK-NEXT: %gep = getelementptr i64, ptr %p1, i64 %iv.next
+; CHECK-NEXT: %loaded = load i64, ptr %gep, align 4
; CHECK-NEXT: %tmp7 = icmp slt i64 %iv.next, 1000
; CHECK-NEXT: [[EXIT_MAIN_LOOP:%[^ ]+]] = icmp slt i64 %iv.next, %exit.mainloop.at
; CHECK-NEXT: br i1 [[EXIT_MAIN_LOOP]], label %loop, label %main.exit.selector
; CHECK: postloop
entry:
- %num = load i64, i64* %p1, align 4, !range !0
+ %num = load i64, ptr %p1, align 4, !range !0
br label %loop
exit: ; preds = %guarded, %loop
@@ -126,8 +126,8 @@ range_check:
br i1 %rc, label %guarded, label %exit
guarded:
- %gep = getelementptr i64, i64* %p1, i64 %iv.next
- %loaded = load i64, i64* %gep, align 4
+ %gep = getelementptr i64, ptr %p1, i64 %iv.next
+ %loaded = load i64, ptr %gep, align 4
%tmp7 = icmp slt i64 %iv.next, 1000
br i1 %tmp7, label %loop, label %exit
}
diff --git a/llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll b/llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll
index 46a83de97e432..3e19917823c17 100644
--- a/llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll
+++ b/llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll
@@ -3,7 +3,7 @@
; CHECK-NOT: constrained loop
-define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @single_access_no_preloop_no_offset(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -11,13 +11,13 @@ define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32
loop:
%idx = phi i32 [ 0, %entry ] , [ %idx.next, %in.bounds ]
%idx.next = add i32 %idx, 1
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%abc = icmp slt i32 %idx, %len
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/clamp.ll b/llvm/test/Transforms/IRCE/clamp.ll
index 6c1f9c2cff9d9..a1b44c2d851c7 100644
--- a/llvm/test/Transforms/IRCE/clamp.ll
+++ b/llvm/test/Transforms/IRCE/clamp.ll
@@ -13,9 +13,9 @@ define void @test_01() {
entry:
%indvars.iv.next467 = add nuw nsw i64 2, 1
- %length.i167 = load i32, i32 addrspace(1)* undef, align 8
+ %length.i167 = load i32, ptr addrspace(1) undef, align 8
%tmp21 = zext i32 %length.i167 to i64
- %tmp34 = load atomic i32, i32 addrspace(1)* undef unordered, align 4
+ %tmp34 = load atomic i32, ptr addrspace(1) undef unordered, align 4
%tmp35 = add i32 %tmp34, -9581
%tmp36 = icmp ugt i32 %length.i167, 1
br i1 %tmp36, label %preheader, label %exit
@@ -25,15 +25,13 @@ exit: ; preds = %in_bounds, %loop, %not
preheader: ; preds = %entry
; CHECK: preheader:
-; CHECK-NEXT: %length_gep.i146 = getelementptr inbounds i8, i8 addrspace(1)* undef, i64 8
-; CHECK-NEXT: %length_gep_typed.i147 = bitcast i8 addrspace(1)* undef to i32 addrspace(1)*
+; CHECK-NEXT: %length_gep.i146 = getelementptr inbounds i8, ptr addrspace(1) undef, i64 8
; CHECK-NEXT: %tmp43 = icmp ult i64 %indvars.iv.next467, %tmp21
; CHECK-NEXT: %exit.mainloop.at = call i64 @llvm.umax.i64(i64 %tmp21, i64 1)
; CHECK-NEXT: [[C1:%[^ ]+]] = icmp ult i64 1, %exit.mainloop.at
; CHECK-NEXT: br i1 [[C1]], label %loop.preheader, label %main.pseudo.exit
- %length_gep.i146 = getelementptr inbounds i8, i8 addrspace(1)* undef, i64 8
- %length_gep_typed.i147 = bitcast i8 addrspace(1)* undef to i32 addrspace(1)*
+ %length_gep.i146 = getelementptr inbounds i8, ptr addrspace(1) undef, i64 8
%tmp43 = icmp ult i64 %indvars.iv.next467, %tmp21
br label %loop
@@ -53,7 +51,7 @@ not_zero: ; preds = %in_bounds
loop: ; preds = %not_zero, %preheader
%tmp62 = phi i32 [ 1, %preheader ], [ %tmp55, %not_zero ]
%indvars.iv750 = phi i64 [ 1, %preheader ], [ %indvars.iv.next, %not_zero ]
- %length.i148 = load i32, i32 addrspace(1)* %length_gep_typed.i147, align 8
+ %length.i148 = load i32, ptr addrspace(1) undef, align 8
%tmp68 = zext i32 %length.i148 to i64
%tmp97 = icmp ult i64 2, %tmp68
%or.cond = and i1 %tmp43, %tmp97
diff --git a/llvm/test/Transforms/IRCE/conjunctive-checks.ll b/llvm/test/Transforms/IRCE/conjunctive-checks.ll
index c589d64ca40e6..2cb250e892e32 100644
--- a/llvm/test/Transforms/IRCE/conjunctive-checks.ll
+++ b/llvm/test/Transforms/IRCE/conjunctive-checks.ll
@@ -2,10 +2,10 @@
; RUN: opt -S -verify-loop-info -irce < %s | FileCheck %s
; RUN: opt -S -verify-loop-info -passes='require<branch-prob>,irce' < %s | FileCheck %s
-define void @f_0(i32 *%arr, i32 *%a_len_ptr, i32 %n, i1* %cond_buf) {
+define void @f_0(ptr %arr, ptr %a_len_ptr, i32 %n, ptr %cond_buf) {
; CHECK-LABEL: @f_0(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0:![0-9]+]]
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
; CHECK-NEXT: br i1 [[FIRST_ITR_CHECK]], label [[LOOP_PREHEADER:%.*]], label [[EXIT:%.*]]
; CHECK: loop.preheader:
@@ -21,12 +21,12 @@ define void @f_0(i32 *%arr, i32 *%a_len_ptr, i32 %n, i1* %cond_buf) {
; CHECK-NEXT: [[IDX_NEXT]] = add i32 [[IDX]], 1
; CHECK-NEXT: [[IDX_FOR_ABC:%.*]] = add i32 [[IDX]], 4
; CHECK-NEXT: [[ABC_ACTUAL:%.*]] = icmp slt i32 [[IDX_FOR_ABC]], [[LEN]]
-; CHECK-NEXT: [[COND:%.*]] = load volatile i1, i1* [[COND_BUF:%.*]], align 1
+; CHECK-NEXT: [[COND:%.*]] = load volatile i1, ptr [[COND_BUF:%.*]], align 1
; CHECK-NEXT: [[ABC:%.*]] = and i1 [[COND]], true
; CHECK-NEXT: br i1 [[ABC]], label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT2:%.*]], !prof [[PROF1:![0-9]+]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX_FOR_ABC]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX_FOR_ABC]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: [[TMP2:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP2]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -57,17 +57,17 @@ define void @f_0(i32 *%arr, i32 *%a_len_ptr, i32 %n, i1* %cond_buf) {
; CHECK-NEXT: [[IDX_NEXT_POSTLOOP]] = add i32 [[IDX_POSTLOOP]], 1
; CHECK-NEXT: [[IDX_FOR_ABC_POSTLOOP:%.*]] = add i32 [[IDX_POSTLOOP]], 4
; CHECK-NEXT: [[ABC_ACTUAL_POSTLOOP:%.*]] = icmp slt i32 [[IDX_FOR_ABC_POSTLOOP]], [[LEN]]
-; CHECK-NEXT: [[COND_POSTLOOP:%.*]] = load volatile i1, i1* [[COND_BUF]], align 1
+; CHECK-NEXT: [[COND_POSTLOOP:%.*]] = load volatile i1, ptr [[COND_BUF]], align 1
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = and i1 [[COND_POSTLOOP]], [[ABC_ACTUAL_POSTLOOP]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]], !prof [[PROF1]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_FOR_ABC_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_FOR_ABC_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], [[N]]
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP2:![0-9]+]], !irce.loop.clone !7
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -76,13 +76,13 @@ loop:
%idx.next = add i32 %idx, 1
%idx.for.abc = add i32 %idx, 4
%abc.actual = icmp slt i32 %idx.for.abc, %len
- %cond = load volatile i1, i1* %cond_buf
+ %cond = load volatile i1, ptr %cond_buf
%abc = and i1 %cond, %abc.actual
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx.for.abc
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx.for.abc
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -96,8 +96,8 @@ exit:
define void @f_1(
; CHECK-LABEL: @f_1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN_A:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
-; CHECK-NEXT: [[LEN_B:%.*]] = load i32, i32* [[B_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN_A:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN_B:%.*]] = load i32, ptr [[B_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
; CHECK-NEXT: br i1 [[FIRST_ITR_CHECK]], label [[LOOP_PREHEADER:%.*]], label [[EXIT:%.*]]
; CHECK: loop.preheader:
@@ -116,10 +116,10 @@ define void @f_1(
; CHECK-NEXT: [[ABC:%.*]] = and i1 true, true
; CHECK-NEXT: br i1 [[ABC]], label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT3:%.*]], !prof [[PROF1]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR_A:%.*]] = getelementptr i32, i32* [[ARR_A:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_A]], align 4
-; CHECK-NEXT: [[ADDR_B:%.*]] = getelementptr i32, i32* [[ARR_B:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 -1, i32* [[ADDR_B]], align 4
+; CHECK-NEXT: [[ADDR_A:%.*]] = getelementptr i32, ptr [[ARR_A:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_A]], align 4
+; CHECK-NEXT: [[ADDR_B:%.*]] = getelementptr i32, ptr [[ARR_B:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 -1, ptr [[ADDR_B]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP1]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -153,19 +153,19 @@ define void @f_1(
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = and i1 [[ABC_A_POSTLOOP]], [[ABC_B_POSTLOOP]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]], !prof [[PROF1]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_A_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR_A]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_A_POSTLOOP]], align 4
-; CHECK-NEXT: [[ADDR_B_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR_B]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 -1, i32* [[ADDR_B_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_A_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR_A]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_A_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_B_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR_B]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 -1, ptr [[ADDR_B_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], [[N]]
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP8:![0-9]+]], !irce.loop.clone !7
;
- i32* %arr_a, i32* %a_len_ptr, i32* %arr_b, i32* %b_len_ptr, i32 %n) {
+ ptr %arr_a, ptr %a_len_ptr, ptr %arr_b, ptr %b_len_ptr, i32 %n) {
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
- %len.b = load i32, i32* %b_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
+ %len.b = load i32, ptr %b_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -178,10 +178,10 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr.a = getelementptr i32, i32* %arr_a, i32 %idx
- store i32 0, i32* %addr.a
- %addr.b = getelementptr i32, i32* %arr_b, i32 %idx
- store i32 -1, i32* %addr.b
+ %addr.a = getelementptr i32, ptr %arr_a, i32 %idx
+ store i32 0, ptr %addr.a
+ %addr.b = getelementptr i32, ptr %arr_b, i32 %idx
+ store i32 -1, ptr %addr.b
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/correct-loop-info.ll b/llvm/test/Transforms/IRCE/correct-loop-info.ll
index bc7275f6e747f..655b37a746d4d 100644
--- a/llvm/test/Transforms/IRCE/correct-loop-info.ll
+++ b/llvm/test/Transforms/IRCE/correct-loop-info.ll
@@ -10,7 +10,7 @@
; were incorrectly updating LI when the split loop is a subloop as in the case below.
source_filename = "correct-loop-info.ll"
-define void @baz() personality i32* ()* @ham {
+define void @baz() personality ptr @ham {
; CHECK-LABEL: @baz(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[EXIT_PRELOOP_AT:%.*]] = call i32 @llvm.smax.i32(i32 undef, i32 -1)
@@ -50,15 +50,15 @@ define void @baz() personality i32* ()* @ham {
; CHECK-NEXT: [[INDVAR_END1:%.*]] = phi i32 [ [[INDVAR_END]], [[MAINLOOP]] ], [ [[TMP6_LCSSA]], [[MAIN_EXIT_SELECTOR]] ]
; CHECK-NEXT: br label [[POSTLOOP:%.*]]
; CHECK: outer_exiting.loopexit:
-; CHECK-NEXT: [[LPAD_LOOPEXIT:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT: [[LPAD_LOOPEXIT:%.*]] = landingpad { ptr, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: br label [[OUTER_EXITING:%.*]]
; CHECK: outer_exiting.loopexit.split-lp.loopexit:
-; CHECK-NEXT: [[LPAD_LOOPEXIT2:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT: [[LPAD_LOOPEXIT2:%.*]] = landingpad { ptr, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: br label [[OUTER_EXITING_LOOPEXIT_SPLIT_LP:%.*]]
; CHECK: outer_exiting.loopexit.split-lp.loopexit.split-lp:
-; CHECK-NEXT: [[LPAD_LOOPEXIT_SPLIT_LP3:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT: [[LPAD_LOOPEXIT_SPLIT_LP3:%.*]] = landingpad { ptr, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: br label [[OUTER_EXITING_LOOPEXIT_SPLIT_LP]]
; CHECK: outer_exiting.loopexit.split-lp:
@@ -147,7 +147,7 @@ bb8: ; preds = %bb5
br i1 %tmp9, label %innerheader, label %bb13
outer_exiting: ; preds = %innerheader
- %tmp11 = landingpad { i8*, i32 }
+ %tmp11 = landingpad { ptr, i32 }
cleanup
switch i32 undef, label %exit2 [
i32 142, label %bb14
@@ -173,7 +173,7 @@ exit2: ; preds = %outer_exiting
ret void
}
-declare i32* @ham()
+declare ptr @ham()
declare void @pluto()
diff --git a/llvm/test/Transforms/IRCE/decrementing-loop.ll b/llvm/test/Transforms/IRCE/decrementing-loop.ll
index 462607162bcbe..ec7c3ee172a15 100644
--- a/llvm/test/Transforms/IRCE/decrementing-loop.ll
+++ b/llvm/test/Transforms/IRCE/decrementing-loop.ll
@@ -1,9 +1,9 @@
; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s
; RUN: opt -verify-loop-info -passes='require<branch-prob>,irce' -S < %s | FileCheck %s
-define void @decrementing_loop(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @decrementing_loop(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
%start = sub i32 %n, 1
br i1 %first.itr.check, label %loop, label %exit
@@ -17,8 +17,8 @@ define void @decrementing_loop(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp sgt i32 %idx.dec, -1
br i1 %next, label %loop, label %exit
@@ -37,7 +37,7 @@ define void @decrementing_loop(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
; Make sure that we can eliminate the range check when the loop looks like:
; for (i = len.a - 1; i >= 0; --i)
; b[i] = a[i];
-define void @test_01(i32* %a, i32* %b, i32* %a_len_ptr, i32* %b_len_ptr) {
+define void @test_01(ptr %a, ptr %b, ptr %a_len_ptr, ptr %b_len_ptr) {
; CHECK-LABEL: test_01
; CHECK: mainloop:
@@ -47,8 +47,8 @@ define void @test_01(i32* %a, i32* %b, i32* %a_len_ptr, i32* %b_len_ptr) {
; CHECK: loop.preloop:
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
- %len.b = load i32, i32* %b_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
+ %len.b = load i32, ptr %b_len_ptr, !range !0
%first.itr.check = icmp ne i32 %len.a, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -61,10 +61,10 @@ define void @test_01(i32* %a, i32* %b, i32* %a_len_ptr, i32* %b_len_ptr) {
br i1 %rc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %el.a = getelementptr i32, i32* %a, i32 %idx.next
- %el.b = getelementptr i32, i32* %b, i32 %idx.next
- %v = load i32, i32* %el.a
- store i32 %v, i32* %el.b
+ %el.a = getelementptr i32, ptr %a, i32 %idx.next
+ %el.b = getelementptr i32, ptr %b, i32 %idx.next
+ %v = load i32, ptr %el.a
+ store i32 %v, ptr %el.b
%loop.cond = icmp slt i32 %idx, 2
br i1 %loop.cond, label %exit, label %loop
@@ -76,7 +76,7 @@ define void @test_01(i32* %a, i32* %b, i32* %a_len_ptr, i32* %b_len_ptr) {
}
; Same as test_01, but the latch condition is unsigned
-define void @test_02(i32* %a, i32* %b, i32* %a_len_ptr, i32* %b_len_ptr) {
+define void @test_02(ptr %a, ptr %b, ptr %a_len_ptr, ptr %b_len_ptr) {
; CHECK-LABEL: test_02
; CHECK: mainloop:
@@ -86,8 +86,8 @@ define void @test_02(i32* %a, i32* %b, i32* %a_len_ptr, i32* %b_len_ptr) {
; CHECK: loop.preloop:
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
- %len.b = load i32, i32* %b_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
+ %len.b = load i32, ptr %b_len_ptr, !range !0
%first.itr.check = icmp ne i32 %len.a, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -100,10 +100,10 @@ define void @test_02(i32* %a, i32* %b, i32* %a_len_ptr, i32* %b_len_ptr) {
br i1 %rc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %el.a = getelementptr i32, i32* %a, i32 %idx.next
- %el.b = getelementptr i32, i32* %b, i32 %idx.next
- %v = load i32, i32* %el.a
- store i32 %v, i32* %el.b
+ %el.a = getelementptr i32, ptr %a, i32 %idx.next
+ %el.b = getelementptr i32, ptr %b, i32 %idx.next
+ %v = load i32, ptr %el.a
+ store i32 %v, ptr %el.b
%loop.cond = icmp ult i32 %idx, 2
br i1 %loop.cond, label %exit, label %loop
@@ -116,7 +116,7 @@ define void @test_02(i32* %a, i32* %b, i32* %a_len_ptr, i32* %b_len_ptr) {
; Check that we can figure out that IV is non-negative via implication through
; Phi node.
-define void @test_03(i32* %a, i32* %a_len_ptr, i1 %cond) {
+define void @test_03(ptr %a, ptr %a_len_ptr, i1 %cond) {
; CHECK-LABEL: test_03
; CHECK: mainloop:
@@ -126,7 +126,7 @@ define void @test_03(i32* %a, i32* %a_len_ptr, i1 %cond) {
; CHECK: loop.preloop:
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
%len.minus.one = sub nsw i32 %len.a, 1
%len.minus.two = sub nsw i32 %len.a, 2
br i1 %cond, label %if.true, label %if.false
@@ -149,8 +149,8 @@ loop:
br i1 %rc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %el.a = getelementptr i32, i32* %a, i32 %idx.next
- %v = load i32, i32* %el.a
+ %el.a = getelementptr i32, ptr %a, i32 %idx.next
+ %v = load i32, ptr %el.a
%loop.cond = icmp slt i32 %idx, 2
br i1 %loop.cond, label %exit, label %loop
@@ -163,7 +163,7 @@ exit:
; Check that we can figure out that IV is non-negative via implication through
; two Phi nodes.
-define void @test_04(i32* %a, i32* %a_len_ptr, i1 %cond) {
+define void @test_04(ptr %a, ptr %a_len_ptr, i1 %cond) {
; CHECK-LABEL: test_04
; CHECK: mainloop:
@@ -173,7 +173,7 @@ define void @test_04(i32* %a, i32* %a_len_ptr, i1 %cond) {
; CHECK: loop.preloop:
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
%len.minus.one = sub nsw i32 %len.a, 1
%len.plus.one = add nsw i32 %len.a, 1
%len.minus.two = sub nsw i32 %len.a, 2
@@ -198,8 +198,8 @@ loop:
br i1 %rc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %el.a = getelementptr i32, i32* %a, i32 %idx.next
- %v = load i32, i32* %el.a
+ %el.a = getelementptr i32, ptr %a, i32 %idx.next
+ %v = load i32, ptr %el.a
%loop.cond = icmp slt i32 %idx, 2
br i1 %loop.cond, label %exit, label %loop
@@ -212,7 +212,7 @@ exit:
; Check that we can figure out that IV is non-negative via implication through
; two Phi nodes, one being AddRec.
-define void @test_05(i32* %a, i32* %a_len_ptr, i1 %cond) {
+define void @test_05(ptr %a, ptr %a_len_ptr, i1 %cond) {
; CHECK-LABEL: test_05
; CHECK: mainloop:
@@ -222,7 +222,7 @@ define void @test_05(i32* %a, i32* %a_len_ptr, i1 %cond) {
; CHECK: loop.preloop:
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
%len.minus.one = sub nsw i32 %len.a, 1
%len.plus.one = add nsw i32 %len.a, 1
%len.minus.two = sub nsw i32 %len.a, 2
@@ -245,8 +245,8 @@ loop:
br i1 %rc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %el.a = getelementptr i32, i32* %a, i32 %idx.next
- %v = load i32, i32* %el.a
+ %el.a = getelementptr i32, ptr %a, i32 %idx.next
+ %v = load i32, ptr %el.a
%loop.cond = icmp slt i32 %idx, 2
br i1 %loop.cond, label %exit, label %loop
diff --git a/llvm/test/Transforms/IRCE/empty_ranges.ll b/llvm/test/Transforms/IRCE/empty_ranges.ll
index 60d253c51e032..9265512d1db6d 100644
--- a/llvm/test/Transforms/IRCE/empty_ranges.ll
+++ b/llvm/test/Transforms/IRCE/empty_ranges.ll
@@ -10,15 +10,15 @@
; that we will never go to the main loop in the latter case and basically
; only duplicate code with no benefits.
-define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_01(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: test_01(
; CHECK-NOT: preloop
; CHECK: entry:
; CHECK-NEXT: br i1 true, label %loop.preheader, label %main.pseudo.exit
; CHECK: in.bounds.1:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %off1 = add i32 %idx, 30
; CHECK-NEXT: %c2 = icmp slt i32 %off1, 40
; CHECK-NEXT: br i1 true, label %in.bounds.2, label %exit.loopexit2
@@ -46,8 +46,8 @@ loop:
br i1 %c1, label %in.bounds.1, label %out.of.bounds
in.bounds.1:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%off1 = add i32 %idx, 30
%c2 = icmp slt i32 %off1, 40
br i1 %c2, label %in.bounds.2, label %exit
diff --git a/llvm/test/Transforms/IRCE/eq_ne.ll b/llvm/test/Transforms/IRCE/eq_ne.ll
index 5d233182312db..c9b3970d25e66 100644
--- a/llvm/test/Transforms/IRCE/eq_ne.ll
+++ b/llvm/test/Transforms/IRCE/eq_ne.ll
@@ -13,7 +13,7 @@
; Show that IRCE can turn 'ne' condition to 'slt' in increasing IV when the IV
; can be negative at some point.
-define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_01(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_01
; CHECK: main.exit.selector:
@@ -22,7 +22,7 @@ define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 [[COND]]
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -32,8 +32,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ne i32 %idx.next, 100
br i1 %next, label %loop, label %exit
@@ -46,7 +46,7 @@ exit:
; Show that IRCE can turn 'ne' condition to 'ult' in increasing IV when IV is
; non-negative.
-define void @test_01u(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_01u(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_01u
; CHECK: main.exit.selector:
@@ -55,7 +55,7 @@ define void @test_01u(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 [[COND]]
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -65,8 +65,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ne i32 %idx.next, 100
br i1 %next, label %loop, label %exit
@@ -79,12 +79,12 @@ exit:
; Show that if n is not known to be greater than the starting value, IRCE
; doesn't apply.
-define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_02(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_02(
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -94,8 +94,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ne i32 %idx.next, -100
br i1 %next, label %loop, label %exit
@@ -107,7 +107,7 @@ exit:
}
; Show that IRCE can turn 'eq' condition to 'sge' in increasing IV.
-define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_03(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_03(
; CHECK: main.exit.selector:
@@ -116,7 +116,7 @@ define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 [[COND]]
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -126,8 +126,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp eq i32 %idx.next, 100
br i1 %next, label %exit, label %loop
@@ -138,10 +138,10 @@ exit:
ret void
}
-define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_04(ptr %arr, ptr %a_len_ptr) #0 {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -151,8 +151,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp eq i32 %idx.next, -100
br i1 %next, label %exit, label %loop
@@ -164,7 +164,7 @@ exit:
}
; Show that IRCE can turn 'ne' condition to 'sgt' in decreasing IV.
-define void @test_05(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_05(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_05(
; CHECK: preloop.exit.selector:
@@ -173,7 +173,7 @@ define void @test_05(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 [[COND]]
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -183,8 +183,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ne i32 %idx.next, 0
br i1 %next, label %loop, label %exit
@@ -197,12 +197,12 @@ exit:
; Show that IRCE cannot turn 'ne' condition to 'sgt' in decreasing IV if the end
; value is not proved to be less than the start value.
-define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_06(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_06(
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -212,8 +212,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ne i32 %idx.next, 120
br i1 %next, label %loop, label %exit
@@ -225,7 +225,7 @@ exit:
}
; Show that IRCE can turn 'eq' condition to 'slt' in decreasing IV.
-define void @test_07(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_07(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_07(
; CHECK: preloop.exit.selector:
@@ -234,7 +234,7 @@ define void @test_07(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 [[COND]]
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -244,8 +244,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp eq i32 %idx.next, 0
br i1 %next, label %exit, label %loop
@@ -258,12 +258,12 @@ exit:
; Show that IRCE cannot turn 'eq' condition to 'slt' in decreasing IV if the end
; value is not proved to be less than the start value.
-define void @test_08(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_08(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_08(
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -273,8 +273,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp eq i32 %idx.next, 120
br i1 %next, label %exit, label %loop
diff --git a/llvm/test/Transforms/IRCE/low-becount.ll b/llvm/test/Transforms/IRCE/low-becount.ll
index d77e882363c6a..7a200df386d6a 100644
--- a/llvm/test/Transforms/IRCE/low-becount.ll
+++ b/llvm/test/Transforms/IRCE/low-becount.ll
@@ -5,9 +5,9 @@
; CHECK-NOT: constrained Loop
-define void @low_profiled_be_count(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @low_profiled_be_count(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -18,8 +18,8 @@ define void @low_profiled_be_count(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit, !prof !2
diff --git a/llvm/test/Transforms/IRCE/low-iterations.ll b/llvm/test/Transforms/IRCE/low-iterations.ll
index 7a82852fe883e..071ab4d015685 100644
--- a/llvm/test/Transforms/IRCE/low-iterations.ll
+++ b/llvm/test/Transforms/IRCE/low-iterations.ll
@@ -5,10 +5,10 @@
; CHECK-NO-NOT: constrained Loop
define i32 @multiple_access_no_preloop(
- i32* %arr_a, i32* %a_len_ptr, i32* %arr_b, i32* %b_len_ptr, i32 %n) {
+ ptr %arr_a, ptr %a_len_ptr, ptr %arr_b, ptr %b_len_ptr, i32 %n) {
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit, !prof !1
@@ -19,8 +19,8 @@ define i32 @multiple_access_no_preloop(
br i1 %abc.a, label %in.bounds.a, label %exit, !prof !2
in.bounds.a:
- %addr.a = getelementptr i32, i32* %arr_a, i32 %idx
- %val = load i32, i32* %addr.a
+ %addr.a = getelementptr i32, ptr %arr_a, i32 %idx
+ %val = load i32, ptr %addr.a
%cond = icmp ne i32 %val, 0
; Most probable exit from a loop.
br i1 %cond, label %found, label %backedge, !prof !3
diff --git a/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll b/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll
index ddb48c1ab140e..9a289da9e1a3c 100644
--- a/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll
+++ b/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll
@@ -5,8 +5,8 @@
define void @multiple_access_no_preloop(
; CHECK-LABEL: @multiple_access_no_preloop(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN_A:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0:![0-9]+]]
-; CHECK-NEXT: [[LEN_B:%.*]] = load i32, i32* [[B_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN_A:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT: [[LEN_B:%.*]] = load i32, ptr [[B_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
; CHECK-NEXT: br i1 [[FIRST_ITR_CHECK]], label [[LOOP_PREHEADER:%.*]], label [[EXIT:%.*]]
; CHECK: loop.preheader:
@@ -23,13 +23,13 @@ define void @multiple_access_no_preloop(
; CHECK-NEXT: [[ABC_A:%.*]] = icmp slt i32 [[IDX]], [[LEN_A]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS_A:%.*]], label [[OUT_OF_BOUNDS_LOOPEXIT3:%.*]], !prof [[PROF1:![0-9]+]]
; CHECK: in.bounds.a:
-; CHECK-NEXT: [[ADDR_A:%.*]] = getelementptr i32, i32* [[ARR_A:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_A]], align 4
+; CHECK-NEXT: [[ADDR_A:%.*]] = getelementptr i32, ptr [[ARR_A:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_A]], align 4
; CHECK-NEXT: [[ABC_B:%.*]] = icmp slt i32 [[IDX]], [[LEN_B]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS_B]], label [[OUT_OF_BOUNDS_LOOPEXIT3]], !prof [[PROF1]]
; CHECK: in.bounds.b:
-; CHECK-NEXT: [[ADDR_B:%.*]] = getelementptr i32, i32* [[ARR_B:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 -1, i32* [[ADDR_B]], align 4
+; CHECK-NEXT: [[ADDR_B:%.*]] = getelementptr i32, ptr [[ARR_B:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 -1, ptr [[ADDR_B]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP1]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -61,21 +61,21 @@ define void @multiple_access_no_preloop(
; CHECK-NEXT: [[ABC_A_POSTLOOP:%.*]] = icmp slt i32 [[IDX_POSTLOOP]], [[LEN_A]]
; CHECK-NEXT: br i1 [[ABC_A_POSTLOOP]], label [[IN_BOUNDS_A_POSTLOOP:%.*]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]], !prof [[PROF1]]
; CHECK: in.bounds.a.postloop:
-; CHECK-NEXT: [[ADDR_A_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR_A]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_A_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_A_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR_A]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_A_POSTLOOP]], align 4
; CHECK-NEXT: [[ABC_B_POSTLOOP:%.*]] = icmp slt i32 [[IDX_POSTLOOP]], [[LEN_B]]
; CHECK-NEXT: br i1 [[ABC_B_POSTLOOP]], label [[IN_BOUNDS_B_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT]], !prof [[PROF1]]
; CHECK: in.bounds.b.postloop:
-; CHECK-NEXT: [[ADDR_B_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR_B]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 -1, i32* [[ADDR_B_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_B_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR_B]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 -1, ptr [[ADDR_B_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], [[N]]
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP2:![0-9]+]], !irce.loop.clone !7
;
- i32* %arr_a, i32* %a_len_ptr, i32* %arr_b, i32* %b_len_ptr, i32 %n) {
+ ptr %arr_a, ptr %a_len_ptr, ptr %arr_b, ptr %b_len_ptr, i32 %n) {
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
- %len.b = load i32, i32* %b_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
+ %len.b = load i32, ptr %b_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -86,14 +86,14 @@ define void @multiple_access_no_preloop(
br i1 %abc.a, label %in.bounds.a, label %out.of.bounds, !prof !1
in.bounds.a:
- %addr.a = getelementptr i32, i32* %arr_a, i32 %idx
- store i32 0, i32* %addr.a
+ %addr.a = getelementptr i32, ptr %arr_a, i32 %idx
+ store i32 0, ptr %addr.a
%abc.b = icmp slt i32 %idx, %len.b
br i1 %abc.b, label %in.bounds.b, label %out.of.bounds, !prof !1
in.bounds.b:
- %addr.b = getelementptr i32, i32* %arr_b, i32 %idx
- store i32 -1, i32* %addr.b
+ %addr.b = getelementptr i32, ptr %arr_b, i32 %idx
+ store i32 -1, ptr %addr.b
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/non-loop-invariant-rhs-instr.ll b/llvm/test/Transforms/IRCE/non-loop-invariant-rhs-instr.ll
index 9181e507326d3..08c00a704b9ab 100644
--- a/llvm/test/Transforms/IRCE/non-loop-invariant-rhs-instr.ll
+++ b/llvm/test/Transforms/IRCE/non-loop-invariant-rhs-instr.ll
@@ -2,7 +2,7 @@
; RUN: opt -S -irce -verify-loop-info -verify < %s 2>&1 | FileCheck %s
; RUN: opt -S -verify-loop-info -passes=irce,verify < %s 2>&1 | FileCheck %s
-define i32 @test_01(i32 %A, i64 %Len, i32 *%array) {
+define i32 @test_01(i32 %A, i64 %Len, ptr %array) {
; CHECK-LABEL: @test_01(
; CHECK-NEXT: preheader:
; CHECK-NEXT: [[TRIPCHECK:%.*]] = icmp sgt i64 [[LEN:%.*]], 2
@@ -23,8 +23,8 @@ define i32 @test_01(i32 %A, i64 %Len, i32 *%array) {
; CHECK-NEXT: [[TMP4:%.*]] = icmp ult i64 [[INDVAR]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[GUARDED:%.*]], label [[DEOPT_LOOPEXIT3:%.*]]
; CHECK: guarded:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds i32, i32* [[ARRAY:%.*]], i64 [[INDVAR]]
-; CHECK-NEXT: [[RES:%.*]] = load i32, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds i32, ptr [[ARRAY:%.*]], i64 [[INDVAR]]
+; CHECK-NEXT: [[RES:%.*]] = load i32, ptr [[ADDR]], align 4
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 0
; CHECK-NEXT: br i1 [[CMP]], label [[ZERO_LOOPEXIT_LOOPEXIT4:%.*]], label [[LATCH]]
; CHECK: latch:
@@ -71,8 +71,8 @@ define i32 @test_01(i32 %A, i64 %Len, i32 *%array) {
; CHECK-NEXT: [[TMP9:%.*]] = icmp ult i64 [[INDVAR_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[TMP9]], label [[GUARDED_POSTLOOP:%.*]], label [[DEOPT_LOOPEXIT:%.*]]
; CHECK: guarded.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr inbounds i32, i32* [[ARRAY]], i64 [[INDVAR_POSTLOOP]]
-; CHECK-NEXT: [[RES_POSTLOOP:%.*]] = load i32, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr inbounds i32, ptr [[ARRAY]], i64 [[INDVAR_POSTLOOP]]
+; CHECK-NEXT: [[RES_POSTLOOP:%.*]] = load i32, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[CMP_POSTLOOP:%.*]] = icmp eq i32 [[RES_POSTLOOP]], 0
; CHECK-NEXT: br i1 [[CMP_POSTLOOP]], label [[ZERO_LOOPEXIT_LOOPEXIT:%.*]], label [[LATCH_POSTLOOP]]
; CHECK: latch.postloop:
@@ -92,8 +92,8 @@ loop:
br i1 %0, label %guarded, label %deopt
guarded:
- %addr = getelementptr inbounds i32, i32* %array, i64 %indvar
- %res = load i32, i32* %addr
+ %addr = getelementptr inbounds i32, ptr %array, i64 %indvar
+ %res = load i32, ptr %addr
%cmp = icmp eq i32 %res, 0
br i1 %cmp, label %zero, label %latch
diff --git a/llvm/test/Transforms/IRCE/non_known_positive_end.ll b/llvm/test/Transforms/IRCE/non_known_positive_end.ll
index 95e6629a18b05..8830ab23c426f 100644
--- a/llvm/test/Transforms/IRCE/non_known_positive_end.ll
+++ b/llvm/test/Transforms/IRCE/non_known_positive_end.ll
@@ -2,13 +2,13 @@
; RUN: opt -verify-loop-info -passes='require<branch-prob>,irce' -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s
; Make sure that we can pick up both range checks.
-define void @test_01(i32 *%arr, i32* %a_len_ptr, i32* %size_ptr) {
+define void @test_01(ptr %arr, ptr %a_len_ptr, ptr %size_ptr) {
; CHECK-LABEL: @test_01(
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
- %size = load i32, i32* %size_ptr
+ %len = load i32, ptr %a_len_ptr, !range !0
+ %size = load i32, ptr %size_ptr
%first_iter_check = icmp sle i32 %size, 0
br i1 %first_iter_check, label %exit, label %loop
@@ -23,8 +23,8 @@ loop:
backedge:
%iv.next = add i32 %iv, 1
- %arr_el_ptr = getelementptr i32, i32* %arr, i32 %iv
- %el = load i32, i32* %arr_el_ptr
+ %arr_el_ptr = getelementptr i32, ptr %arr, i32 %iv
+ %el = load i32, ptr %arr_el_ptr
%loopcond = icmp ne i32 %iv, %size
br i1 %loopcond, label %loop, label %exit
@@ -36,13 +36,13 @@ out_of_bounds:
}
; Same as test_01, unsigned predicates.
-define void @test_02(i32 *%arr, i32* %a_len_ptr, i32* %size_ptr) {
+define void @test_02(ptr %arr, ptr %a_len_ptr, ptr %size_ptr) {
; CHECK-LABEL: @test_02(
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
- %size = load i32, i32* %size_ptr
+ %len = load i32, ptr %a_len_ptr, !range !0
+ %size = load i32, ptr %size_ptr
%first_iter_check = icmp sle i32 %size, 0
br i1 %first_iter_check, label %exit, label %loop
@@ -57,8 +57,8 @@ loop:
backedge:
%iv.next = add i32 %iv, 1
- %arr_el_ptr = getelementptr i32, i32* %arr, i32 %iv
- %el = load i32, i32* %arr_el_ptr
+ %arr_el_ptr = getelementptr i32, ptr %arr, i32 %iv
+ %el = load i32, ptr %arr_el_ptr
%loopcond = icmp ne i32 %iv, %size
br i1 %loopcond, label %loop, label %exit
@@ -69,13 +69,13 @@ out_of_bounds:
ret void
}
-define void @test_03(i32 *%arr, i32* %a_len_ptr, i32* %size_ptr) {
+define void @test_03(ptr %arr, ptr %a_len_ptr, ptr %size_ptr) {
; CHECK-LABEL: @test_03(
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
- %size = load i32, i32* %size_ptr
+ %len = load i32, ptr %a_len_ptr, !range !0
+ %size = load i32, ptr %size_ptr
%first_iter_check = icmp eq i32 %size, 0
br i1 %first_iter_check, label %exit, label %loop
@@ -90,8 +90,8 @@ loop:
backedge:
%iv.next = add i32 %iv, 1
- %arr_el_ptr = getelementptr i32, i32* %arr, i32 %iv
- %el = load i32, i32* %arr_el_ptr
+ %arr_el_ptr = getelementptr i32, ptr %arr, i32 %iv
+ %el = load i32, ptr %arr_el_ptr
%loopcond = icmp ne i32 %iv, %len
br i1 %loopcond, label %loop, label %exit
@@ -102,13 +102,13 @@ out_of_bounds:
ret void
}
-define void @test_04(i32 *%arr, i32* %a_len_ptr, i32* %size_ptr) {
+define void @test_04(ptr %arr, ptr %a_len_ptr, ptr %size_ptr) {
; CHECK-LABEL: @test_04(
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
- %size = load i32, i32* %size_ptr
+ %len = load i32, ptr %a_len_ptr, !range !0
+ %size = load i32, ptr %size_ptr
%first_iter_check = icmp eq i32 %size, 0
br i1 %first_iter_check, label %exit, label %loop
@@ -123,8 +123,8 @@ loop:
backedge:
%iv.next = add i32 %iv, 1
- %arr_el_ptr = getelementptr i32, i32* %arr, i32 %iv
- %el = load i32, i32* %arr_el_ptr
+ %arr_el_ptr = getelementptr i32, ptr %arr, i32 %iv
+ %el = load i32, ptr %arr_el_ptr
%loopcond = icmp ne i32 %iv, %len
br i1 %loopcond, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/not-likely-taken.ll b/llvm/test/Transforms/IRCE/not-likely-taken.ll
index a9ad8e8e82fd7..c885a8ea5a706 100644
--- a/llvm/test/Transforms/IRCE/not-likely-taken.ll
+++ b/llvm/test/Transforms/IRCE/not-likely-taken.ll
@@ -6,11 +6,11 @@
; CHECK-NOT: constrained Loop
define void @multiple_access_no_preloop(
- i32* %arr_a, i32* %a_len_ptr, i32* %arr_b, i32* %b_len_ptr, i32 %n) {
+ ptr %arr_a, ptr %a_len_ptr, ptr %arr_b, ptr %b_len_ptr, i32 %n) {
entry:
- %len.a = load i32, i32* %a_len_ptr, !range !0
- %len.b = load i32, i32* %b_len_ptr, !range !0
+ %len.a = load i32, ptr %a_len_ptr, !range !0
+ %len.b = load i32, ptr %b_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -21,14 +21,14 @@ define void @multiple_access_no_preloop(
br i1 %abc.a, label %in.bounds.a, label %out.of.bounds, !prof !1
in.bounds.a:
- %addr.a = getelementptr i32, i32* %arr_a, i32 %idx
- store i32 0, i32* %addr.a
+ %addr.a = getelementptr i32, ptr %arr_a, i32 %idx
+ store i32 0, ptr %addr.a
%abc.b = icmp slt i32 %idx, %len.b
br i1 %abc.b, label %in.bounds.b, label %out.of.bounds, !prof !1
in.bounds.b:
- %addr.b = getelementptr i32, i32* %arr_b, i32 %idx
- store i32 -1, i32* %addr.b
+ %addr.b = getelementptr i32, ptr %arr_b, i32 %idx
+ store i32 -1, ptr %addr.b
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/only-lower-check.ll b/llvm/test/Transforms/IRCE/only-lower-check.ll
index 78fdad239f26c..ec430fed0bd69 100644
--- a/llvm/test/Transforms/IRCE/only-lower-check.ll
+++ b/llvm/test/Transforms/IRCE/only-lower-check.ll
@@ -7,9 +7,9 @@
; CHECK-NEXT: CheckUse: br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 Operand: 0
; CHECK-NEXT: irce: in function only_lower_check: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
-define void @only_lower_check(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @only_lower_check(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
%start = sub i32 %n, 1
br i1 %first.itr.check, label %loop, label %exit
@@ -21,8 +21,8 @@ define void @only_lower_check(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp sgt i32 %idx.dec, -1
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/only-upper-check.ll b/llvm/test/Transforms/IRCE/only-upper-check.ll
index bb05c0eaed23c..cf9053481c3d0 100644
--- a/llvm/test/Transforms/IRCE/only-upper-check.ll
+++ b/llvm/test/Transforms/IRCE/only-upper-check.ll
@@ -7,9 +7,9 @@
; CHECK-NEXT: CheckUse: br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 Operand: 0
; CHECK-NEXT: irce: in function incrementing: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
-define void @incrementing(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %offset) {
+define void @incrementing(ptr %arr, ptr %a_len_ptr, i32 %n, i32 %offset) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -21,8 +21,8 @@ define void @incrementing(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %offset) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %array.idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %array.idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/pr40539.ll b/llvm/test/Transforms/IRCE/pr40539.ll
index a8d6a37fa7dd2..9ae76156f3acc 100644
--- a/llvm/test/Transforms/IRCE/pr40539.ll
+++ b/llvm/test/Transforms/IRCE/pr40539.ll
@@ -10,11 +10,11 @@ define void @test_01() {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[CONT48:%.*]]
; CHECK: cont48:
-; CHECK-NEXT: [[A2_0121:%.*]] = phi i16* [ [[ADD_PTR74:%.*]], [[CONT76:%.*]] ], [ getelementptr inbounds ([1528 x i16], [1528 x i16]* @array, i16 0, i16 0), [[ENTRY:%.*]] ]
+; CHECK-NEXT: [[A2_0121:%.*]] = phi ptr [ [[ADD_PTR74:%.*]], [[CONT76:%.*]] ], [ @array, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[I41_0119:%.*]] = phi i16 [ [[ADD73:%.*]], [[CONT76]] ], [ 0, [[ENTRY]] ]
; CHECK-NEXT: [[ADD73]] = add nuw nsw i16 [[I41_0119]], 2
-; CHECK-NEXT: [[ADD_PTR74]] = getelementptr inbounds i16, i16* [[A2_0121]], i16 2
-; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i16* [[A2_0121]], inttoptr (i16 -2 to i16*)
+; CHECK-NEXT: [[ADD_PTR74]] = getelementptr inbounds i16, ptr [[A2_0121]], i16 2
+; CHECK-NEXT: [[TMP0:%.*]] = icmp ult ptr [[A2_0121]], inttoptr (i16 -2 to ptr)
; CHECK-NEXT: br i1 [[TMP0]], label [[CONT76]], label [[HANDLER_POINTER_OVERFLOW75:%.*]]
; CHECK: handler.pointer_overflow75:
; CHECK-NEXT: unreachable
@@ -28,11 +28,11 @@ entry:
br label %cont48
cont48: ; preds = %cont76, %entry
- %a2.0121 = phi i16* [ %add.ptr74, %cont76 ], [ getelementptr inbounds ([1528 x i16], [1528 x i16]* @array, i16 0, i16 0), %entry ]
+ %a2.0121 = phi ptr [ %add.ptr74, %cont76 ], [ @array, %entry ]
%i41.0119 = phi i16 [ %add73, %cont76 ], [ 0, %entry ]
%add73 = add nuw nsw i16 %i41.0119, 2
- %add.ptr74 = getelementptr inbounds i16, i16* %a2.0121, i16 2
- %0 = icmp ult i16* %a2.0121, inttoptr (i16 -2 to i16*)
+ %add.ptr74 = getelementptr inbounds i16, ptr %a2.0121, i16 2
+ %0 = icmp ult ptr %a2.0121, inttoptr (i16 -2 to ptr)
br i1 %0, label %cont76, label %handler.pointer_overflow75
handler.pointer_overflow75: ; preds = %cont48
diff --git a/llvm/test/Transforms/IRCE/pr57335.ll b/llvm/test/Transforms/IRCE/pr57335.ll
index 1fadbfb0b3eba..fdc513c1d9ae4 100644
--- a/llvm/test/Transforms/IRCE/pr57335.ll
+++ b/llvm/test/Transforms/IRCE/pr57335.ll
@@ -31,7 +31,7 @@ bb8: ; preds = %bb12
bb12: ; preds = %bb8, %bb5
%tmp13 = phi i32 [ 1, %bb5 ], [ %tmp9, %bb8 ]
%tmp14 = add nuw nsw i32 %tmp13, 1
- %tmp15 = load atomic i32, i32 addrspace(1)* undef unordered, align 8
+ %tmp15 = load atomic i32, ptr addrspace(1) undef unordered, align 8
%tmp16 = icmp ult i32 %tmp14, %tmp6
br i1 %tmp16, label %bb8, label %bb17
diff --git a/llvm/test/Transforms/IRCE/pre_post_loops.ll b/llvm/test/Transforms/IRCE/pre_post_loops.ll
index c2db059492645..1ed83b4eb8725 100644
--- a/llvm/test/Transforms/IRCE/pre_post_loops.ll
+++ b/llvm/test/Transforms/IRCE/pre_post_loops.ll
@@ -5,19 +5,19 @@
; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
; Iterate from 0 to SINT_MAX, check that the post-loop is generated.
-define void @test_01(i32* %arr, i32* %a_len_ptr) {
+define void @test_01(ptr %arr, ptr %a_len_ptr) {
; CHECK: test_01(
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr
; CHECK: loop:
; CHECK-NEXT: %idx = phi i32 [ %idx.next, %in.bounds ], [ 0, %loop.preheader ]
; CHECK-NEXT: %idx.next = add i32 %idx, 1
; CHECK-NEXT: %abc = icmp slt i32 %idx, %exit.mainloop.at
; CHECK-NEXT: br i1 true, label %in.bounds,
; CHECK: in.bounds:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %next = icmp slt i32 %idx.next, 2147483647
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp slt i32 %idx.next, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND]], label %loop, label %main.exit.selector
@@ -33,13 +33,13 @@ define void @test_01(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc.postloop = icmp slt i32 %idx.postloop, %exit.mainloop.at
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: %addr.postloop = getelementptr i32, i32* %arr, i32 %idx.postloop
-; CHECK-NEXT: store i32 0, i32* %addr.postloop
+; CHECK-NEXT: %addr.postloop = getelementptr i32, ptr %arr, i32 %idx.postloop
+; CHECK-NEXT: store i32 0, ptr %addr.postloop
; CHECK-NEXT: %next.postloop = icmp slt i32 %idx.next.postloop, 2147483647
; CHECK-NEXT: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -49,8 +49,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 2147483647
br i1 %next, label %loop, label %exit
@@ -62,11 +62,11 @@ exit:
}
; Iterate from SINT_MAX to 0, check that the pre-loop is generated.
-define void @test_02(i32* %arr, i32* %a_len_ptr) {
+define void @test_02(ptr %arr, ptr %a_len_ptr) {
; CHECK: test_02(
; CHECK: entry:
-; CHECK-NEXT: %len = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %len = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: br i1 true, label %loop.preloop.preheader
; CHECK: mainloop:
; CHECK-NEXT: br label %loop
@@ -76,8 +76,8 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc = icmp slt i32 %idx, %len
; CHECK-NEXT: br i1 true, label %in.bounds
; CHECK: in.bounds:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %next = icmp sgt i32 %idx.next, -1
; CHECK-NEXT: br i1 %next, label %loop, label %exit.loopexit
; CHECK: loop.preloop:
@@ -86,14 +86,14 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc.preloop = icmp slt i32 %idx.preloop, %len
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
; CHECK: in.bounds.preloop:
-; CHECK-NEXT: %addr.preloop = getelementptr i32, i32* %arr, i32 %idx.preloop
-; CHECK-NEXT: store i32 0, i32* %addr.preloop
+; CHECK-NEXT: %addr.preloop = getelementptr i32, ptr %arr, i32 %idx.preloop
+; CHECK-NEXT: store i32 0, ptr %addr.preloop
; CHECK-NEXT: %next.preloop = icmp sgt i32 %idx.next.preloop, -1
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp sgt i32 %idx.next.preloop, -1
; CHECK-NEXT: br i1 [[COND]], label %loop.preloop, label %preloop.exit.selector
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -103,8 +103,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp sgt i32 %idx.next, -1
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/range_intersect_miscompile.ll b/llvm/test/Transforms/IRCE/range_intersect_miscompile.ll
index fa7544d982216..cb2ca8bd87140 100644
--- a/llvm/test/Transforms/IRCE/range_intersect_miscompile.ll
+++ b/llvm/test/Transforms/IRCE/range_intersect_miscompile.ll
@@ -171,7 +171,7 @@ deopt: ; preds = %range_check_block
; We can also properly eliminate range check against %n which is not always
; known positive.
-define void @test_04(i32* %p) {
+define void @test_04(ptr %p) {
; CHECK-LABEL: test_04
; CHECK: entry
@@ -184,7 +184,7 @@ define void @test_04(i32* %p) {
; CHECK: postloop:
entry:
- %n = load i32, i32* %p
+ %n = load i32, ptr %p
br label %loop_header
loop_header: ; preds = %loop_latch, %entry
@@ -221,12 +221,12 @@ deopt: ; preds = %range_check_block
; Same as test_04, but range guarantees that %n is positive. So we can safely
; intersect ranges (with insertion of postloop).
-define void @test_05(i32* %p) {
+define void @test_05(ptr %p) {
; CHECK-LABEL: test_05
; CHECK-NOT: preloop
; CHECK: entry:
-; CHECK-NEXT: %n = load i32, i32* %p, align 4, !range !
+; CHECK-NEXT: %n = load i32, ptr %p, align 4, !range !
; CHECK-NEXT: %exit.mainloop.at = call i32 @llvm.umax.i32(i32 %n, i32 2)
; CHECK-NEXT: [[CMP_2:%[^ ]+]] = icmp ult i32 2, %exit.mainloop.at
; CHECK-NEXT: br i1 [[CMP_2]], label %loop_header.preheader, label %main.pseudo.exit
@@ -249,7 +249,7 @@ define void @test_05(i32* %p) {
; CHECK-NEXT: br i1 %loop_cond.postloop, label %loop_header.postloop, label %exit.loopexit
entry:
- %n = load i32, i32* %p, !range !0
+ %n = load i32, ptr %p, !range !0
br label %loop_header
loop_header: ; preds = %loop_latch, %entry
diff --git a/llvm/test/Transforms/IRCE/ranges_of_
diff erent_types.ll b/llvm/test/Transforms/IRCE/ranges_of_
diff erent_types.ll
index 7b6eb7656d051..e1aede4ced90a 100644
--- a/llvm/test/Transforms/IRCE/ranges_of_
diff erent_types.ll
+++ b/llvm/test/Transforms/IRCE/ranges_of_
diff erent_types.ll
@@ -18,10 +18,10 @@
; %len = SINT_MAX
; %exit.mainloop.at = 101
-define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_01(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: @test_01(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0:![0-9]+]]
; CHECK-NEXT: [[TMP0:%.*]] = add nsw i32 [[LEN]], -13
; CHECK-NEXT: [[SMIN:%.*]] = call i32 @llvm.smin.i32(i32 [[TMP0]], i32 101)
; CHECK-NEXT: [[EXIT_MAINLOOP_AT:%.*]] = call i32 @llvm.smax.i32(i32 [[SMIN]], i32 0)
@@ -36,8 +36,8 @@ define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC:%.*]] = icmp ult i32 [[IDX_OFFSET]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT1:%.*]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], 101
; CHECK-NEXT: [[TMP2:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP2]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -68,14 +68,14 @@ define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp ult i32 [[IDX_OFFSET_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], 101
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP1:![0-9]+]], !irce.loop.clone !6
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -86,8 +86,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 101
br i1 %next, label %loop, label %exit
@@ -114,10 +114,10 @@ exit:
; %len = SINT_MAX
; %exit.mainloop.at = 101
-define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_02(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: @test_02(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[TMP0:%.*]] = add nuw nsw i32 [[LEN]], -2147483647
; CHECK-NEXT: [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[TMP0]], i32 -13)
; CHECK-NEXT: [[TMP1:%.*]] = sub i32 [[LEN]], [[SMAX]]
@@ -137,8 +137,8 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC:%.*]] = icmp ult i32 [[IDX_OFFSET]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT3:%.*]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], 101
; CHECK-NEXT: [[TMP3:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP3]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -169,8 +169,8 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_PRELOOP:%.*]] = icmp ult i32 [[IDX_OFFSET_PRELOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_PRELOOP]], label [[IN_BOUNDS_PRELOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]]
; CHECK: in.bounds.preloop:
-; CHECK-NEXT: [[ADDR_PRELOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_PRELOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_PRELOOP]], align 4
+; CHECK-NEXT: [[ADDR_PRELOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_PRELOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_PRELOOP]], align 4
; CHECK-NEXT: [[NEXT_PRELOOP:%.*]] = icmp slt i32 [[IDX_NEXT_PRELOOP]], 101
; CHECK-NEXT: [[TMP5:%.*]] = icmp slt i32 [[IDX_NEXT_PRELOOP]], 13
; CHECK-NEXT: br i1 [[TMP5]], label [[LOOP_PRELOOP]], label [[PRELOOP_EXIT_SELECTOR:%.*]], !llvm.loop [[LOOP7:![0-9]+]], !irce.loop.clone !6
@@ -191,14 +191,14 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp ult i32 [[IDX_OFFSET_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT2:%.*]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], 101
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP8:![0-9]+]], !irce.loop.clone !6
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -209,8 +209,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 101
br i1 %next, label %loop, label %exit
@@ -237,10 +237,10 @@ exit:
; %len = SINT_MAX
; %exit.mainloop.at = 101
-define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_03(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: @test_03(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[SMIN:%.*]] = call i32 @llvm.smin.i32(i32 [[LEN]], i32 13)
; CHECK-NEXT: [[TMP0:%.*]] = sub i32 [[LEN]], [[SMIN]]
; CHECK-NEXT: [[EXIT_MAINLOOP_AT:%.*]] = call i32 @llvm.umin.i32(i32 [[TMP0]], i32 101)
@@ -255,8 +255,8 @@ define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC:%.*]] = icmp slt i32 [[IDX_OFFSET]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT1:%.*]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp ult i32 [[IDX_NEXT]], 101
; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP2]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -287,14 +287,14 @@ define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp slt i32 [[IDX_OFFSET_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp ult i32 [[IDX_NEXT_POSTLOOP]], 101
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP9:![0-9]+]], !irce.loop.clone !6
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -305,8 +305,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 101
br i1 %next, label %loop, label %exit
@@ -333,10 +333,10 @@ exit:
; %len = SINT_MAX
; %exit.mainloop.at = 101
-define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_04(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: @test_04(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[TMP0:%.*]] = add nuw i32 [[LEN]], 13
; CHECK-NEXT: [[EXIT_MAINLOOP_AT:%.*]] = call i32 @llvm.umin.i32(i32 [[TMP0]], i32 101)
; CHECK-NEXT: br i1 true, label [[LOOP_PRELOOP_PREHEADER:%.*]], label [[PRELOOP_PSEUDO_EXIT:%.*]]
@@ -354,8 +354,8 @@ define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC:%.*]] = icmp slt i32 [[IDX_OFFSET]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT3:%.*]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp ult i32 [[IDX_NEXT]], 101
; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP2]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -386,8 +386,8 @@ define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_PRELOOP:%.*]] = icmp slt i32 [[IDX_OFFSET_PRELOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_PRELOOP]], label [[IN_BOUNDS_PRELOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]]
; CHECK: in.bounds.preloop:
-; CHECK-NEXT: [[ADDR_PRELOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_PRELOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_PRELOOP]], align 4
+; CHECK-NEXT: [[ADDR_PRELOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_PRELOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_PRELOOP]], align 4
; CHECK-NEXT: [[NEXT_PRELOOP:%.*]] = icmp ult i32 [[IDX_NEXT_PRELOOP]], 101
; CHECK-NEXT: [[TMP4:%.*]] = icmp ult i32 [[IDX_NEXT_PRELOOP]], 13
; CHECK-NEXT: br i1 [[TMP4]], label [[LOOP_PRELOOP]], label [[PRELOOP_EXIT_SELECTOR:%.*]], !llvm.loop [[LOOP10:![0-9]+]], !irce.loop.clone !6
@@ -408,14 +408,14 @@ define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp slt i32 [[IDX_OFFSET_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT2:%.*]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp ult i32 [[IDX_NEXT_POSTLOOP]], 101
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP11:![0-9]+]], !irce.loop.clone !6
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -426,8 +426,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 101
br i1 %next, label %loop, label %exit
@@ -439,10 +439,10 @@ exit:
}
; Signed latch, signed RC, positive offset. Same as test_01.
-define void @test_05(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_05(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: @test_05(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[TMP0:%.*]] = add nsw i32 [[LEN]], -13
; CHECK-NEXT: [[SMIN:%.*]] = call i32 @llvm.smin.i32(i32 [[TMP0]], i32 101)
; CHECK-NEXT: [[EXIT_MAINLOOP_AT:%.*]] = call i32 @llvm.smax.i32(i32 [[SMIN]], i32 0)
@@ -457,8 +457,8 @@ define void @test_05(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC:%.*]] = icmp slt i32 [[IDX_OFFSET]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT1:%.*]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], 101
; CHECK-NEXT: [[TMP2:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP2]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -489,14 +489,14 @@ define void @test_05(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp slt i32 [[IDX_OFFSET_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], 101
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP12:![0-9]+]], !irce.loop.clone !6
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -507,8 +507,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 101
br i1 %next, label %loop, label %exit
@@ -520,10 +520,10 @@ exit:
}
; Signed latch, signed RC, negative offset. Same as test_02.
-define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_06(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: @test_06(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[TMP0:%.*]] = add nuw nsw i32 [[LEN]], -2147483647
; CHECK-NEXT: [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[TMP0]], i32 -13)
; CHECK-NEXT: [[TMP1:%.*]] = sub i32 [[LEN]], [[SMAX]]
@@ -543,8 +543,8 @@ define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC:%.*]] = icmp slt i32 [[IDX_OFFSET]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT3:%.*]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], 101
; CHECK-NEXT: [[TMP3:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP3]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -575,8 +575,8 @@ define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_PRELOOP:%.*]] = icmp slt i32 [[IDX_OFFSET_PRELOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_PRELOOP]], label [[IN_BOUNDS_PRELOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]]
; CHECK: in.bounds.preloop:
-; CHECK-NEXT: [[ADDR_PRELOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_PRELOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_PRELOOP]], align 4
+; CHECK-NEXT: [[ADDR_PRELOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_PRELOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_PRELOOP]], align 4
; CHECK-NEXT: [[NEXT_PRELOOP:%.*]] = icmp slt i32 [[IDX_NEXT_PRELOOP]], 101
; CHECK-NEXT: [[TMP5:%.*]] = icmp slt i32 [[IDX_NEXT_PRELOOP]], 13
; CHECK-NEXT: br i1 [[TMP5]], label [[LOOP_PRELOOP]], label [[PRELOOP_EXIT_SELECTOR:%.*]], !llvm.loop [[LOOP13:![0-9]+]], !irce.loop.clone !6
@@ -597,14 +597,14 @@ define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp slt i32 [[IDX_OFFSET_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT2:%.*]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], 101
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP14:![0-9]+]], !irce.loop.clone !6
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -615,8 +615,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 101
br i1 %next, label %loop, label %exit
@@ -628,10 +628,10 @@ exit:
}
; Unsigned latch, Unsigned RC, negative offset. Same as test_03.
-define void @test_07(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_07(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: @test_07(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[SMIN:%.*]] = call i32 @llvm.smin.i32(i32 [[LEN]], i32 13)
; CHECK-NEXT: [[TMP0:%.*]] = sub i32 [[LEN]], [[SMIN]]
; CHECK-NEXT: [[EXIT_MAINLOOP_AT:%.*]] = call i32 @llvm.umin.i32(i32 [[TMP0]], i32 101)
@@ -646,8 +646,8 @@ define void @test_07(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC:%.*]] = icmp ult i32 [[IDX_OFFSET]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT1:%.*]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp ult i32 [[IDX_NEXT]], 101
; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP2]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -678,14 +678,14 @@ define void @test_07(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp ult i32 [[IDX_OFFSET_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp ult i32 [[IDX_NEXT_POSTLOOP]], 101
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP15:![0-9]+]], !irce.loop.clone !6
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -696,8 +696,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 101
br i1 %next, label %loop, label %exit
@@ -709,10 +709,10 @@ exit:
}
; Unsigned latch, Unsigned RC, negative offset. Same as test_04.
-define void @test_08(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_08(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK-LABEL: @test_08(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[LEN:%.*]] = load i32, ptr [[A_LEN_PTR:%.*]], align 4, !range [[RNG0]]
; CHECK-NEXT: [[TMP0:%.*]] = add nuw i32 [[LEN]], 13
; CHECK-NEXT: [[EXIT_MAINLOOP_AT:%.*]] = call i32 @llvm.umin.i32(i32 [[TMP0]], i32 101)
; CHECK-NEXT: br i1 true, label [[LOOP_PRELOOP_PREHEADER:%.*]], label [[PRELOOP_PSEUDO_EXIT:%.*]]
@@ -730,8 +730,8 @@ define void @test_08(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC:%.*]] = icmp ult i32 [[IDX_OFFSET]], [[LEN]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT3:%.*]]
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp ult i32 [[IDX_NEXT]], 101
; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP2]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -762,8 +762,8 @@ define void @test_08(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_PRELOOP:%.*]] = icmp ult i32 [[IDX_OFFSET_PRELOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_PRELOOP]], label [[IN_BOUNDS_PRELOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]]
; CHECK: in.bounds.preloop:
-; CHECK-NEXT: [[ADDR_PRELOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_PRELOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_PRELOOP]], align 4
+; CHECK-NEXT: [[ADDR_PRELOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_PRELOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_PRELOOP]], align 4
; CHECK-NEXT: [[NEXT_PRELOOP:%.*]] = icmp ult i32 [[IDX_NEXT_PRELOOP]], 101
; CHECK-NEXT: [[TMP4:%.*]] = icmp ult i32 [[IDX_NEXT_PRELOOP]], 13
; CHECK-NEXT: br i1 [[TMP4]], label [[LOOP_PRELOOP]], label [[PRELOOP_EXIT_SELECTOR:%.*]], !llvm.loop [[LOOP16:![0-9]+]], !irce.loop.clone !6
@@ -784,14 +784,14 @@ define void @test_08(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp ult i32 [[IDX_OFFSET_POSTLOOP]], [[LEN]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT2:%.*]]
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp ult i32 [[IDX_NEXT_POSTLOOP]], 101
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP17:![0-9]+]], !irce.loop.clone !6
;
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -802,8 +802,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 101
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/rc-negative-bound.ll b/llvm/test/Transforms/IRCE/rc-negative-bound.ll
index ce56a9c186533..0d25ab7302488 100644
--- a/llvm/test/Transforms/IRCE/rc-negative-bound.ll
+++ b/llvm/test/Transforms/IRCE/rc-negative-bound.ll
@@ -7,7 +7,7 @@
; CHECK: irce: in function test_03: constrained Loop
; RC against known negative value. We should not do IRCE here.
-define void @test_01(i32 *%arr, i32 %n) {
+define void @test_01(ptr %arr, i32 %n) {
; CHECK-LABEL: @test_01(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -20,8 +20,8 @@ define void @test_01(i32 *%arr, i32 %n) {
; CHECK-NEXT: [[ABC:%.*]] = icmp slt i32 [[IDX]], -9
; CHECK-NEXT: br i1 [[ABC]], label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS:%.*]], !prof !0
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: br i1 [[NEXT]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
; CHECK: out.of.bounds:
@@ -43,8 +43,8 @@ define void @test_01(i32 *%arr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !0
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -56,7 +56,7 @@ define void @test_01(i32 *%arr, i32 %n) {
}
; Same as test_01, but the latch condition is unsigned.
-define void @test_02(i32 *%arr, i32 %n) {
+define void @test_02(ptr %arr, i32 %n) {
; CHECK-LABEL: @test_02(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -69,8 +69,8 @@ define void @test_02(i32 *%arr, i32 %n) {
; CHECK-NEXT: [[ABC:%.*]] = icmp slt i32 [[IDX]], -9
; CHECK-NEXT: br i1 [[ABC]], label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS:%.*]], !prof !0
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp ult i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: br i1 [[NEXT]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
; CHECK: out.of.bounds:
@@ -92,8 +92,8 @@ define void @test_02(i32 *%arr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !0
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -106,7 +106,7 @@ define void @test_02(i32 *%arr, i32 %n) {
; RC against a value which is not known to be non-negative. Here we should
; expand runtime checks against bound being positive or negative.
-define void @test_03(i32 *%arr, i32 %n, i32 %bound) {
+define void @test_03(ptr %arr, i32 %n, i32 %bound) {
; CHECK-LABEL: @test_03(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -131,8 +131,8 @@ define void @test_03(i32 *%arr, i32 %n, i32 %bound) {
; CHECK-NEXT: [[ABC:%.*]] = icmp slt i32 [[IDX]], [[BOUND]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT5:%.*]], !prof !0
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: [[TMP5:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP5]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -164,8 +164,8 @@ define void @test_03(i32 *%arr, i32 %n, i32 %bound) {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp slt i32 [[IDX_POSTLOOP]], [[BOUND]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]], !prof !0
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], [[N]]
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT_LOOPEXIT:%.*]], [[LOOP1:!llvm.loop !.*]], !irce.loop.clone !6
;
@@ -181,8 +181,8 @@ define void @test_03(i32 *%arr, i32 %n, i32 %bound) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !0
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -195,7 +195,7 @@ define void @test_03(i32 *%arr, i32 %n, i32 %bound) {
; RC against a value which is not known to be non-negative. Here we should
; expand runtime checks against bound being positive or negative.
-define void @test_04(i32 *%arr, i32 %n, i32 %bound) {
+define void @test_04(ptr %arr, i32 %n, i32 %bound) {
; CHECK-LABEL: @test_04(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -217,8 +217,8 @@ define void @test_04(i32 *%arr, i32 %n, i32 %bound) {
; CHECK-NEXT: [[ABC:%.*]] = icmp slt i32 [[IDX]], [[BOUND]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT2:%.*]], !prof !0
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp ult i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: [[TMP4:%.*]] = icmp ult i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP4]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -250,8 +250,8 @@ define void @test_04(i32 *%arr, i32 %n, i32 %bound) {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp slt i32 [[IDX_POSTLOOP]], [[BOUND]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]], !prof !0
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp ult i32 [[IDX_NEXT_POSTLOOP]], [[N]]
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT_LOOPEXIT:%.*]], [[LOOP7:!llvm.loop !.*]], !irce.loop.clone !6
;
@@ -267,8 +267,8 @@ define void @test_04(i32 *%arr, i32 %n, i32 %bound) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !0
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -283,7 +283,7 @@ define void @test_04(i32 *%arr, i32 %n, i32 %bound) {
; FIXME: We could remove the range check here, but it does not happen due to the
; limintation we posed to fix the miscompile (see comments in the method
; computeSafeIterationSpace).
-define void @test_05(i32 *%arr, i32 %n) {
+define void @test_05(ptr %arr, i32 %n) {
; CHECK-LABEL: @test_05(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -296,8 +296,8 @@ define void @test_05(i32 *%arr, i32 %n) {
; CHECK-NEXT: [[ABC:%.*]] = icmp ult i32 [[IDX]], -9
; CHECK-NEXT: br i1 [[ABC]], label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS:%.*]], !prof !0
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: br i1 [[NEXT]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
; CHECK: out.of.bounds:
@@ -318,8 +318,8 @@ define void @test_05(i32 *%arr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !0
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -334,7 +334,7 @@ define void @test_05(i32 *%arr, i32 %n) {
; FIXME: We could remove the range check here, but it does not happen due to the
; limintation we posed to fix the miscompile (see comments in the method
; computeSafeIterationSpace).
-define void @test_06(i32 *%arr, i32 %n) {
+define void @test_06(ptr %arr, i32 %n) {
; CHECK-LABEL: @test_06(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -347,8 +347,8 @@ define void @test_06(i32 *%arr, i32 %n) {
; CHECK-NEXT: [[ABC:%.*]] = icmp ult i32 [[IDX]], -9
; CHECK-NEXT: br i1 [[ABC]], label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS:%.*]], !prof !0
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp ult i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: br i1 [[NEXT]], label [[LOOP]], label [[EXIT_LOOPEXIT:%.*]]
; CHECK: out.of.bounds:
@@ -369,8 +369,8 @@ define void @test_06(i32 *%arr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !0
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -386,7 +386,7 @@ define void @test_06(i32 *%arr, i32 %n) {
; %bound is negative (i.e. in [SINT_MAX + 1, UINT_MAX)). We should be able to
; safely remove this check (see comments in the method
; computeSafeIterationSpace).
-define void @test_07(i32 *%arr, i32 %n, i32 %bound) {
+define void @test_07(ptr %arr, i32 %n, i32 %bound) {
; CHECK-LABEL: @test_07(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -411,8 +411,8 @@ define void @test_07(i32 *%arr, i32 %n, i32 %bound) {
; CHECK-NEXT: [[ABC:%.*]] = icmp ult i32 [[IDX]], [[BOUND]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT5:%.*]], !prof !0
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp slt i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: [[TMP5:%.*]] = icmp slt i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP5]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -444,8 +444,8 @@ define void @test_07(i32 *%arr, i32 %n, i32 %bound) {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp ult i32 [[IDX_POSTLOOP]], [[BOUND]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]], !prof !0
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp slt i32 [[IDX_NEXT_POSTLOOP]], [[N]]
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT_LOOPEXIT:%.*]], [[LOOP8:!llvm.loop !.*]], !irce.loop.clone !6
;
@@ -460,8 +460,8 @@ define void @test_07(i32 *%arr, i32 %n, i32 %bound) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !0
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -477,7 +477,7 @@ define void @test_07(i32 *%arr, i32 %n, i32 %bound) {
; %bound is negative (i.e. in [SINT_MAX + 1, UINT_MAX)). We should be able to
; safely remove this check (see comments in the method
; computeSafeIterationSpace).
-define void @test_08(i32 *%arr, i32 %n, i32 %bound) {
+define void @test_08(ptr %arr, i32 %n, i32 %bound) {
; CHECK-LABEL: @test_08(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FIRST_ITR_CHECK:%.*]] = icmp sgt i32 [[N:%.*]], 0
@@ -499,8 +499,8 @@ define void @test_08(i32 *%arr, i32 %n, i32 %bound) {
; CHECK-NEXT: [[ABC:%.*]] = icmp ult i32 [[IDX]], [[BOUND]]
; CHECK-NEXT: br i1 true, label [[IN_BOUNDS]], label [[OUT_OF_BOUNDS_LOOPEXIT2:%.*]], !prof !0
; CHECK: in.bounds:
-; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, i32* [[ARR:%.*]], i32 [[IDX]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR]], align 4
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ARR:%.*]], i32 [[IDX]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR]], align 4
; CHECK-NEXT: [[NEXT:%.*]] = icmp ult i32 [[IDX_NEXT]], [[N]]
; CHECK-NEXT: [[TMP4:%.*]] = icmp ult i32 [[IDX_NEXT]], [[EXIT_MAINLOOP_AT]]
; CHECK-NEXT: br i1 [[TMP4]], label [[LOOP]], label [[MAIN_EXIT_SELECTOR:%.*]]
@@ -532,8 +532,8 @@ define void @test_08(i32 *%arr, i32 %n, i32 %bound) {
; CHECK-NEXT: [[ABC_POSTLOOP:%.*]] = icmp ult i32 [[IDX_POSTLOOP]], [[BOUND]]
; CHECK-NEXT: br i1 [[ABC_POSTLOOP]], label [[IN_BOUNDS_POSTLOOP]], label [[OUT_OF_BOUNDS_LOOPEXIT:%.*]], !prof !0
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, i32* [[ARR]], i32 [[IDX_POSTLOOP]]
-; CHECK-NEXT: store i32 0, i32* [[ADDR_POSTLOOP]], align 4
+; CHECK-NEXT: [[ADDR_POSTLOOP:%.*]] = getelementptr i32, ptr [[ARR]], i32 [[IDX_POSTLOOP]]
+; CHECK-NEXT: store i32 0, ptr [[ADDR_POSTLOOP]], align 4
; CHECK-NEXT: [[NEXT_POSTLOOP:%.*]] = icmp ult i32 [[IDX_NEXT_POSTLOOP]], [[N]]
; CHECK-NEXT: br i1 [[NEXT_POSTLOOP]], label [[LOOP_POSTLOOP]], label [[EXIT_LOOPEXIT_LOOPEXIT:%.*]], [[LOOP9:!llvm.loop !.*]], !irce.loop.clone !6
;
@@ -548,8 +548,8 @@ define void @test_08(i32 *%arr, i32 %n, i32 %bound) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !0
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/single-access-no-preloop.ll b/llvm/test/Transforms/IRCE/single-access-no-preloop.ll
index 6085ae64bc93b..166f6a5029559 100644
--- a/llvm/test/Transforms/IRCE/single-access-no-preloop.ll
+++ b/llvm/test/Transforms/IRCE/single-access-no-preloop.ll
@@ -1,9 +1,9 @@
; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s
; RUN: opt -verify-loop-info -passes='require<branch-prob>,irce' -S < %s | FileCheck %s
-define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @single_access_no_preloop_no_offset(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -14,8 +14,8 @@ define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -51,15 +51,15 @@ define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: %addr.postloop = getelementptr i32, i32* %arr, i32 %idx.postloop
-; CHECK-NEXT: store i32 0, i32* %addr.postloop
+; CHECK-NEXT: %addr.postloop = getelementptr i32, ptr %arr, i32 %idx.postloop
+; CHECK-NEXT: store i32 0, ptr %addr.postloop
; CHECK-NEXT: %next.postloop = icmp slt i32 %idx.next.postloop, %n
; CHECK-NEXT: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit
-define void @single_access_no_preloop_with_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @single_access_no_preloop_with_offset(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -71,8 +71,8 @@ define void @single_access_no_preloop_with_offset(i32 *%arr, i32 *%a_len_ptr, i3
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx.for.abc
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx.for.abc
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -113,9 +113,9 @@ define void @single_access_no_preloop_with_offset(i32 *%arr, i32 *%a_len_ptr, i3
; Make sure that we do not do IRCE if we know that the safe iteration range of
; the main loop is empty.
-define void @single_access_empty_range(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @single_access_empty_range(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -126,8 +126,8 @@ define void @single_access_empty_range(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -143,9 +143,9 @@ define void @single_access_empty_range(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
; CHECK-NOT: preloop
; CHECK-NOT: postloop
-define void @single_access_empty_range_2(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @single_access_empty_range_2(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -160,8 +160,8 @@ define void @single_access_empty_range_2(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
br i1 %def, label %in.bounds2, label %out.of.bounds, !prof !1
in.bounds2:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -176,16 +176,16 @@ in.bounds2:
; CHECK-NOT: br i1 false
; CHECK-NOT: preloop
-define void @single_access_no_preloop_no_offset_phi_len(i32 *%arr, i32 *%a_len_ptr, i32 *%b_len_ptr, i32 %n, i1 %unknown_cond) {
+define void @single_access_no_preloop_no_offset_phi_len(ptr %arr, ptr %a_len_ptr, ptr %b_len_ptr, i32 %n, i1 %unknown_cond) {
entry:
br i1 %unknown_cond, label %if.true, label %if.false
if.true:
- %len_a = load i32, i32* %a_len_ptr, !range !0
+ %len_a = load i32, ptr %a_len_ptr, !range !0
br label %merge
if.false:
- %len_b = load i32, i32* %b_len_ptr, !range !0
+ %len_b = load i32, ptr %b_len_ptr, !range !0
br label %merge
merge:
@@ -200,8 +200,8 @@ merge:
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -237,8 +237,8 @@ merge:
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: %addr.postloop = getelementptr i32, i32* %arr, i32 %idx.postloop
-; CHECK-NEXT: store i32 0, i32* %addr.postloop
+; CHECK-NEXT: %addr.postloop = getelementptr i32, ptr %arr, i32 %idx.postloop
+; CHECK-NEXT: store i32 0, ptr %addr.postloop
; CHECK-NEXT: %next.postloop = icmp slt i32 %idx.next.postloop, %n
; CHECK-NEXT: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit
diff --git a/llvm/test/Transforms/IRCE/single-access-with-preloop.ll b/llvm/test/Transforms/IRCE/single-access-with-preloop.ll
index 25402483652ea..480e25d8acfaa 100644
--- a/llvm/test/Transforms/IRCE/single-access-with-preloop.ll
+++ b/llvm/test/Transforms/IRCE/single-access-with-preloop.ll
@@ -1,9 +1,9 @@
; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s
; RUN: opt -verify-loop-info -passes='require<branch-prob>,irce' -S < %s | FileCheck %s
-define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %offset) {
+define void @single_access_with_preloop(ptr %arr, ptr %a_len_ptr, i32 %n, i32 %offset) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -17,8 +17,8 @@ define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %array.idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %array.idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/skip-profitability-checks.ll b/llvm/test/Transforms/IRCE/skip-profitability-checks.ll
index 5daf6321bf48e..e8d84e253c941 100644
--- a/llvm/test/Transforms/IRCE/skip-profitability-checks.ll
+++ b/llvm/test/Transforms/IRCE/skip-profitability-checks.ll
@@ -1,11 +1,11 @@
; RUN: opt -irce-skip-profitability-checks -S -verify-loop-info -irce < %s | FileCheck %s
; RUN: opt -irce-skip-profitability-checks -S -verify-loop-info -passes='require<branch-prob>,irce' < %s | FileCheck %s
-define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @single_access_no_preloop_no_offset(ptr %arr, ptr %a_len_ptr, i32 %n) {
; CHECK-LABEL: @single_access_no_preloop_no_offset(
; CHECK: main.exit.selector:
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -16,8 +16,8 @@ define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/stride_more_than_1.ll b/llvm/test/Transforms/IRCE/stride_more_than_1.ll
index 1700462f06948..556c94e56534c 100644
--- a/llvm/test/Transforms/IRCE/stride_more_than_1.ll
+++ b/llvm/test/Transforms/IRCE/stride_more_than_1.ll
@@ -11,11 +11,11 @@
; CHECK: irce: in function test_08: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
; IV = 0; IV <s 100; IV += 7; 0 <= Len <= 50. IRCE is allowed.
-define void @test_01(i32* %arr, i32* %a_len_ptr) {
+define void @test_01(ptr %arr, ptr %a_len_ptr) {
; CHECK: @test_01(
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr
; CHECK-NEXT: [[COND1:%[^ ]+]] = icmp slt i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND1]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop.preheader:
@@ -26,8 +26,8 @@ define void @test_01(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc = icmp slt i32 %idx, %exit.mainloop.at
; CHECK-NEXT: br i1 true, label %in.bounds, label %out.of.bounds.loopexit1
; CHECK: in.bounds:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %next = icmp slt i32 %idx.next, 100
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp slt i32 %idx.next, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND2]], label %loop, label %main.exit.selector
@@ -47,13 +47,13 @@ define void @test_01(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc.postloop = icmp slt i32 %idx.postloop, %exit.mainloop.at
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: %addr.postloop = getelementptr i32, i32* %arr, i32 %idx.postloop
-; CHECK-NEXT: store i32 0, i32* %addr.postloop
+; CHECK-NEXT: %addr.postloop = getelementptr i32, ptr %arr, i32 %idx.postloop
+; CHECK-NEXT: store i32 0, ptr %addr.postloop
; CHECK-NEXT: %next.postloop = icmp slt i32 %idx.next.postloop, 100
; CHECK-NEXT: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -63,8 +63,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 100
br i1 %next, label %loop, label %exit
@@ -76,11 +76,11 @@ exit:
}
; IV = 0; IV <s MAX_INT - 7; IV += 7; 0 <= Len <= 50. IRCE is allowed.
-define void @test_02(i32* %arr, i32* %a_len_ptr) {
+define void @test_02(ptr %arr, ptr %a_len_ptr) {
; CHECK: @test_02(
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr
; CHECK-NEXT: [[COND1:%[^ ]+]] = icmp slt i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND1]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop.preheader:
@@ -91,8 +91,8 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc = icmp slt i32 %idx, %exit.mainloop.at
; CHECK-NEXT: br i1 true, label %in.bounds, label %out.of.bounds.loopexit1
; CHECK: in.bounds:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %next = icmp slt i32 %idx.next, 2147483640
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp slt i32 %idx.next, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND2]], label %loop, label %main.exit.selector
@@ -112,13 +112,13 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc.postloop = icmp slt i32 %idx.postloop, %exit.mainloop.at
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: %addr.postloop = getelementptr i32, i32* %arr, i32 %idx.postloop
-; CHECK-NEXT: store i32 0, i32* %addr.postloop
+; CHECK-NEXT: %addr.postloop = getelementptr i32, ptr %arr, i32 %idx.postloop
+; CHECK-NEXT: store i32 0, ptr %addr.postloop
; CHECK-NEXT: %next.postloop = icmp slt i32 %idx.next.postloop, 2147483640
; CHECK-NEXT: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -128,8 +128,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 2147483640
br i1 %next, label %loop, label %exit
@@ -142,11 +142,11 @@ exit:
; IV = 0; IV <s MAX_INT; IV += 7; 0 <= Len <= MAX_INT - 7. This is the greatest
; value of Len for which IRCE is allowed.
-define void @test_03(i32* %arr, i32* %a_len_ptr) {
+define void @test_03(ptr %arr, ptr %a_len_ptr) {
; CHECK: @test_03(
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr
; CHECK-NEXT: [[COND1:%[^ ]+]] = icmp slt i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND1]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop.preheader:
@@ -157,8 +157,8 @@ define void @test_03(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc = icmp slt i32 %idx, %exit.mainloop.at
; CHECK-NEXT: br i1 true, label %in.bounds, label %out.of.bounds.loopexit1
; CHECK: in.bounds:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %next = icmp slt i32 %idx.next, 2147483647
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp slt i32 %idx.next, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND2]], label %loop, label %main.exit.selector
@@ -178,13 +178,13 @@ define void @test_03(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc.postloop = icmp slt i32 %idx.postloop, %exit.mainloop.at
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
; CHECK: in.bounds.postloop:
-; CHECK-NEXT: %addr.postloop = getelementptr i32, i32* %arr, i32 %idx.postloop
-; CHECK-NEXT: store i32 0, i32* %addr.postloop
+; CHECK-NEXT: %addr.postloop = getelementptr i32, ptr %arr, i32 %idx.postloop
+; CHECK-NEXT: store i32 0, ptr %addr.postloop
; CHECK-NEXT: %next.postloop = icmp slt i32 %idx.next.postloop, 2147483647
; CHECK-NEXT: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !1
+ %len = load i32, ptr %a_len_ptr, !range !1
br label %loop
loop:
@@ -194,8 +194,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 2147483647
br i1 %next, label %loop, label %exit
@@ -209,7 +209,7 @@ exit:
; IV = 0; IV <s MAX_INT; IV += 7; 0 <= Len <= MAX_INT - 6. IRCE is allowed
; because the branch would fail once idx.next == MAX_INT - 1 keeping the
; access in bounds.
-define void @test_04(i32* %arr, i32* %a_len_ptr) {
+define void @test_04(ptr %arr, ptr %a_len_ptr) {
; CHECK: @test_04(
; CHECK: loop:
; CHECK: [[IV:%[^ ]+]] = phi i32
@@ -226,7 +226,7 @@ define void @test_04(i32* %arr, i32* %a_len_ptr) {
; CHECK: br i1 [[COND_POST]], label %in.bounds.postloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !2
+ %len = load i32, ptr %a_len_ptr, !range !2
br label %loop
loop:
@@ -236,8 +236,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, 2147483647
br i1 %next, label %loop, label %exit
@@ -249,11 +249,11 @@ exit:
}
; IV = 100; IV >s -1; IV -= 7; 0 <= Len <= 50. IRCE is allowed.
-define void @test_05(i32* %arr, i32* %a_len_ptr) {
+define void @test_05(ptr %arr, ptr %a_len_ptr) {
; CHECK: @test_05(
; CHECK: entry:
-; CHECK-NEXT: %len = load i32, i32* %a_len_ptr
+; CHECK-NEXT: %len = load i32, ptr %a_len_ptr
; CHECK-NEXT: %exit.preloop.at = add nsw i32 %len, -1
; CHECK-NEXT: [[COND1:%[^ ]+]] = icmp sgt i32 100, %exit.preloop.at
; CHECK-NEXT: br i1 [[COND1]], label %loop.preloop.preheader, label %preloop.pseudo.exit
@@ -267,8 +267,8 @@ define void @test_05(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc = icmp slt i32 %idx, %len
; CHECK-NEXT: br i1 true, label %in.bounds, label %out.of.bounds.loopexit1
; CHECK: in.bounds:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %next = icmp sgt i32 %idx.next, -1
; CHECK-NEXT: br i1 %next, label %loop, label %exit.loopexit
; CHECK: loop.preloop:
@@ -277,8 +277,8 @@ define void @test_05(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc.preloop = icmp slt i32 %idx.preloop, %len
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
; CHECK: in.bounds.preloop:
-; CHECK-NEXT: %addr.preloop = getelementptr i32, i32* %arr, i32 %idx.preloop
-; CHECK-NEXT: store i32 0, i32* %addr.preloop
+; CHECK-NEXT: %addr.preloop = getelementptr i32, ptr %arr, i32 %idx.preloop
+; CHECK-NEXT: store i32 0, ptr %addr.preloop
; CHECK-NEXT: %next.preloop = icmp sgt i32 %idx.next.preloop, -1
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp sgt i32 %idx.next.preloop, %exit.preloop.at
; CHECK-NEXT: br i1 [[COND2]], label %loop.preloop, label %preloop.exit.selector
@@ -292,7 +292,7 @@ define void @test_05(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: br label %mainloop
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -302,8 +302,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp sgt i32 %idx.next, -1
br i1 %next, label %loop, label %exit
@@ -315,11 +315,11 @@ exit:
}
; IV = MAX_INT - 7; IV >u 6; IV -= 7; 10 <= Len <= 50. IRCE is allowed.
-define void @test_06(i32* %arr, i32* %a_len_ptr) {
+define void @test_06(ptr %arr, ptr %a_len_ptr) {
; CHECK: @test_06(
; CHECK: entry:
-; CHECK-NEXT: %len = load i32, i32* %a_len_ptr
+; CHECK-NEXT: %len = load i32, ptr %a_len_ptr
; CHECK-NEXT: %exit.preloop.at = add nsw i32 %len, -1
; CHECK-NEXT: [[COND1:%[^ ]+]] = icmp ugt i32 2147483640, %exit.preloop.at
; CHECK-NEXT: br i1 [[COND1]], label %loop.preloop.preheader, label %preloop.pseudo.exit
@@ -333,8 +333,8 @@ define void @test_06(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc = icmp slt i32 %idx, %len
; CHECK-NEXT: br i1 true, label %in.bounds, label %out.of.bounds.loopexit1
; CHECK: in.bounds:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %next = icmp ugt i32 %idx.next, 6
; CHECK-NEXT: br i1 %next, label %loop, label %exit.loopexit
; CHECK: loop.preloop:
@@ -343,8 +343,8 @@ define void @test_06(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc.preloop = icmp slt i32 %idx.preloop, %len
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
; CHECK: in.bounds.preloop:
-; CHECK-NEXT: %addr.preloop = getelementptr i32, i32* %arr, i32 %idx.preloop
-; CHECK-NEXT: store i32 0, i32* %addr.preloop
+; CHECK-NEXT: %addr.preloop = getelementptr i32, ptr %arr, i32 %idx.preloop
+; CHECK-NEXT: store i32 0, ptr %addr.preloop
; CHECK-NEXT: %next.preloop = icmp ugt i32 %idx.next.preloop, 6
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp ugt i32 %idx.next.preloop, %exit.preloop.at
; CHECK-NEXT: br i1 [[COND2]], label %loop.preloop, label %preloop.exit.selector
@@ -358,7 +358,7 @@ define void @test_06(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: br label %mainloop
entry:
- %len = load i32, i32* %a_len_ptr, !range !3
+ %len = load i32, ptr %a_len_ptr, !range !3
br label %loop
loop:
@@ -368,8 +368,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 6
br i1 %next, label %loop, label %exit
@@ -382,12 +382,12 @@ exit:
; IV = MAX_INT - 7; IV >u 5; IV -= 7; 10 <= Len <= 50. IRCE is not allowed,
; because we can cross the 0 border.
-define void @test_07(i32* %arr, i32* %a_len_ptr) {
+define void @test_07(ptr %arr, ptr %a_len_ptr) {
; CHECK: @test_07(
entry:
- %len = load i32, i32* %a_len_ptr, !range !3
+ %len = load i32, ptr %a_len_ptr, !range !3
br label %loop
loop:
@@ -397,8 +397,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 5
br i1 %next, label %loop, label %exit
@@ -410,11 +410,11 @@ exit:
}
; IV = MAX_INT; IV >u 6; IV -= 7; 10 <= Len <= 50. IRCE is allowed.
-define void @test_08(i32* %arr, i32* %a_len_ptr) {
+define void @test_08(ptr %arr, ptr %a_len_ptr) {
; CHECK: @test_08(
; CHECK: entry:
-; CHECK-NEXT: %len = load i32, i32* %a_len_ptr
+; CHECK-NEXT: %len = load i32, ptr %a_len_ptr
; CHECK-NEXT: %exit.preloop.at = add nsw i32 %len, -1
; CHECK-NEXT: [[COND1:%[^ ]+]] = icmp ugt i32 2147483647, %exit.preloop.at
; CHECK-NEXT: br i1 [[COND1]], label %loop.preloop.preheader, label %preloop.pseudo.exit
@@ -428,8 +428,8 @@ define void @test_08(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc = icmp slt i32 %idx, %len
; CHECK-NEXT: br i1 true, label %in.bounds, label %out.of.bounds.loopexit1
; CHECK: in.bounds:
-; CHECK-NEXT: %addr = getelementptr i32, i32* %arr, i32 %idx
-; CHECK-NEXT: store i32 0, i32* %addr
+; CHECK-NEXT: %addr = getelementptr i32, ptr %arr, i32 %idx
+; CHECK-NEXT: store i32 0, ptr %addr
; CHECK-NEXT: %next = icmp ugt i32 %idx.next, 6
; CHECK-NEXT: br i1 %next, label %loop, label %exit.loopexit
; CHECK: loop.preloop:
@@ -438,8 +438,8 @@ define void @test_08(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: %abc.preloop = icmp slt i32 %idx.preloop, %len
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
; CHECK: in.bounds.preloop:
-; CHECK-NEXT: %addr.preloop = getelementptr i32, i32* %arr, i32 %idx.preloop
-; CHECK-NEXT: store i32 0, i32* %addr.preloop
+; CHECK-NEXT: %addr.preloop = getelementptr i32, ptr %arr, i32 %idx.preloop
+; CHECK-NEXT: store i32 0, ptr %addr.preloop
; CHECK-NEXT: %next.preloop = icmp ugt i32 %idx.next.preloop, 6
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp ugt i32 %idx.next.preloop, %exit.preloop.at
; CHECK-NEXT: br i1 [[COND2]], label %loop.preloop, label %preloop.exit.selector
@@ -453,7 +453,7 @@ define void @test_08(i32* %arr, i32* %a_len_ptr) {
; CHECK-NEXT: br label %mainloop
entry:
- %len = load i32, i32* %a_len_ptr, !range !3
+ %len = load i32, ptr %a_len_ptr, !range !3
br label %loop
loop:
@@ -463,8 +463,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 6
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/unhandled.ll b/llvm/test/Transforms/IRCE/unhandled.ll
index aec242366b6e0..168b24fb94038 100644
--- a/llvm/test/Transforms/IRCE/unhandled.ll
+++ b/llvm/test/Transforms/IRCE/unhandled.ll
@@ -6,10 +6,10 @@
; Demonstrates that we don't currently handle the general expression
; `A * I + B'.
-define void @general_affine_expressions(i32 *%arr, i32 *%a_len_ptr, i32 %n,
+define void @general_affine_expressions(ptr %arr, ptr %a_len_ptr, i32 %n,
i32 %scale, i32 %offset) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -24,8 +24,8 @@ define void @general_affine_expressions(i32 *%arr, i32 *%a_len_ptr, i32 %n,
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %array.idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %array.idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -39,9 +39,9 @@ define void @general_affine_expressions(i32 *%arr, i32 *%a_len_ptr, i32 %n,
; Check that we do the right thing for a loop that could not be
; simplified due to an indirectbr.
-define void @multiple_latches(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @multiple_latches(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%n.add.1 = add i32 %n, 1
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -54,15 +54,15 @@ define void @multiple_latches(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %continue
continue:
%next2 = icmp slt i32 %idx.next, %n.add.1
- %dest = select i1 %next2, i8* blockaddress(@multiple_latches, %loop), i8* blockaddress(@multiple_latches, %exit)
- indirectbr i8* %dest, [ label %loop, label %exit]
+ %dest = select i1 %next2, ptr blockaddress(@multiple_latches, %loop), ptr blockaddress(@multiple_latches, %exit)
+ indirectbr ptr %dest, [ label %loop, label %exit]
out.of.bounds:
ret void
@@ -71,9 +71,9 @@ define void @multiple_latches(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
ret void
}
-define void @already_cloned(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+define void @already_cloned(ptr %arr, ptr %a_len_ptr, i32 %n) {
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -84,8 +84,8 @@ define void @already_cloned(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit, !irce.loop.clone !{}
diff --git a/llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll b/llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll
index 111604a0cf1d5..4f07068cc811e 100644
--- a/llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll
+++ b/llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll
@@ -9,11 +9,11 @@
; CHECK: irce: in function test_06: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
; UGT condition for increasing loop.
-define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_01(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_01(
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp ult i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop:
@@ -29,7 +29,7 @@ define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -39,8 +39,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 100
br i1 %next, label %exit, label %loop
@@ -52,11 +52,11 @@ exit:
}
; UGT condition for decreasing loop.
-define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_02(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_02(
; CHECK: entry:
-; CHECK-NEXT: %len = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %len = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[UMIN:%[^ ]+]] = call i32 @llvm.umax.i32(i32 %len, i32 1)
; CHECK-NEXT: %exit.preloop.at = add nsw i32 [[UMIN]], -1
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp ugt i32 100, %exit.preloop.at
@@ -76,7 +76,7 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -86,8 +86,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 0
br i1 %next, label %loop, label %exit
@@ -99,11 +99,11 @@ exit:
}
; Check SINT_MAX + 1, test is similar to test_01.
-define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_03(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_03(
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp ult i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop:
@@ -119,7 +119,7 @@ define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -129,8 +129,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 2147483648
br i1 %next, label %exit, label %loop
@@ -142,11 +142,11 @@ exit:
}
; Check SINT_MAX + 1, test is similar to test_02.
-define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_04(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_04(
; CHECK: entry:
-; CHECK-NEXT: %len = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %len = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[UMIN:%[^ ]+]] = call i32 @llvm.umax.i32(i32 %len, i32 1)
; CHECK-NEXT: %exit.preloop.at = add nsw i32 [[UMIN]], -1
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp ugt i32 -2147483648, %exit.preloop.at
@@ -166,7 +166,7 @@ define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -176,8 +176,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 0
br i1 %next, label %loop, label %exit
@@ -189,14 +189,14 @@ exit:
}
; Increasing loop, UINT_MAX. Negative test: we cannot add 1 to UINT_MAX.
-define void @test_05(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_05(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_05(
; CHECK-NOT: loop.preloop:
; CHECK-NOT: loop.postloop:
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -206,8 +206,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 4294967295
br i1 %next, label %exit, label %loop
@@ -219,7 +219,7 @@ exit:
}
; Decreasing loop, UINT_MAX. Positive test.
-define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_06(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_06(
; CHECK: mainloop:
@@ -237,7 +237,7 @@ define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -247,8 +247,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ugt i32 %idx.next, 0
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll b/llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll
index ec2310f4f88da..67bf71ef215b5 100644
--- a/llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll
+++ b/llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll
@@ -12,11 +12,11 @@
; CHECK-NOT: irce: in function test_09: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
; ULT condition for increasing loop.
-define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_01(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_01
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp ult i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop:
@@ -32,7 +32,7 @@ define void @test_01(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -42,8 +42,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 100
br i1 %next, label %loop, label %exit
@@ -55,11 +55,11 @@ exit:
}
; ULT condition for decreasing loops.
-define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_02(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_02(
; CHECK: entry:
-; CHECK-NEXT: %len = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %len = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[UMIN:%[^ ]+]] = call i32 @llvm.umax.i32(i32 %len, i32 1)
; CHECK-NEXT: %exit.preloop.at = add nsw i32 [[UMIN]], -1
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp ugt i32 100, %exit.preloop.at
@@ -79,7 +79,7 @@ define void @test_02(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -89,8 +89,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 1
br i1 %next, label %exit, label %loop
@@ -102,11 +102,11 @@ exit:
}
; Check SINT_MAX.
-define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_03(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_03
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp ult i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop:
@@ -122,7 +122,7 @@ define void @test_03(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -132,8 +132,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 2147483647
br i1 %next, label %loop, label %exit
@@ -145,11 +145,11 @@ exit:
}
; Check SINT_MAX + 1, test is similar to test_01.
-define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_04(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_04
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp ult i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop:
@@ -165,7 +165,7 @@ define void @test_04(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -175,8 +175,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 2147483648
br i1 %next, label %loop, label %exit
@@ -188,10 +188,10 @@ exit:
}
; Check SINT_MAX + 1, test is similar to test_02.
-define void @test_05(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_05(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_05(
; CHECK: entry:
-; CHECK-NEXT: %len = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %len = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[UMIN:%[^ ]+]] = call i32 @llvm.umax.i32(i32 %len, i32 1)
; CHECK-NEXT: %exit.preloop.at = add nsw i32 [[UMIN]], -1
; CHECK-NEXT: [[COND2:%[^ ]+]] = icmp ugt i32 -2147483648, %exit.preloop.at
@@ -211,7 +211,7 @@ define void @test_05(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.preloop, label %in.bounds.preloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -221,8 +221,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 1
br i1 %next, label %exit, label %loop
@@ -234,11 +234,11 @@ exit:
}
; Increasing loop, UINT_MAX. Positive test.
-define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_06(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_06
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp ult i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop:
@@ -254,7 +254,7 @@ define void @test_06(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -264,8 +264,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 4294967295
br i1 %next, label %loop, label %exit
@@ -277,14 +277,14 @@ exit:
}
; Decreasing loop, UINT_MAX. Negative test: we cannot substract -1 from 0.
-define void @test_07(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_07(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_07(
; CHECK-NOT: loop.preloop:
; CHECK-NOT: loop.postloop:
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -294,8 +294,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 0
br i1 %next, label %exit, label %loop
@@ -310,11 +310,11 @@ exit:
; Iteration space [0; UINT_MAX - 99), the fact that SINT_MAX is within this
; range does not prevent us from performing IRCE.
-define void @test_08(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_08(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_08
; CHECK: entry:
-; CHECK-NEXT: %exit.mainloop.at = load i32, i32* %a_len_ptr, align 4, !range !0
+; CHECK-NEXT: %exit.mainloop.at = load i32, ptr %a_len_ptr, align 4, !range !0
; CHECK-NEXT: [[COND:%[^ ]+]] = icmp ult i32 0, %exit.mainloop.at
; CHECK-NEXT: br i1 [[COND]], label %loop.preheader, label %main.pseudo.exit
; CHECK: loop:
@@ -330,7 +330,7 @@ define void @test_08(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds.loopexit
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -340,8 +340,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, -100
br i1 %next, label %loop, label %exit
@@ -355,7 +355,7 @@ exit:
; Walking through the border of unsigned range is not allowed
; (iteration space [-100; 100)). Negative test.
-define void @test_09(i32* %arr, i32* %a_len_ptr) #0 {
+define void @test_09(ptr %arr, ptr %a_len_ptr) #0 {
; CHECK: test_09
; CHECK-NOT: preloop
@@ -364,7 +364,7 @@ define void @test_09(i32* %arr, i32* %a_len_ptr) #0 {
; CHECK-NOT: br i1 true
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
br label %loop
loop:
@@ -374,8 +374,8 @@ loop:
br i1 %abc, label %in.bounds, label %out.of.bounds
in.bounds:
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp ult i32 %idx.next, 100
br i1 %next, label %loop, label %exit
diff --git a/llvm/test/Transforms/IRCE/variable-loop-bounds.ll b/llvm/test/Transforms/IRCE/variable-loop-bounds.ll
index d00d1be0f9960..b28827e7f1f45 100644
--- a/llvm/test/Transforms/IRCE/variable-loop-bounds.ll
+++ b/llvm/test/Transforms/IRCE/variable-loop-bounds.ll
@@ -17,7 +17,7 @@
; CHECK: [[PSEUDO_PHI:%[^ ]+]] = phi i32 [ %inc, %for.inc ]
; CHECK: [[COND:%[^ ]+]] = icmp ult i32 [[PSEUDO_PHI]], %N
; CHECK: br i1 [[COND]], label %main.pseudo.exit, label %for.cond.cleanup.loopexit
-define void @test_inc_eq(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %N) {
+define void @test_inc_eq(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %N) {
entry:
%cmp16 = icmp sgt i32 %N, 0
br i1 %cmp16, label %for.body, label %for.cond.cleanup
@@ -28,24 +28,24 @@ for.cond.cleanup:
for.body:
%i.017 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%cmp1 = icmp ult i32 %i.017, 512
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %i.017
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %i.017
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %i.017
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %i.017
+ %1 = load i32, ptr %arrayidx2, align 4
br i1 %cmp1, label %if.then, label %if.else
if.then:
%sub = sub i32 %0, %1
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %i.017
- %2 = load i32, i32* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %i.017
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %sub, %2
- store i32 %add, i32* %arrayidx3, align 4
+ store i32 %add, ptr %arrayidx3, align 4
br label %for.inc
if.else:
%add6 = add nsw i32 %1, %0
- %arrayidx7 = getelementptr inbounds i32, i32* %a, i32 %i.017
- store i32 %add6, i32* %arrayidx7, align 4
+ %arrayidx7 = getelementptr inbounds i32, ptr %a, i32 %i.017
+ store i32 %add6, ptr %arrayidx7, align 4
br label %for.inc
for.inc:
@@ -59,7 +59,7 @@ for.inc:
; CHECK: [[PSEUDO_PHI:%[^ ]+]] = phi i32 [ %inc, %for.inc ]
; CHECK: [[COND:%[^ ]+]] = icmp ult i32 [[PSEUDO_PHI]], %N
; CHECK: br i1 [[COND]], label %main.pseudo.exit, label %for.cond.cleanup.loopexit
-define void @test_inc_ne(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %N) {
+define void @test_inc_ne(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %N) {
entry:
%cmp16 = icmp sgt i32 %N, 0
br i1 %cmp16, label %for.body, label %for.cond.cleanup
@@ -70,24 +70,24 @@ for.cond.cleanup:
for.body:
%i.017 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%cmp1 = icmp ult i32 %i.017, 512
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %i.017
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %i.017
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %i.017
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %i.017
+ %1 = load i32, ptr %arrayidx2, align 4
br i1 %cmp1, label %if.then, label %if.else
if.then:
%sub = sub i32 %0, %1
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %i.017
- %2 = load i32, i32* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %i.017
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %sub, %2
- store i32 %add, i32* %arrayidx3, align 4
+ store i32 %add, ptr %arrayidx3, align 4
br label %for.inc
if.else:
%add6 = add nsw i32 %1, %0
- %arrayidx7 = getelementptr inbounds i32, i32* %a, i32 %i.017
- store i32 %add6, i32* %arrayidx7, align 4
+ %arrayidx7 = getelementptr inbounds i32, ptr %a, i32 %i.017
+ store i32 %add6, ptr %arrayidx7, align 4
br label %for.inc
for.inc:
@@ -101,7 +101,7 @@ for.inc:
; CHECK: [[PSEUDO_PHI:%[^ ]+]] = phi i32 [ %inc, %for.inc ]
; CHECK: [[COND:%[^ ]+]] = icmp slt i32 [[PSEUDO_PHI]], %N
; CHECK: br i1 [[COND]], label %main.pseudo.exit, label %for.cond.cleanup.loopexit
-define void @test_inc_slt(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %N) {
+define void @test_inc_slt(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %N) {
entry:
%cmp16 = icmp sgt i32 %N, 0
br i1 %cmp16, label %for.body, label %for.cond.cleanup
@@ -112,24 +112,24 @@ for.cond.cleanup:
for.body:
%i.017 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%cmp1 = icmp ult i32 %i.017, 512
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %i.017
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %i.017
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %i.017
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %i.017
+ %1 = load i32, ptr %arrayidx2, align 4
br i1 %cmp1, label %if.then, label %if.else
if.then:
%sub = sub i32 %0, %1
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %i.017
- %2 = load i32, i32* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %i.017
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %sub, %2
- store i32 %add, i32* %arrayidx3, align 4
+ store i32 %add, ptr %arrayidx3, align 4
br label %for.inc
if.else:
%add6 = add nsw i32 %1, %0
- %arrayidx7 = getelementptr inbounds i32, i32* %a, i32 %i.017
- store i32 %add6, i32* %arrayidx7, align 4
+ %arrayidx7 = getelementptr inbounds i32, ptr %a, i32 %i.017
+ store i32 %add6, ptr %arrayidx7, align 4
br label %for.inc
for.inc:
@@ -143,7 +143,7 @@ for.inc:
; CHECK: [[PSEUDO_PHI:%[^ ]+]] = phi i32 [ %inc, %for.inc ]
; CHECK: [[COND:%[^ ]+]] = icmp ult i32 [[PSEUDO_PHI]], %N
; CHECK: br i1 [[COND]], label %main.pseudo.exit, label %for.cond.cleanup.loopexit
-define void @test_inc_ult(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %N) {
+define void @test_inc_ult(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %N) {
entry:
%cmp16 = icmp ugt i32 %N, 0
br i1 %cmp16, label %for.body, label %for.cond.cleanup
@@ -154,24 +154,24 @@ for.cond.cleanup:
for.body:
%i.017 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%cmp1 = icmp ult i32 %i.017, 512
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %i.017
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %i.017
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %i.017
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %i.017
+ %1 = load i32, ptr %arrayidx2, align 4
br i1 %cmp1, label %if.then, label %if.else
if.then:
%sub = sub i32 %0, %1
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %i.017
- %2 = load i32, i32* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %i.017
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %sub, %2
- store i32 %add, i32* %arrayidx3, align 4
+ store i32 %add, ptr %arrayidx3, align 4
br label %for.inc
if.else:
%add6 = add nsw i32 %1, %0
- %arrayidx7 = getelementptr inbounds i32, i32* %a, i32 %i.017
- store i32 %add6, i32* %arrayidx7, align 4
+ %arrayidx7 = getelementptr inbounds i32, ptr %a, i32 %i.017
+ store i32 %add6, ptr %arrayidx7, align 4
br label %for.inc
for.inc:
@@ -185,7 +185,7 @@ for.inc:
; CHECK: [[PSEUDO_PHI:%[^ ]+]] = phi i32 [ %dec, %for.inc ]
; CHECK: [[COND:%[^ ]+]] = icmp sgt i32 [[PSEUDO_PHI]], %M
; CHECK: br i1 [[COND]]
-define void @signed_var_imm_dec_sgt(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %M) {
+define void @signed_var_imm_dec_sgt(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %M) {
entry:
%cmp14 = icmp slt i32 %M, 1024
br i1 %cmp14, label %for.body, label %for.cond.cleanup
@@ -196,22 +196,22 @@ for.cond.cleanup: ; preds = %for.inc, %entry
for.body: ; preds = %entry, %for.inc
%iv = phi i32 [ %dec, %for.inc ], [ 1024, %entry ]
%cmp1 = icmp slt i32 %iv, 1024
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %iv
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %iv
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %iv
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %iv
+ %1 = load i32, ptr %arrayidx2, align 4
%mul = mul nsw i32 %1, %0
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %iv
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %iv
br i1 %cmp1, label %for.inc, label %if.else
if.else: ; preds = %for.body
- %2 = load i32, i32* %arrayidx3, align 4
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %2, %mul
br label %for.inc
for.inc: ; preds = %for.body, %if.else
%storemerge = phi i32 [ %add, %if.else ], [ %mul, %for.body ]
- store i32 %storemerge, i32* %arrayidx3, align 4
+ store i32 %storemerge, ptr %arrayidx3, align 4
%dec = add nsw i32 %iv, -1
%cmp = icmp sgt i32 %dec, %M
br i1 %cmp, label %for.body, label %for.cond.cleanup
@@ -222,7 +222,7 @@ for.inc: ; preds = %for.body, %if.else
; CHECK: [[PSEUDO_PHI:%[^ ]+]] = phi i32 [ %iv, %for.inc ]
; CHECK: [[COND:%[^ ]+]] = icmp sgt i32 [[PSEUDO_PHI]], %M
; CHECK: br i1 [[COND]]
-define void @signed_var_imm_dec_sge(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %M) {
+define void @signed_var_imm_dec_sge(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %M) {
entry:
%cmp14 = icmp sgt i32 %M, 1024
br i1 %cmp14, label %for.cond.cleanup, label %for.body
@@ -233,28 +233,28 @@ for.cond.cleanup: ; preds = %for.inc, %entry
for.body: ; preds = %entry, %for.inc
%iv = phi i32 [ %dec, %for.inc ], [ 1024, %entry ]
%cmp1 = icmp slt i32 %iv, 1024
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %iv
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %iv
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %iv
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %iv
+ %1 = load i32, ptr %arrayidx2, align 4
%mul = mul nsw i32 %1, %0
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %iv
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %iv
br i1 %cmp1, label %for.inc, label %if.else
if.else: ; preds = %for.body
- %2 = load i32, i32* %arrayidx3, align 4
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %2, %mul
br label %for.inc
for.inc: ; preds = %for.body, %if.else
%storemerge = phi i32 [ %add, %if.else ], [ %mul, %for.body ]
- store i32 %storemerge, i32* %arrayidx3, align 4
+ store i32 %storemerge, ptr %arrayidx3, align 4
%dec = add nsw i32 %iv, -1
%cmp = icmp sgt i32 %iv, %M
br i1 %cmp, label %for.body, label %for.cond.cleanup
}
-define void @signed_var_imm_dec_slt(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %M) {
+define void @signed_var_imm_dec_slt(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %M) {
entry:
%cmp14 = icmp sgt i32 %M, 1024
br i1 %cmp14, label %for.cond.cleanup, label %for.body
@@ -265,22 +265,22 @@ for.cond.cleanup: ; preds = %for.inc, %entry
for.body: ; preds = %entry, %for.inc
%iv = phi i32 [ %dec, %for.inc ], [ 1024, %entry ]
%cmp1 = icmp slt i32 %iv, 1024
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %iv
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %iv
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %iv
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %iv
+ %1 = load i32, ptr %arrayidx2, align 4
%mul = mul nsw i32 %1, %0
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %iv
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %iv
br i1 %cmp1, label %for.inc, label %if.else
if.else: ; preds = %for.body
- %2 = load i32, i32* %arrayidx3, align 4
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %2, %mul
br label %for.inc
for.inc: ; preds = %for.body, %if.else
%storemerge = phi i32 [ %add, %if.else ], [ %mul, %for.body ]
- store i32 %storemerge, i32* %arrayidx3, align 4
+ store i32 %storemerge, ptr %arrayidx3, align 4
%dec = add nsw i32 %iv, -1
%cmp = icmp slt i32 %iv, %M
br i1 %cmp, label %for.cond.cleanup, label %for.body
@@ -291,7 +291,7 @@ for.inc: ; preds = %for.body, %if.else
; CHECK: [[PSEUDO_PHI:%[^ ]+]] = phi i32 [ %dec, %for.inc ]
; CHECK: [[COND:%[^ ]+]] = icmp sgt i32 [[PSEUDO_PHI]], %M
; CHECK: br i1 [[COND]]
-define void @signed_var_imm_dec_ne(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %M) {
+define void @signed_var_imm_dec_ne(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %M) {
entry:
%cmp14 = icmp slt i32 %M, 1024
br i1 %cmp14, label %for.body, label %for.cond.cleanup
@@ -302,28 +302,28 @@ for.cond.cleanup: ; preds = %for.inc, %entry
for.body: ; preds = %entry, %for.inc
%iv = phi i32 [ %dec, %for.inc ], [ 1024, %entry ]
%cmp1 = icmp slt i32 %iv, 1024
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %iv
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %iv
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %iv
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %iv
+ %1 = load i32, ptr %arrayidx2, align 4
%mul = mul nsw i32 %1, %0
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %iv
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %iv
br i1 %cmp1, label %for.inc, label %if.else
if.else: ; preds = %for.body
- %2 = load i32, i32* %arrayidx3, align 4
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %2, %mul
br label %for.inc
for.inc: ; preds = %for.body, %if.else
%storemerge = phi i32 [ %add, %if.else ], [ %mul, %for.body ]
- store i32 %storemerge, i32* %arrayidx3, align 4
+ store i32 %storemerge, ptr %arrayidx3, align 4
%dec = add nsw i32 %iv, -1
%cmp = icmp ne i32 %dec, %M
br i1 %cmp, label %for.body, label %for.cond.cleanup
}
-define void @signed_var_imm_dec_eq(i32* nocapture %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %M) {
+define void @signed_var_imm_dec_eq(ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %M) {
entry:
%cmp14 = icmp slt i32 %M, 1024
br i1 %cmp14, label %for.body, label %for.cond.cleanup
@@ -334,22 +334,22 @@ for.cond.cleanup: ; preds = %for.inc, %entry
for.body: ; preds = %entry, %for.inc
%iv = phi i32 [ %dec, %for.inc ], [ 1024, %entry ]
%cmp1 = icmp slt i32 %iv, 1024
- %arrayidx = getelementptr inbounds i32, i32* %b, i32 %iv
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds i32, i32* %c, i32 %iv
- %1 = load i32, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %b, i32 %iv
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32, ptr %c, i32 %iv
+ %1 = load i32, ptr %arrayidx2, align 4
%mul = mul nsw i32 %1, %0
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i32 %iv
+ %arrayidx3 = getelementptr inbounds i32, ptr %a, i32 %iv
br i1 %cmp1, label %for.inc, label %if.else
if.else: ; preds = %for.body
- %2 = load i32, i32* %arrayidx3, align 4
+ %2 = load i32, ptr %arrayidx3, align 4
%add = add nsw i32 %2, %mul
br label %for.inc
for.inc: ; preds = %for.body, %if.else
%storemerge = phi i32 [ %add, %if.else ], [ %mul, %for.body ]
- store i32 %storemerge, i32* %arrayidx3, align 4
+ store i32 %storemerge, ptr %arrayidx3, align 4
%dec = add nsw i32 %iv, -1
%cmp = icmp eq i32 %dec, %M
br i1 %cmp, label %for.cond.cleanup, label %for.body
diff --git a/llvm/test/Transforms/IRCE/wide_indvar.ll b/llvm/test/Transforms/IRCE/wide_indvar.ll
index 528d2da77860f..8707e31c9f253 100644
--- a/llvm/test/Transforms/IRCE/wide_indvar.ll
+++ b/llvm/test/Transforms/IRCE/wide_indvar.ll
@@ -65,7 +65,7 @@ check_failed:
}
; General case. If both %N and %M are non-negative, we do not need a preloop.
-define i32 @test_increasing_slt_slt_wide_non-negative(i32* %n_ptr, i64* %m_ptr) {
+define i32 @test_increasing_slt_slt_wide_non-negative(ptr %n_ptr, ptr %m_ptr) {
; CHECK-LABEL: @test_increasing_slt_slt_wide_non-negative(
; CHECK-NOT: preloop
@@ -77,8 +77,8 @@ define i32 @test_increasing_slt_slt_wide_non-negative(i32* %n_ptr, i64* %m_ptr)
; CHECK: postloop
entry:
- %N = load i32, i32* %n_ptr, !range !2
- %M = load i64, i64* %m_ptr, !range !1
+ %N = load i32, ptr %n_ptr, !range !2
+ %M = load i64, ptr %m_ptr, !range !1
br label %loop
loop:
@@ -102,7 +102,7 @@ check_failed:
; General case. Even though %M may be negative, we do not need a preloop because
; we make a non-negativity runtime check against M and do not go to main loop if
; M was negative.
-define i32 @test_increasing_slt_slt_wide_general(i32* %n_ptr, i64* %m_ptr) {
+define i32 @test_increasing_slt_slt_wide_general(ptr %n_ptr, ptr %m_ptr) {
; CHECK-LABEL: @test_increasing_slt_slt_wide_general(
; CHECK-NOT: preloop
@@ -114,8 +114,8 @@ define i32 @test_increasing_slt_slt_wide_general(i32* %n_ptr, i64* %m_ptr) {
; CHECK: postloop
entry:
- %N = load i32, i32* %n_ptr, !range !2
- %M = load i64, i64* %m_ptr
+ %N = load i32, ptr %n_ptr, !range !2
+ %M = load i64, ptr %m_ptr
br label %loop
loop:
@@ -137,7 +137,7 @@ check_failed:
}
; General case with preloop.
-define i32 @test_increasing_slt_slt_wide_general_preloop(i32* %n_ptr, i64* %m_ptr) {
+define i32 @test_increasing_slt_slt_wide_general_preloop(ptr %n_ptr, ptr %m_ptr) {
; CHECK-LABEL: @test_increasing_slt_slt_wide_general_preloop(
; CHECK: loop:
@@ -149,8 +149,8 @@ define i32 @test_increasing_slt_slt_wide_general_preloop(i32* %n_ptr, i64* %m_pt
; CHECK: postloop
entry:
- %N = load i32, i32* %n_ptr, !range !2
- %M = load i64, i64* %m_ptr
+ %N = load i32, ptr %n_ptr, !range !2
+ %M = load i64, ptr %m_ptr
br label %loop
loop:
@@ -172,7 +172,7 @@ check_failed:
}
; Same as above, multiple checks.
-define i32 @test_increasing_slt_slt_wide_multiple_checks(i32* %n_ptr, i64* %m1_ptr, i64* %m2_ptr, i64* %m3_ptr, i64* %m4_ptr) {
+define i32 @test_increasing_slt_slt_wide_multiple_checks(ptr %n_ptr, ptr %m1_ptr, ptr %m2_ptr, ptr %m3_ptr, ptr %m4_ptr) {
; CHECK-LABEL: @test_increasing_slt_slt_wide_multiple_checks(
; CHECK-NOT: preloop
; CHECK: loop:
@@ -186,11 +186,11 @@ define i32 @test_increasing_slt_slt_wide_multiple_checks(i32* %n_ptr, i64* %m1_p
; CHECK: postloop
entry:
- %N = load i32, i32* %n_ptr, !range !2
- %M1 = load i64, i64* %m1_ptr
- %M2 = load i64, i64* %m2_ptr
- %M3 = load i64, i64* %m3_ptr
- %M4 = load i64, i64* %m4_ptr
+ %N = load i32, ptr %n_ptr, !range !2
+ %M1 = load i64, ptr %m1_ptr
+ %M2 = load i64, ptr %m2_ptr
+ %M3 = load i64, ptr %m3_ptr
+ %M4 = load i64, ptr %m4_ptr
br label %loop
loop:
@@ -309,7 +309,7 @@ check_failed:
}
; General case. If both %N and %M are non-negative, we do not need a preloop.
-define i32 @test_increasing_ult_ult_wide_non-negative(i32* %n_ptr, i64* %m_ptr) {
+define i32 @test_increasing_ult_ult_wide_non-negative(ptr %n_ptr, ptr %m_ptr) {
; CHECK-LABEL: @test_increasing_ult_ult_wide_non-negative(
; CHECK-NOT: preloop
@@ -321,8 +321,8 @@ define i32 @test_increasing_ult_ult_wide_non-negative(i32* %n_ptr, i64* %m_ptr)
; CHECK: postloop
entry:
- %N = load i32, i32* %n_ptr, !range !2
- %M = load i64, i64* %m_ptr, !range !1
+ %N = load i32, ptr %n_ptr, !range !2
+ %M = load i64, ptr %m_ptr, !range !1
br label %loop
loop:
@@ -346,7 +346,7 @@ check_failed:
; General case. Even though %M may be negative, we do not need a preloop because
; we make a non-negativity runtime check against M and do not go to main loop if
; M was negative.
-define i32 @test_increasing_ult_ult_wide_general(i32* %n_ptr, i64* %m_ptr) {
+define i32 @test_increasing_ult_ult_wide_general(ptr %n_ptr, ptr %m_ptr) {
; CHECK-LABEL: @test_increasing_ult_ult_wide_general(
; CHECK-NOT: preloop
@@ -358,8 +358,8 @@ define i32 @test_increasing_ult_ult_wide_general(i32* %n_ptr, i64* %m_ptr) {
; CHECK: postloop
entry:
- %N = load i32, i32* %n_ptr, !range !2
- %M = load i64, i64* %m_ptr
+ %N = load i32, ptr %n_ptr, !range !2
+ %M = load i64, ptr %m_ptr
br label %loop
loop:
@@ -381,7 +381,7 @@ check_failed:
}
; Same as above, multiple checks.
-define i32 @test_increasing_ult_ult_wide_multiple_checks(i32* %n_ptr, i64* %m1_ptr, i64* %m2_ptr, i64* %m3_ptr, i64* %m4_ptr) {
+define i32 @test_increasing_ult_ult_wide_multiple_checks(ptr %n_ptr, ptr %m1_ptr, ptr %m2_ptr, ptr %m3_ptr, ptr %m4_ptr) {
; CHECK-LABEL: @test_increasing_ult_ult_wide_multiple_checks(
; CHECK-NOT: preloop
; CHECK: loop:
@@ -395,11 +395,11 @@ define i32 @test_increasing_ult_ult_wide_multiple_checks(i32* %n_ptr, i64* %m1_p
; CHECK: postloop
entry:
- %N = load i32, i32* %n_ptr, !range !2
- %M1 = load i64, i64* %m1_ptr
- %M2 = load i64, i64* %m2_ptr
- %M3 = load i64, i64* %m3_ptr
- %M4 = load i64, i64* %m4_ptr
+ %N = load i32, ptr %n_ptr, !range !2
+ %M1 = load i64, ptr %m1_ptr
+ %M2 = load i64, ptr %m2_ptr
+ %M3 = load i64, ptr %m3_ptr
+ %M4 = load i64, ptr %m4_ptr
br label %loop
loop:
diff --git a/llvm/test/Transforms/IRCE/with-parent-loops.ll b/llvm/test/Transforms/IRCE/with-parent-loops.ll
index c4d0daaf2507b..02c8d49ca2b0b 100644
--- a/llvm/test/Transforms/IRCE/with-parent-loops.ll
+++ b/llvm/test/Transforms/IRCE/with-parent-loops.ll
@@ -5,11 +5,11 @@
; of parents, uncles and cousins.
; Function Attrs: alwaysinline
-define void @inner_loop(i32* %arr, i32* %a_len_ptr, i32 %n) #0 {
+define void @inner_loop(ptr %arr, ptr %a_len_ptr, i32 %n) #0 {
; CHECK: irce: in function inner_loop: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
entry:
- %len = load i32, i32* %a_len_ptr, !range !0
+ %len = load i32, ptr %a_len_ptr, !range !0
%first.itr.check = icmp sgt i32 %n, 0
br i1 %first.itr.check, label %loop, label %exit
@@ -20,8 +20,8 @@ loop: ; preds = %in.bounds, %entry
br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
in.bounds: ; preds = %loop
- %addr = getelementptr i32, i32* %arr, i32 %idx
- store i32 0, i32* %addr
+ %addr = getelementptr i32, ptr %arr, i32 %idx
+ store i32 0, ptr %addr
%next = icmp slt i32 %idx.next, %n
br i1 %next, label %loop, label %exit
@@ -33,7 +33,7 @@ exit: ; preds = %in.bounds, %entry
}
; Function Attrs: alwaysinline
-define void @with_parent(i32* %arr, i32* %a_len_ptr, i32 %n, i32 %parent.count) #0 {
+define void @with_parent(ptr %arr, ptr %a_len_ptr, i32 %n, i32 %parent.count) #0 {
; CHECK: irce: in function with_parent: constrained Loop at depth 2 containing: %loop.i<header><exiting>,%in.bounds.i<latch><exiting>
entry:
@@ -43,7 +43,7 @@ loop: ; preds = %inner_loop.exit, %e
%idx = phi i32 [ 0, %entry ], [ %idx.next, %inner_loop.exit ]
%idx.next = add i32 %idx, 1
%next = icmp ult i32 %idx.next, %parent.count
- %len.i = load i32, i32* %a_len_ptr, !range !0
+ %len.i = load i32, ptr %a_len_ptr, !range !0
%first.itr.check.i = icmp sgt i32 %n, 0
br i1 %first.itr.check.i, label %loop.i, label %exit.i
@@ -54,8 +54,8 @@ loop.i: ; preds = %in.bounds.i, %loop
br i1 %abc.i, label %in.bounds.i, label %out.of.bounds.i, !prof !1
in.bounds.i: ; preds = %loop.i
- %addr.i = getelementptr i32, i32* %arr, i32 %idx.i
- store i32 0, i32* %addr.i
+ %addr.i = getelementptr i32, ptr %arr, i32 %idx.i
+ store i32 0, ptr %addr.i
%next.i = icmp slt i32 %idx.next.i, %n
br i1 %next.i, label %loop.i, label %exit.i
@@ -73,7 +73,7 @@ exit: ; preds = %inner_loop.exit
}
; Function Attrs: alwaysinline
-define void @with_grandparent(i32* %arr, i32* %a_len_ptr, i32 %n, i32 %parent.count, i32 %grandparent.count) #0 {
+define void @with_grandparent(ptr %arr, ptr %a_len_ptr, i32 %n, i32 %parent.count, i32 %grandparent.count) #0 {
; CHECK: irce: in function with_grandparent: constrained Loop at depth 3 containing: %loop.i.i<header><exiting>,%in.bounds.i.i<latch><exiting>
entry:
@@ -89,7 +89,7 @@ loop.i: ; preds = %inner_loop.exit.i,
%idx.i = phi i32 [ 0, %loop ], [ %idx.next.i, %inner_loop.exit.i ]
%idx.next.i = add i32 %idx.i, 1
%next.i = icmp ult i32 %idx.next.i, %parent.count
- %len.i.i = load i32, i32* %a_len_ptr, !range !0
+ %len.i.i = load i32, ptr %a_len_ptr, !range !0
%first.itr.check.i.i = icmp sgt i32 %n, 0
br i1 %first.itr.check.i.i, label %loop.i.i, label %exit.i.i
@@ -100,8 +100,8 @@ loop.i.i: ; preds = %in.bounds.i.i, %loo
br i1 %abc.i.i, label %in.bounds.i.i, label %out.of.bounds.i.i, !prof !1
in.bounds.i.i: ; preds = %loop.i.i
- %addr.i.i = getelementptr i32, i32* %arr, i32 %idx.i.i
- store i32 0, i32* %addr.i.i
+ %addr.i.i = getelementptr i32, ptr %arr, i32 %idx.i.i
+ store i32 0, ptr %addr.i.i
%next.i.i = icmp slt i32 %idx.next.i.i, %n
br i1 %next.i.i, label %loop.i.i, label %exit.i.i
@@ -122,7 +122,7 @@ exit: ; preds = %with_parent.exit
}
; Function Attrs: alwaysinline
-define void @with_sibling(i32* %arr, i32* %a_len_ptr, i32 %n, i32 %parent.count) #0 {
+define void @with_sibling(ptr %arr, ptr %a_len_ptr, i32 %n, i32 %parent.count) #0 {
; CHECK: irce: in function with_sibling: constrained Loop at depth 2 containing: %loop.i<header><exiting>,%in.bounds.i<latch><exiting>
; CHECK: irce: in function with_sibling: constrained Loop at depth 2 containing: %loop.i6<header><exiting>,%in.bounds.i9<latch><exiting>
@@ -133,7 +133,7 @@ loop: ; preds = %inner_loop.exit12,
%idx = phi i32 [ 0, %entry ], [ %idx.next, %inner_loop.exit12 ]
%idx.next = add i32 %idx, 1
%next = icmp ult i32 %idx.next, %parent.count
- %len.i = load i32, i32* %a_len_ptr, !range !0
+ %len.i = load i32, ptr %a_len_ptr, !range !0
%first.itr.check.i = icmp sgt i32 %n, 0
br i1 %first.itr.check.i, label %loop.i, label %exit.i
@@ -144,8 +144,8 @@ loop.i: ; preds = %in.bounds.i, %loop
br i1 %abc.i, label %in.bounds.i, label %out.of.bounds.i, !prof !1
in.bounds.i: ; preds = %loop.i
- %addr.i = getelementptr i32, i32* %arr, i32 %idx.i
- store i32 0, i32* %addr.i
+ %addr.i = getelementptr i32, ptr %arr, i32 %idx.i
+ store i32 0, ptr %addr.i
%next.i = icmp slt i32 %idx.next.i, %n
br i1 %next.i, label %loop.i, label %exit.i
@@ -156,7 +156,7 @@ exit.i: ; preds = %in.bounds.i, %loop
br label %inner_loop.exit
inner_loop.exit: ; preds = %exit.i, %out.of.bounds.i
- %len.i1 = load i32, i32* %a_len_ptr, !range !0
+ %len.i1 = load i32, ptr %a_len_ptr, !range !0
%first.itr.check.i2 = icmp sgt i32 %n, 0
br i1 %first.itr.check.i2, label %loop.i6, label %exit.i11
@@ -167,8 +167,8 @@ loop.i6: ; preds = %in.bounds.i9, %inne
br i1 %abc.i5, label %in.bounds.i9, label %out.of.bounds.i10, !prof !1
in.bounds.i9: ; preds = %loop.i6
- %addr.i7 = getelementptr i32, i32* %arr, i32 %idx.i3
- store i32 0, i32* %addr.i7
+ %addr.i7 = getelementptr i32, ptr %arr, i32 %idx.i3
+ store i32 0, ptr %addr.i7
%next.i8 = icmp slt i32 %idx.next.i4, %n
br i1 %next.i8, label %loop.i6, label %exit.i11
@@ -186,7 +186,7 @@ exit: ; preds = %inner_loop.exit12
}
; Function Attrs: alwaysinline
-define void @with_cousin(i32* %arr, i32* %a_len_ptr, i32 %n, i32 %parent.count, i32 %grandparent.count) #0 {
+define void @with_cousin(ptr %arr, ptr %a_len_ptr, i32 %n, i32 %parent.count, i32 %grandparent.count) #0 {
; CHECK: irce: in function with_cousin: constrained Loop at depth 3 containing: %loop.i.i<header><exiting>,%in.bounds.i.i<latch><exiting>
; CHECK: irce: in function with_cousin: constrained Loop at depth 3 containing: %loop.i.i10<header><exiting>,%in.bounds.i.i13<latch><exiting>
@@ -203,7 +203,7 @@ loop.i: ; preds = %inner_loop.exit.i,
%idx.i = phi i32 [ 0, %loop ], [ %idx.next.i, %inner_loop.exit.i ]
%idx.next.i = add i32 %idx.i, 1
%next.i = icmp ult i32 %idx.next.i, %parent.count
- %len.i.i = load i32, i32* %a_len_ptr, !range !0
+ %len.i.i = load i32, ptr %a_len_ptr, !range !0
%first.itr.check.i.i = icmp sgt i32 %n, 0
br i1 %first.itr.check.i.i, label %loop.i.i, label %exit.i.i
@@ -214,8 +214,8 @@ loop.i.i: ; preds = %in.bounds.i.i, %loo
br i1 %abc.i.i, label %in.bounds.i.i, label %out.of.bounds.i.i, !prof !1
in.bounds.i.i: ; preds = %loop.i.i
- %addr.i.i = getelementptr i32, i32* %arr, i32 %idx.i.i
- store i32 0, i32* %addr.i.i
+ %addr.i.i = getelementptr i32, ptr %arr, i32 %idx.i.i
+ store i32 0, ptr %addr.i.i
%next.i.i = icmp slt i32 %idx.next.i.i, %n
br i1 %next.i.i, label %loop.i.i, label %exit.i.i
@@ -235,7 +235,7 @@ loop.i6: ; preds = %inner_loop.exit.i16
%idx.i1 = phi i32 [ 0, %with_parent.exit ], [ %idx.next.i2, %inner_loop.exit.i16 ]
%idx.next.i2 = add i32 %idx.i1, 1
%next.i3 = icmp ult i32 %idx.next.i2, %parent.count
- %len.i.i4 = load i32, i32* %a_len_ptr, !range !0
+ %len.i.i4 = load i32, ptr %a_len_ptr, !range !0
%first.itr.check.i.i5 = icmp sgt i32 %n, 0
br i1 %first.itr.check.i.i5, label %loop.i.i10, label %exit.i.i15
@@ -246,8 +246,8 @@ loop.i.i10: ; preds = %in.bounds.i.i13, %l
br i1 %abc.i.i9, label %in.bounds.i.i13, label %out.of.bounds.i.i14, !prof !1
in.bounds.i.i13: ; preds = %loop.i.i10
- %addr.i.i11 = getelementptr i32, i32* %arr, i32 %idx.i.i7
- store i32 0, i32* %addr.i.i11
+ %addr.i.i11 = getelementptr i32, ptr %arr, i32 %idx.i.i7
+ store i32 0, ptr %addr.i.i11
%next.i.i12 = icmp slt i32 %idx.next.i.i8, %n
br i1 %next.i.i12, label %loop.i.i10, label %exit.i.i15
@@ -268,7 +268,7 @@ exit: ; preds = %with_parent.exit17
}
; Function Attrs: alwaysinline
-define void @with_uncle(i32* %arr, i32* %a_len_ptr, i32 %n, i32 %parent.count, i32 %grandparent.count) #0 {
+define void @with_uncle(ptr %arr, ptr %a_len_ptr, i32 %n, i32 %parent.count, i32 %grandparent.count) #0 {
; CHECK: irce: in function with_uncle: constrained Loop at depth 2 containing: %loop.i<header><exiting>,%in.bounds.i<latch><exiting>
; CHECK: irce: in function with_uncle: constrained Loop at depth 3 containing: %loop.i.i<header><exiting>,%in.bounds.i.i<latch><exiting>
@@ -279,7 +279,7 @@ loop: ; preds = %with_parent.exit, %
%idx = phi i32 [ 0, %entry ], [ %idx.next, %with_parent.exit ]
%idx.next = add i32 %idx, 1
%next = icmp ult i32 %idx.next, %grandparent.count
- %len.i = load i32, i32* %a_len_ptr, !range !0
+ %len.i = load i32, ptr %a_len_ptr, !range !0
%first.itr.check.i = icmp sgt i32 %n, 0
br i1 %first.itr.check.i, label %loop.i, label %exit.i
@@ -290,8 +290,8 @@ loop.i: ; preds = %in.bounds.i, %loop
br i1 %abc.i, label %in.bounds.i, label %out.of.bounds.i, !prof !1
in.bounds.i: ; preds = %loop.i
- %addr.i = getelementptr i32, i32* %arr, i32 %idx.i
- store i32 0, i32* %addr.i
+ %addr.i = getelementptr i32, ptr %arr, i32 %idx.i
+ store i32 0, ptr %addr.i
%next.i = icmp slt i32 %idx.next.i, %n
br i1 %next.i, label %loop.i, label %exit.i
@@ -308,7 +308,7 @@ loop.i4: ; preds = %inner_loop.exit.i,
%idx.i1 = phi i32 [ 0, %inner_loop.exit ], [ %idx.next.i2, %inner_loop.exit.i ]
%idx.next.i2 = add i32 %idx.i1, 1
%next.i3 = icmp ult i32 %idx.next.i2, %parent.count
- %len.i.i = load i32, i32* %a_len_ptr, !range !0
+ %len.i.i = load i32, ptr %a_len_ptr, !range !0
%first.itr.check.i.i = icmp sgt i32 %n, 0
br i1 %first.itr.check.i.i, label %loop.i.i, label %exit.i.i
@@ -319,8 +319,8 @@ loop.i.i: ; preds = %in.bounds.i.i, %loo
br i1 %abc.i.i, label %in.bounds.i.i, label %out.of.bounds.i.i, !prof !1
in.bounds.i.i: ; preds = %loop.i.i
- %addr.i.i = getelementptr i32, i32* %arr, i32 %idx.i.i
- store i32 0, i32* %addr.i.i
+ %addr.i.i = getelementptr i32, ptr %arr, i32 %idx.i.i
+ store i32 0, ptr %addr.i.i
%next.i.i = icmp slt i32 %idx.next.i.i, %n
br i1 %next.i.i, label %loop.i.i, label %exit.i.i
More information about the llvm-commits
mailing list