[llvm] f30f34e - [LoopReroll] Convert tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 25 03:57:46 PDT 2023
Author: Nikita Popov
Date: 2023-04-25T12:57:05+02:00
New Revision: f30f34e6ba411c43315f9065860a51c23ce4136a
URL: https://github.com/llvm/llvm-project/commit/f30f34e6ba411c43315f9065860a51c23ce4136a
DIFF: https://github.com/llvm/llvm-project/commit/f30f34e6ba411c43315f9065860a51c23ce4136a.diff
LOG: [LoopReroll] Convert tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/LoopReroll/basic.ll
llvm/test/Transforms/LoopReroll/extra_instr.ll
llvm/test/Transforms/LoopReroll/ptrindvar.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LoopReroll/basic.ll b/llvm/test/Transforms/LoopReroll/basic.ll
index 13fb1236b263..92d345650575 100644
--- a/llvm/test/Transforms/LoopReroll/basic.ll
+++ b/llvm/test/Transforms/LoopReroll/basic.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt -opaque-pointers=0 < %s -passes=loop-reroll -S | FileCheck %s
+; RUN: opt < %s -passes=loop-reroll -S | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@@ -12,9 +12,9 @@ target triple = "x86_64-unknown-linux-gnu"
; }
; }
-define void @bar(i32* nocapture readnone %x) #0 {
+define void @bar(ptr nocapture readnone %x) #0 {
; CHECK-LABEL: define void @bar
-; CHECK-SAME: (i32* nocapture readnone [[X:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (ptr nocapture readnone [[X:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
@@ -55,17 +55,17 @@ declare i32 @foo(i32)
; }
; Function Attrs: nounwind uwtable
-define void @hi1(i32* nocapture %x) #0 {
+define void @hi1(ptr nocapture %x) #0 {
; CHECK-LABEL: define void @hi1
-; CHECK-SAME: (i32* nocapture [[X:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture [[X:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVAR:%.*]] = phi i64 [ [[INDVAR_NEXT:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[TMP0:%.*]] = trunc i64 [[INDVAR]] to i32
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @foo(i32 0) #[[ATTR1]]
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[X]], i64 [[INDVAR]]
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[X]], i64 [[INDVAR]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[INDVAR]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP0]], 1499
; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -78,16 +78,16 @@ entry:
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%call = tail call i32 @foo(i32 0) #1
- %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvars.iv
- store i32 %call, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv
+ store i32 %call, ptr %arrayidx, align 4
%call1 = tail call i32 @foo(i32 0) #1
%0 = add nsw i64 %indvars.iv, 1
- %arrayidx3 = getelementptr inbounds i32, i32* %x, i64 %0
- store i32 %call1, i32* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds i32, ptr %x, i64 %0
+ store i32 %call1, ptr %arrayidx3, align 4
%call4 = tail call i32 @foo(i32 0) #1
%1 = add nsw i64 %indvars.iv, 2
- %arrayidx7 = getelementptr inbounds i32, i32* %x, i64 %1
- store i32 %call4, i32* %arrayidx7, align 4
+ %arrayidx7 = getelementptr inbounds i32, ptr %x, i64 %1
+ store i32 %call4, ptr %arrayidx7, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 3
%2 = trunc i64 %indvars.iv.next to i32
%cmp = icmp slt i32 %2, 1500
@@ -106,16 +106,16 @@ for.end: ; preds = %for.body
; }
; Function Attrs: nounwind uwtable
-define void @hi2(i32* nocapture %x) #0 {
+define void @hi2(ptr nocapture %x) #0 {
; CHECK-LABEL: define void @hi2
-; CHECK-SAME: (i32* nocapture [[X:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture [[X:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @foo(i32 0) #[[ATTR1]]
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[X]], i64 [[INDVARS_IV]]
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[X]], i64 [[INDVARS_IV]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp eq i64 [[INDVARS_IV]], 1499
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -129,16 +129,16 @@ for.body: ; preds = %for.body, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%call = tail call i32 @foo(i32 0) #1
%0 = mul nsw i64 %indvars.iv, 3
- %arrayidx = getelementptr inbounds i32, i32* %x, i64 %0
- store i32 %call, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %x, i64 %0
+ store i32 %call, ptr %arrayidx, align 4
%call1 = tail call i32 @foo(i32 0) #1
%1 = add nsw i64 %0, 1
- %arrayidx4 = getelementptr inbounds i32, i32* %x, i64 %1
- store i32 %call1, i32* %arrayidx4, align 4
+ %arrayidx4 = getelementptr inbounds i32, ptr %x, i64 %1
+ store i32 %call1, ptr %arrayidx4, align 4
%call5 = tail call i32 @foo(i32 0) #1
%2 = add nsw i64 %0, 2
- %arrayidx9 = getelementptr inbounds i32, i32* %x, i64 %2
- store i32 %call5, i32* %arrayidx9, align 4
+ %arrayidx9 = getelementptr inbounds i32, ptr %x, i64 %2
+ store i32 %call5, ptr %arrayidx9, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, 500
br i1 %exitcond, label %for.end, label %for.body
@@ -158,21 +158,21 @@ for.end: ; preds = %for.body
; }
; Function Attrs: nounwind uwtable
-define void @goo(float %alpha, float* nocapture %a, float* nocapture readonly %b) #0 {
+define void @goo(float %alpha, ptr nocapture %a, ptr nocapture readonly %b) #0 {
; CHECK-LABEL: define void @goo
-; CHECK-SAME: (float [[ALPHA:%.*]], float* nocapture [[A:%.*]], float* nocapture readonly [[B:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (float [[ALPHA:%.*]], ptr nocapture [[A:%.*]], ptr nocapture readonly [[B:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVAR:%.*]] = phi i64 [ [[INDVAR_NEXT:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[TMP0:%.*]] = trunc i64 [[INDVAR]] to i32
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds float, float* [[B]], i64 [[INDVAR]]
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[INDVAR]]
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: [[MUL:%.*]] = fmul float [[TMP1]], [[ALPHA]]
-; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds float, float* [[A]], i64 [[INDVAR]]
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[ARRAYIDX2]], align 4
+; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[INDVAR]]
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[ARRAYIDX2]], align 4
; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMP2]], [[MUL]]
-; CHECK-NEXT: store float [[ADD]], float* [[ARRAYIDX2]], align 4
+; CHECK-NEXT: store float [[ADD]], ptr [[ARRAYIDX2]], align 4
; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[INDVAR]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP0]], 3199
; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -184,45 +184,45 @@ entry:
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
- %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv
- %0 = load float, float* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds float, ptr %b, i64 %indvars.iv
+ %0 = load float, ptr %arrayidx, align 4
%mul = fmul float %0, %alpha
- %arrayidx2 = getelementptr inbounds float, float* %a, i64 %indvars.iv
- %1 = load float, float* %arrayidx2, align 4
+ %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %indvars.iv
+ %1 = load float, ptr %arrayidx2, align 4
%add = fadd float %1, %mul
- store float %add, float* %arrayidx2, align 4
+ store float %add, ptr %arrayidx2, align 4
%2 = add nsw i64 %indvars.iv, 1
- %arrayidx5 = getelementptr inbounds float, float* %b, i64 %2
- %3 = load float, float* %arrayidx5, align 4
+ %arrayidx5 = getelementptr inbounds float, ptr %b, i64 %2
+ %3 = load float, ptr %arrayidx5, align 4
%mul6 = fmul float %3, %alpha
- %arrayidx9 = getelementptr inbounds float, float* %a, i64 %2
- %4 = load float, float* %arrayidx9, align 4
+ %arrayidx9 = getelementptr inbounds float, ptr %a, i64 %2
+ %4 = load float, ptr %arrayidx9, align 4
%add10 = fadd float %4, %mul6
- store float %add10, float* %arrayidx9, align 4
+ store float %add10, ptr %arrayidx9, align 4
%5 = add nsw i64 %indvars.iv, 2
- %arrayidx13 = getelementptr inbounds float, float* %b, i64 %5
- %6 = load float, float* %arrayidx13, align 4
+ %arrayidx13 = getelementptr inbounds float, ptr %b, i64 %5
+ %6 = load float, ptr %arrayidx13, align 4
%mul14 = fmul float %6, %alpha
- %arrayidx17 = getelementptr inbounds float, float* %a, i64 %5
- %7 = load float, float* %arrayidx17, align 4
+ %arrayidx17 = getelementptr inbounds float, ptr %a, i64 %5
+ %7 = load float, ptr %arrayidx17, align 4
%add18 = fadd float %7, %mul14
- store float %add18, float* %arrayidx17, align 4
+ store float %add18, ptr %arrayidx17, align 4
%8 = add nsw i64 %indvars.iv, 3
- %arrayidx21 = getelementptr inbounds float, float* %b, i64 %8
- %9 = load float, float* %arrayidx21, align 4
+ %arrayidx21 = getelementptr inbounds float, ptr %b, i64 %8
+ %9 = load float, ptr %arrayidx21, align 4
%mul22 = fmul float %9, %alpha
- %arrayidx25 = getelementptr inbounds float, float* %a, i64 %8
- %10 = load float, float* %arrayidx25, align 4
+ %arrayidx25 = getelementptr inbounds float, ptr %a, i64 %8
+ %10 = load float, ptr %arrayidx25, align 4
%add26 = fadd float %10, %mul22
- store float %add26, float* %arrayidx25, align 4
+ store float %add26, ptr %arrayidx25, align 4
%11 = add nsw i64 %indvars.iv, 4
- %arrayidx29 = getelementptr inbounds float, float* %b, i64 %11
- %12 = load float, float* %arrayidx29, align 4
+ %arrayidx29 = getelementptr inbounds float, ptr %b, i64 %11
+ %12 = load float, ptr %arrayidx29, align 4
%mul30 = fmul float %12, %alpha
- %arrayidx33 = getelementptr inbounds float, float* %a, i64 %11
- %13 = load float, float* %arrayidx33, align 4
+ %arrayidx33 = getelementptr inbounds float, ptr %a, i64 %11
+ %13 = load float, ptr %arrayidx33, align 4
%add34 = fadd float %13, %mul30
- store float %add34, float* %arrayidx33, align 4
+ store float %add34, ptr %arrayidx33, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 5
%14 = trunc i64 %indvars.iv.next to i32
%cmp = icmp slt i32 %14, 3200
@@ -243,24 +243,24 @@ for.end: ; preds = %for.body
; }
; Function Attrs: nounwind uwtable
-define void @hoo(float %alpha, float* nocapture %a, float* nocapture readonly %b, i32* nocapture readonly %ip) #0 {
+define void @hoo(float %alpha, ptr nocapture %a, ptr nocapture readonly %b, ptr nocapture readonly %ip) #0 {
; CHECK-LABEL: define void @hoo
-; CHECK-SAME: (float [[ALPHA:%.*]], float* nocapture [[A:%.*]], float* nocapture readonly [[B:%.*]], i32* nocapture readonly [[IP:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (float [[ALPHA:%.*]], ptr nocapture [[A:%.*]], ptr nocapture readonly [[B:%.*]], ptr nocapture readonly [[IP:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVAR:%.*]] = phi i64 [ [[INDVAR_NEXT:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[TMP0:%.*]] = trunc i64 [[INDVAR]] to i32
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IP]], i64 [[INDVAR]]
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[IP]], i64 [[INDVAR]]
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: [[IDXPROM1:%.*]] = sext i32 [[TMP1]] to i64
-; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds float, float* [[B]], i64 [[IDXPROM1]]
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[ARRAYIDX2]], align 4
+; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[IDXPROM1]]
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[ARRAYIDX2]], align 4
; CHECK-NEXT: [[MUL:%.*]] = fmul float [[TMP2]], [[ALPHA]]
-; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds float, float* [[A]], i64 [[INDVAR]]
-; CHECK-NEXT: [[TMP3:%.*]] = load float, float* [[ARRAYIDX4]], align 4
+; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[INDVAR]]
+; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[ARRAYIDX4]], align 4
; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMP3]], [[MUL]]
-; CHECK-NEXT: store float [[ADD]], float* [[ARRAYIDX4]], align 4
+; CHECK-NEXT: store float [[ADD]], ptr [[ARRAYIDX4]], align 4
; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[INDVAR]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP0]], 3199
; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -272,60 +272,60 @@ entry:
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
- %arrayidx = getelementptr inbounds i32, i32* %ip, i64 %indvars.iv
- %0 = load i32, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %ip, i64 %indvars.iv
+ %0 = load i32, ptr %arrayidx, align 4
%idxprom1 = sext i32 %0 to i64
- %arrayidx2 = getelementptr inbounds float, float* %b, i64 %idxprom1
- %1 = load float, float* %arrayidx2, align 4
+ %arrayidx2 = getelementptr inbounds float, ptr %b, i64 %idxprom1
+ %1 = load float, ptr %arrayidx2, align 4
%mul = fmul float %1, %alpha
- %arrayidx4 = getelementptr inbounds float, float* %a, i64 %indvars.iv
- %2 = load float, float* %arrayidx4, align 4
+ %arrayidx4 = getelementptr inbounds float, ptr %a, i64 %indvars.iv
+ %2 = load float, ptr %arrayidx4, align 4
%add = fadd float %2, %mul
- store float %add, float* %arrayidx4, align 4
+ store float %add, ptr %arrayidx4, align 4
%3 = add nsw i64 %indvars.iv, 1
- %arrayidx7 = getelementptr inbounds i32, i32* %ip, i64 %3
- %4 = load i32, i32* %arrayidx7, align 4
+ %arrayidx7 = getelementptr inbounds i32, ptr %ip, i64 %3
+ %4 = load i32, ptr %arrayidx7, align 4
%idxprom8 = sext i32 %4 to i64
- %arrayidx9 = getelementptr inbounds float, float* %b, i64 %idxprom8
- %5 = load float, float* %arrayidx9, align 4
+ %arrayidx9 = getelementptr inbounds float, ptr %b, i64 %idxprom8
+ %5 = load float, ptr %arrayidx9, align 4
%mul10 = fmul float %5, %alpha
- %arrayidx13 = getelementptr inbounds float, float* %a, i64 %3
- %6 = load float, float* %arrayidx13, align 4
+ %arrayidx13 = getelementptr inbounds float, ptr %a, i64 %3
+ %6 = load float, ptr %arrayidx13, align 4
%add14 = fadd float %6, %mul10
- store float %add14, float* %arrayidx13, align 4
+ store float %add14, ptr %arrayidx13, align 4
%7 = add nsw i64 %indvars.iv, 2
- %arrayidx17 = getelementptr inbounds i32, i32* %ip, i64 %7
- %8 = load i32, i32* %arrayidx17, align 4
+ %arrayidx17 = getelementptr inbounds i32, ptr %ip, i64 %7
+ %8 = load i32, ptr %arrayidx17, align 4
%idxprom18 = sext i32 %8 to i64
- %arrayidx19 = getelementptr inbounds float, float* %b, i64 %idxprom18
- %9 = load float, float* %arrayidx19, align 4
+ %arrayidx19 = getelementptr inbounds float, ptr %b, i64 %idxprom18
+ %9 = load float, ptr %arrayidx19, align 4
%mul20 = fmul float %9, %alpha
- %arrayidx23 = getelementptr inbounds float, float* %a, i64 %7
- %10 = load float, float* %arrayidx23, align 4
+ %arrayidx23 = getelementptr inbounds float, ptr %a, i64 %7
+ %10 = load float, ptr %arrayidx23, align 4
%add24 = fadd float %10, %mul20
- store float %add24, float* %arrayidx23, align 4
+ store float %add24, ptr %arrayidx23, align 4
%11 = add nsw i64 %indvars.iv, 3
- %arrayidx27 = getelementptr inbounds i32, i32* %ip, i64 %11
- %12 = load i32, i32* %arrayidx27, align 4
+ %arrayidx27 = getelementptr inbounds i32, ptr %ip, i64 %11
+ %12 = load i32, ptr %arrayidx27, align 4
%idxprom28 = sext i32 %12 to i64
- %arrayidx29 = getelementptr inbounds float, float* %b, i64 %idxprom28
- %13 = load float, float* %arrayidx29, align 4
+ %arrayidx29 = getelementptr inbounds float, ptr %b, i64 %idxprom28
+ %13 = load float, ptr %arrayidx29, align 4
%mul30 = fmul float %13, %alpha
- %arrayidx33 = getelementptr inbounds float, float* %a, i64 %11
- %14 = load float, float* %arrayidx33, align 4
+ %arrayidx33 = getelementptr inbounds float, ptr %a, i64 %11
+ %14 = load float, ptr %arrayidx33, align 4
%add34 = fadd float %14, %mul30
- store float %add34, float* %arrayidx33, align 4
+ store float %add34, ptr %arrayidx33, align 4
%15 = add nsw i64 %indvars.iv, 4
- %arrayidx37 = getelementptr inbounds i32, i32* %ip, i64 %15
- %16 = load i32, i32* %arrayidx37, align 4
+ %arrayidx37 = getelementptr inbounds i32, ptr %ip, i64 %15
+ %16 = load i32, ptr %arrayidx37, align 4
%idxprom38 = sext i32 %16 to i64
- %arrayidx39 = getelementptr inbounds float, float* %b, i64 %idxprom38
- %17 = load float, float* %arrayidx39, align 4
+ %arrayidx39 = getelementptr inbounds float, ptr %b, i64 %idxprom38
+ %17 = load float, ptr %arrayidx39, align 4
%mul40 = fmul float %17, %alpha
- %arrayidx43 = getelementptr inbounds float, float* %a, i64 %15
- %18 = load float, float* %arrayidx43, align 4
+ %arrayidx43 = getelementptr inbounds float, ptr %a, i64 %15
+ %18 = load float, ptr %arrayidx43, align 4
%add44 = fadd float %18, %mul40
- store float %add44, float* %arrayidx43, align 4
+ store float %add44, ptr %arrayidx43, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 5
%19 = trunc i64 %indvars.iv.next to i32
%cmp = icmp slt i32 %19, 3200
@@ -351,19 +351,19 @@ for.end: ; preds = %for.body
; }
; Function Attrs: nounwind uwtable
-define void @multi1(i32* nocapture %x) #0 {
+define void @multi1(ptr nocapture %x) #0 {
; CHECK-LABEL: define void @multi1
-; CHECK-SAME: (i32* nocapture [[X:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture [[X:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @foo(i32 0) #[[ATTR1]]
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[TMP0:%.*]] = add i64 [[INDVARS_IV]], 6
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[X]], i64 [[INDVARS_IV]]
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX]], align 4
-; CHECK-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds i32, i32* [[X]], i64 [[TMP0]]
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX6]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[X]], i64 [[INDVARS_IV]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds i32, ptr [[X]], i64 [[TMP0]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX6]], align 4
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp eq i64 [[INDVARS_IV]], 1499
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -377,23 +377,23 @@ entry:
for.body: ; preds = %for.body, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%0 = mul nsw i64 %indvars.iv, 3
- %arrayidx = getelementptr inbounds i32, i32* %x, i64 %0
- store i32 %call, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %x, i64 %0
+ store i32 %call, ptr %arrayidx, align 4
%1 = add nsw i64 %0, 1
- %arrayidx4 = getelementptr inbounds i32, i32* %x, i64 %1
- store i32 %call, i32* %arrayidx4, align 4
+ %arrayidx4 = getelementptr inbounds i32, ptr %x, i64 %1
+ store i32 %call, ptr %arrayidx4, align 4
%2 = add nsw i64 %0, 2
- %arrayidx9 = getelementptr inbounds i32, i32* %x, i64 %2
- store i32 %call, i32* %arrayidx9, align 4
+ %arrayidx9 = getelementptr inbounds i32, ptr %x, i64 %2
+ store i32 %call, ptr %arrayidx9, align 4
%3 = add nsw i64 %0, 6
- %arrayidx6 = getelementptr inbounds i32, i32* %x, i64 %3
- store i32 %call, i32* %arrayidx6, align 4
+ %arrayidx6 = getelementptr inbounds i32, ptr %x, i64 %3
+ store i32 %call, ptr %arrayidx6, align 4
%4 = add nsw i64 %0, 7
- %arrayidx7 = getelementptr inbounds i32, i32* %x, i64 %4
- store i32 %call, i32* %arrayidx7, align 4
+ %arrayidx7 = getelementptr inbounds i32, ptr %x, i64 %4
+ store i32 %call, ptr %arrayidx7, align 4
%5 = add nsw i64 %0, 8
- %arrayidx8 = getelementptr inbounds i32, i32* %x, i64 %5
- store i32 %call, i32* %arrayidx8, align 4
+ %arrayidx8 = getelementptr inbounds i32, ptr %x, i64 %5
+ store i32 %call, ptr %arrayidx8, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, 500
br i1 %exitcond, label %for.end, label %for.body
@@ -417,19 +417,19 @@ for.end: ; preds = %for.body
; }
; Function Attrs: nounwind uwtable
-define void @multi2(i32* nocapture %x) #0 {
+define void @multi2(ptr nocapture %x) #0 {
; CHECK-LABEL: define void @multi2
-; CHECK-SAME: (i32* nocapture [[X:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture [[X:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @foo(i32 0) #[[ATTR1]]
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[TMP0:%.*]] = add i64 [[INDVARS_IV]], 3
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[X]], i64 [[INDVARS_IV]]
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX]], align 4
-; CHECK-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds i32, i32* [[X]], i64 [[TMP0]]
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX6]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[X]], i64 [[INDVARS_IV]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds i32, ptr [[X]], i64 [[TMP0]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX6]], align 4
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp eq i64 [[INDVARS_IV]], 1499
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -445,22 +445,22 @@ for.body: ; preds = %for.body, %entry
%0 = mul nsw i64 %indvars.iv, 3
%add = add nsw i64 %indvars.iv, 1
%newmul = mul nsw i64 %add, 3
- %arrayidx = getelementptr inbounds i32, i32* %x, i64 %0
- store i32 %call, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %x, i64 %0
+ store i32 %call, ptr %arrayidx, align 4
%1 = add nsw i64 %0, 1
- %arrayidx4 = getelementptr inbounds i32, i32* %x, i64 %1
- store i32 %call, i32* %arrayidx4, align 4
+ %arrayidx4 = getelementptr inbounds i32, ptr %x, i64 %1
+ store i32 %call, ptr %arrayidx4, align 4
%2 = add nsw i64 %0, 2
- %arrayidx9 = getelementptr inbounds i32, i32* %x, i64 %2
- store i32 %call, i32* %arrayidx9, align 4
- %arrayidx6 = getelementptr inbounds i32, i32* %x, i64 %newmul
- store i32 %call, i32* %arrayidx6, align 4
+ %arrayidx9 = getelementptr inbounds i32, ptr %x, i64 %2
+ store i32 %call, ptr %arrayidx9, align 4
+ %arrayidx6 = getelementptr inbounds i32, ptr %x, i64 %newmul
+ store i32 %call, ptr %arrayidx6, align 4
%3 = add nsw i64 %newmul, 1
- %arrayidx7 = getelementptr inbounds i32, i32* %x, i64 %3
- store i32 %call, i32* %arrayidx7, align 4
+ %arrayidx7 = getelementptr inbounds i32, ptr %x, i64 %3
+ store i32 %call, ptr %arrayidx7, align 4
%4 = add nsw i64 %newmul, 2
- %arrayidx8 = getelementptr inbounds i32, i32* %x, i64 %4
- store i32 %call, i32* %arrayidx8, align 4
+ %arrayidx8 = getelementptr inbounds i32, ptr %x, i64 %4
+ store i32 %call, ptr %arrayidx8, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, 500
br i1 %exitcond, label %for.end, label %for.body
@@ -482,17 +482,17 @@ for.end: ; preds = %for.body
; }
; Function Attrs: nounwind uwtable
-define void @multi3(i32* nocapture %x) #0 {
+define void @multi3(ptr nocapture %x) #0 {
; CHECK-LABEL: define void @multi3
-; CHECK-SAME: (i32* nocapture [[X:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture [[X:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @foo(i32 0) #[[ATTR1]]
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[TMP0:%.*]] = add i64 [[INDVARS_IV]], 3
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[X]], i64 [[TMP0]]
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[X]], i64 [[TMP0]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp eq i64 [[INDVARS_IV]], 1499
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -508,14 +508,14 @@ for.body: ; preds = %for.body, %entry
%0 = mul nsw i64 %indvars.iv, 3
%x0 = add nsw i64 %0, 3
%add = add nsw i64 %indvars.iv, 1
- %arrayidx = getelementptr inbounds i32, i32* %x, i64 %x0
- store i32 %call, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %x, i64 %x0
+ store i32 %call, ptr %arrayidx, align 4
%1 = add nsw i64 %0, 4
- %arrayidx4 = getelementptr inbounds i32, i32* %x, i64 %1
- store i32 %call, i32* %arrayidx4, align 4
+ %arrayidx4 = getelementptr inbounds i32, ptr %x, i64 %1
+ store i32 %call, ptr %arrayidx4, align 4
%2 = add nsw i64 %0, 5
- %arrayidx9 = getelementptr inbounds i32, i32* %x, i64 %2
- store i32 %call, i32* %arrayidx9, align 4
+ %arrayidx9 = getelementptr inbounds i32, ptr %x, i64 %2
+ store i32 %call, ptr %arrayidx9, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, 500
br i1 %exitcond, label %for.end, label %for.body
@@ -535,9 +535,9 @@ for.end: ; preds = %for.body
; }
; Function Attrs: nounwind uwtable
-define void @bar2(i32* nocapture readnone %x, i32 %y, i32 %z) #0 {
+define void @bar2(ptr nocapture readnone %x, i32 %y, i32 %z) #0 {
; CHECK-LABEL: define void @bar2
-; CHECK-SAME: (i32* nocapture readnone [[X:%.*]], i32 [[Y:%.*]], i32 [[Z:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture readnone [[X:%.*]], i32 [[Y:%.*]], i32 [[Z:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
@@ -587,23 +587,23 @@ for.end: ; preds = %for.body
%struct.s = type { i32, i32 }
; Function Attrs: nounwind uwtable
-define void @gep1(%struct.s* nocapture %x) #0 {
+define void @gep1(ptr nocapture %x) #0 {
; CHECK-LABEL: define void @gep1
-; CHECK-SAME: (%struct.s* nocapture [[X:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture [[X:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @foo(i32 0) #[[ATTR1]]
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[TMP0:%.*]] = mul nsw i64 [[INDVARS_IV]], 3
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], %struct.s* [[X]], i64 [[TMP0]], i32 0
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[X]], i64 [[TMP0]], i32 0
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = add nsw i64 [[TMP0]], 1
-; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.s* [[X]], i64 [[TMP1]], i32 0
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX4]], align 4
+; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[X]], i64 [[TMP1]], i32 0
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX4]], align 4
; CHECK-NEXT: [[TMP2:%.*]] = add nsw i64 [[TMP0]], 2
-; CHECK-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.s* [[X]], i64 [[TMP2]], i32 0
-; CHECK-NEXT: store i32 [[CALL]], i32* [[ARRAYIDX9]], align 4
+; CHECK-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[X]], i64 [[TMP2]], i32 0
+; CHECK-NEXT: store i32 [[CALL]], ptr [[ARRAYIDX9]], align 4
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], 500
; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -617,14 +617,14 @@ entry:
for.body: ; preds = %for.body, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%0 = mul nsw i64 %indvars.iv, 3
- %arrayidx = getelementptr inbounds %struct.s, %struct.s* %x, i64 %0, i32 0
- store i32 %call, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds %struct.s, ptr %x, i64 %0, i32 0
+ store i32 %call, ptr %arrayidx, align 4
%1 = add nsw i64 %0, 1
- %arrayidx4 = getelementptr inbounds %struct.s, %struct.s* %x, i64 %1, i32 0
- store i32 %call, i32* %arrayidx4, align 4
+ %arrayidx4 = getelementptr inbounds %struct.s, ptr %x, i64 %1, i32 0
+ store i32 %call, ptr %arrayidx4, align 4
%2 = add nsw i64 %0, 2
- %arrayidx9 = getelementptr inbounds %struct.s, %struct.s* %x, i64 %2, i32 0
- store i32 %call, i32* %arrayidx9, align 4
+ %arrayidx9 = getelementptr inbounds %struct.s, ptr %x, i64 %2, i32 0
+ store i32 %call, ptr %arrayidx9, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, 500
br i1 %exitcond, label %for.end, label %for.body
@@ -634,16 +634,17 @@ for.end: ; preds = %for.body
ret void
}
-define void @gep-indexing(i32* nocapture %x) {
+define void @gep-indexing(ptr nocapture %x) {
; CHECK-LABEL: define void @gep-indexing
-; CHECK-SAME: (i32* nocapture [[X:%.*]]) {
+; CHECK-SAME: (ptr nocapture [[X:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @foo(i32 0) #[[ATTR1]]
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
-; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i32, i32* [[X]], i64 [[INDVARS_IV]]
-; CHECK-NEXT: store i32 [[CALL]], i32* [[SCEVGEP]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = shl nuw nsw i64 [[INDVARS_IV]], 2
+; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[X]], i64 [[TMP0]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[SCEVGEP]], align 4
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp eq i64 [[INDVARS_IV]], 1499
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -657,12 +658,12 @@ entry:
for.body: ; preds = %for.body, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%0 = mul nsw i64 %indvars.iv, 3
- %arrayidx = getelementptr inbounds i32, i32* %x, i64 %0
- store i32 %call, i32* %arrayidx, align 4
- %arrayidx4 = getelementptr inbounds i32, i32* %arrayidx, i64 1
- store i32 %call, i32* %arrayidx4, align 4
- %arrayidx9 = getelementptr inbounds i32, i32* %arrayidx, i64 2
- store i32 %call, i32* %arrayidx9, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %x, i64 %0
+ store i32 %call, ptr %arrayidx, align 4
+ %arrayidx4 = getelementptr inbounds i32, ptr %arrayidx, i64 1
+ store i32 %call, ptr %arrayidx4, align 4
+ %arrayidx9 = getelementptr inbounds i32, ptr %arrayidx, i64 2
+ store i32 %call, ptr %arrayidx9, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, 500
br i1 %exitcond, label %for.end, label %for.body
@@ -672,17 +673,17 @@ for.end: ; preds = %for.body
}
-define void @unordered_atomic_ops(i32* noalias %buf_0, i32* noalias %buf_1) {
+define void @unordered_atomic_ops(ptr noalias %buf_0, ptr noalias %buf_1) {
; CHECK-LABEL: define void @unordered_atomic_ops
-; CHECK-SAME: (i32* noalias [[BUF_0:%.*]], i32* noalias [[BUF_1:%.*]]) {
+; CHECK-SAME: (ptr noalias [[BUF_0:%.*]], ptr noalias [[BUF_1:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVAR:%.*]] = phi i32 [ [[INDVAR_NEXT:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ]
-; CHECK-NEXT: [[BUF0_A:%.*]] = getelementptr i32, i32* [[BUF_0]], i32 [[INDVAR]]
-; CHECK-NEXT: [[BUF1_A:%.*]] = getelementptr i32, i32* [[BUF_1]], i32 [[INDVAR]]
-; CHECK-NEXT: [[VA:%.*]] = load atomic i32, i32* [[BUF0_A]] unordered, align 4
-; CHECK-NEXT: store atomic i32 [[VA]], i32* [[BUF1_A]] unordered, align 4
+; CHECK-NEXT: [[BUF0_A:%.*]] = getelementptr i32, ptr [[BUF_0]], i32 [[INDVAR]]
+; CHECK-NEXT: [[BUF1_A:%.*]] = getelementptr i32, ptr [[BUF_1]], i32 [[INDVAR]]
+; CHECK-NEXT: [[VA:%.*]] = load atomic i32, ptr [[BUF0_A]] unordered, align 4
+; CHECK-NEXT: store atomic i32 [[VA]], ptr [[BUF1_A]] unordered, align 4
; CHECK-NEXT: [[INDVAR_NEXT]] = add i32 [[INDVAR]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INDVAR]], 3199
; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
@@ -696,14 +697,14 @@ for.body:
%indvars.iv = phi i32 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%indvars.iv.next = add i32 %indvars.iv, 2
%indvars.mid = add i32 %indvars.iv, 1
- %buf0_a = getelementptr i32, i32* %buf_0, i32 %indvars.iv
- %buf0_b = getelementptr i32, i32* %buf_0, i32 %indvars.mid
- %buf1_a = getelementptr i32, i32* %buf_1, i32 %indvars.iv
- %buf1_b = getelementptr i32, i32* %buf_1, i32 %indvars.mid
- %va = load atomic i32, i32* %buf0_a unordered, align 4
- %vb = load atomic i32, i32* %buf0_b unordered, align 4
- store atomic i32 %va, i32* %buf1_a unordered, align 4
- store atomic i32 %vb, i32* %buf1_b unordered, align 4
+ %buf0_a = getelementptr i32, ptr %buf_0, i32 %indvars.iv
+ %buf0_b = getelementptr i32, ptr %buf_0, i32 %indvars.mid
+ %buf1_a = getelementptr i32, ptr %buf_1, i32 %indvars.iv
+ %buf1_b = getelementptr i32, ptr %buf_1, i32 %indvars.mid
+ %va = load atomic i32, ptr %buf0_a unordered, align 4
+ %vb = load atomic i32, ptr %buf0_b unordered, align 4
+ store atomic i32 %va, ptr %buf1_a unordered, align 4
+ store atomic i32 %vb, ptr %buf1_b unordered, align 4
%cmp = icmp slt i32 %indvars.iv.next, 3200
br i1 %cmp, label %for.body, label %for.end
@@ -711,24 +712,24 @@ for.end:
ret void
}
-define void @unordered_atomic_ops_nomatch(i32* noalias %buf_0, i32* noalias %buf_1) {
+define void @unordered_atomic_ops_nomatch(ptr noalias %buf_0, ptr noalias %buf_1) {
; Negative test
; CHECK-LABEL: define void @unordered_atomic_ops_nomatch
-; CHECK-SAME: (i32* noalias [[BUF_0:%.*]], i32* noalias [[BUF_1:%.*]]) {
+; CHECK-SAME: (ptr noalias [[BUF_0:%.*]], ptr noalias [[BUF_1:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add i32 [[INDVARS_IV]], 2
; CHECK-NEXT: [[INDVARS_MID:%.*]] = add i32 [[INDVARS_IV]], 1
-; CHECK-NEXT: [[BUF0_A:%.*]] = getelementptr i32, i32* [[BUF_0]], i32 [[INDVARS_IV]]
-; CHECK-NEXT: [[BUF0_B:%.*]] = getelementptr i32, i32* [[BUF_0]], i32 [[INDVARS_MID]]
-; CHECK-NEXT: [[BUF1_A:%.*]] = getelementptr i32, i32* [[BUF_1]], i32 [[INDVARS_IV]]
-; CHECK-NEXT: [[BUF1_B:%.*]] = getelementptr i32, i32* [[BUF_1]], i32 [[INDVARS_MID]]
-; CHECK-NEXT: [[VA:%.*]] = load atomic i32, i32* [[BUF0_A]] unordered, align 4
-; CHECK-NEXT: [[VB:%.*]] = load atomic i32, i32* [[BUF0_B]] unordered, align 4
-; CHECK-NEXT: store i32 [[VA]], i32* [[BUF1_A]], align 4
-; CHECK-NEXT: store atomic i32 [[VB]], i32* [[BUF1_B]] unordered, align 4
+; CHECK-NEXT: [[BUF0_A:%.*]] = getelementptr i32, ptr [[BUF_0]], i32 [[INDVARS_IV]]
+; CHECK-NEXT: [[BUF0_B:%.*]] = getelementptr i32, ptr [[BUF_0]], i32 [[INDVARS_MID]]
+; CHECK-NEXT: [[BUF1_A:%.*]] = getelementptr i32, ptr [[BUF_1]], i32 [[INDVARS_IV]]
+; CHECK-NEXT: [[BUF1_B:%.*]] = getelementptr i32, ptr [[BUF_1]], i32 [[INDVARS_MID]]
+; CHECK-NEXT: [[VA:%.*]] = load atomic i32, ptr [[BUF0_A]] unordered, align 4
+; CHECK-NEXT: [[VB:%.*]] = load atomic i32, ptr [[BUF0_B]] unordered, align 4
+; CHECK-NEXT: store i32 [[VA]], ptr [[BUF1_A]], align 4
+; CHECK-NEXT: store atomic i32 [[VB]], ptr [[BUF1_B]] unordered, align 4
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INDVARS_IV_NEXT]], 3200
; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
; CHECK: for.end:
@@ -742,14 +743,14 @@ for.body:
%indvars.iv = phi i32 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%indvars.iv.next = add i32 %indvars.iv, 2
%indvars.mid = add i32 %indvars.iv, 1
- %buf0_a = getelementptr i32, i32* %buf_0, i32 %indvars.iv
- %buf0_b = getelementptr i32, i32* %buf_0, i32 %indvars.mid
- %buf1_a = getelementptr i32, i32* %buf_1, i32 %indvars.iv
- %buf1_b = getelementptr i32, i32* %buf_1, i32 %indvars.mid
- %va = load atomic i32, i32* %buf0_a unordered, align 4
- %vb = load atomic i32, i32* %buf0_b unordered, align 4
- store i32 %va, i32* %buf1_a, align 4 ;; Not atomic
- store atomic i32 %vb, i32* %buf1_b unordered, align 4
+ %buf0_a = getelementptr i32, ptr %buf_0, i32 %indvars.iv
+ %buf0_b = getelementptr i32, ptr %buf_0, i32 %indvars.mid
+ %buf1_a = getelementptr i32, ptr %buf_1, i32 %indvars.iv
+ %buf1_b = getelementptr i32, ptr %buf_1, i32 %indvars.mid
+ %va = load atomic i32, ptr %buf0_a unordered, align 4
+ %vb = load atomic i32, ptr %buf0_b unordered, align 4
+ store i32 %va, ptr %buf1_a, align 4 ;; Not atomic
+ store atomic i32 %vb, ptr %buf1_b unordered, align 4
%cmp = icmp slt i32 %indvars.iv.next, 3200
br i1 %cmp, label %for.body, label %for.end
@@ -757,24 +758,24 @@ for.end:
ret void
}
-define void @ordered_atomic_ops(i32* noalias %buf_0, i32* noalias %buf_1) {
+define void @ordered_atomic_ops(ptr noalias %buf_0, ptr noalias %buf_1) {
; Negative test
; CHECK-LABEL: define void @ordered_atomic_ops
-; CHECK-SAME: (i32* noalias [[BUF_0:%.*]], i32* noalias [[BUF_1:%.*]]) {
+; CHECK-SAME: (ptr noalias [[BUF_0:%.*]], ptr noalias [[BUF_1:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add i32 [[INDVARS_IV]], 2
; CHECK-NEXT: [[INDVARS_MID:%.*]] = add i32 [[INDVARS_IV]], 1
-; CHECK-NEXT: [[BUF0_A:%.*]] = getelementptr i32, i32* [[BUF_0]], i32 [[INDVARS_IV]]
-; CHECK-NEXT: [[BUF0_B:%.*]] = getelementptr i32, i32* [[BUF_0]], i32 [[INDVARS_MID]]
-; CHECK-NEXT: [[BUF1_A:%.*]] = getelementptr i32, i32* [[BUF_1]], i32 [[INDVARS_IV]]
-; CHECK-NEXT: [[BUF1_B:%.*]] = getelementptr i32, i32* [[BUF_1]], i32 [[INDVARS_MID]]
-; CHECK-NEXT: [[VA:%.*]] = load atomic i32, i32* [[BUF0_A]] acquire, align 4
-; CHECK-NEXT: [[VB:%.*]] = load atomic i32, i32* [[BUF0_B]] acquire, align 4
-; CHECK-NEXT: store atomic i32 [[VA]], i32* [[BUF1_A]] release, align 4
-; CHECK-NEXT: store atomic i32 [[VB]], i32* [[BUF1_B]] release, align 4
+; CHECK-NEXT: [[BUF0_A:%.*]] = getelementptr i32, ptr [[BUF_0]], i32 [[INDVARS_IV]]
+; CHECK-NEXT: [[BUF0_B:%.*]] = getelementptr i32, ptr [[BUF_0]], i32 [[INDVARS_MID]]
+; CHECK-NEXT: [[BUF1_A:%.*]] = getelementptr i32, ptr [[BUF_1]], i32 [[INDVARS_IV]]
+; CHECK-NEXT: [[BUF1_B:%.*]] = getelementptr i32, ptr [[BUF_1]], i32 [[INDVARS_MID]]
+; CHECK-NEXT: [[VA:%.*]] = load atomic i32, ptr [[BUF0_A]] acquire, align 4
+; CHECK-NEXT: [[VB:%.*]] = load atomic i32, ptr [[BUF0_B]] acquire, align 4
+; CHECK-NEXT: store atomic i32 [[VA]], ptr [[BUF1_A]] release, align 4
+; CHECK-NEXT: store atomic i32 [[VB]], ptr [[BUF1_B]] release, align 4
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INDVARS_IV_NEXT]], 3200
; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
; CHECK: for.end:
@@ -788,14 +789,14 @@ for.body:
%indvars.iv = phi i32 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%indvars.iv.next = add i32 %indvars.iv, 2
%indvars.mid = add i32 %indvars.iv, 1
- %buf0_a = getelementptr i32, i32* %buf_0, i32 %indvars.iv
- %buf0_b = getelementptr i32, i32* %buf_0, i32 %indvars.mid
- %buf1_a = getelementptr i32, i32* %buf_1, i32 %indvars.iv
- %buf1_b = getelementptr i32, i32* %buf_1, i32 %indvars.mid
- %va = load atomic i32, i32* %buf0_a acquire, align 4
- %vb = load atomic i32, i32* %buf0_b acquire, align 4
- store atomic i32 %va, i32* %buf1_a release, align 4
- store atomic i32 %vb, i32* %buf1_b release, align 4
+ %buf0_a = getelementptr i32, ptr %buf_0, i32 %indvars.iv
+ %buf0_b = getelementptr i32, ptr %buf_0, i32 %indvars.mid
+ %buf1_a = getelementptr i32, ptr %buf_1, i32 %indvars.iv
+ %buf1_b = getelementptr i32, ptr %buf_1, i32 %indvars.mid
+ %va = load atomic i32, ptr %buf0_a acquire, align 4
+ %vb = load atomic i32, ptr %buf0_b acquire, align 4
+ store atomic i32 %va, ptr %buf1_a release, align 4
+ store atomic i32 %vb, ptr %buf1_b release, align 4
%cmp = icmp slt i32 %indvars.iv.next, 3200
br i1 %cmp, label %for.body, label %for.end
@@ -803,24 +804,24 @@ for.end:
ret void
}
-define void @unordered_atomic_ops_with_fence(i32* noalias %buf_0, i32* noalias %buf_1) {
+define void @unordered_atomic_ops_with_fence(ptr noalias %buf_0, ptr noalias %buf_1) {
; CHECK-LABEL: define void @unordered_atomic_ops_with_fence
-; CHECK-SAME: (i32* noalias [[BUF_0:%.*]], i32* noalias [[BUF_1:%.*]]) {
+; CHECK-SAME: (ptr noalias [[BUF_0:%.*]], ptr noalias [[BUF_1:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add i32 [[INDVARS_IV]], 2
; CHECK-NEXT: [[INDVARS_MID:%.*]] = add i32 [[INDVARS_IV]], 1
-; CHECK-NEXT: [[BUF0_A:%.*]] = getelementptr i32, i32* [[BUF_0]], i32 [[INDVARS_IV]]
-; CHECK-NEXT: [[BUF0_B:%.*]] = getelementptr i32, i32* [[BUF_0]], i32 [[INDVARS_MID]]
-; CHECK-NEXT: [[BUF1_A:%.*]] = getelementptr i32, i32* [[BUF_1]], i32 [[INDVARS_IV]]
-; CHECK-NEXT: [[BUF1_B:%.*]] = getelementptr i32, i32* [[BUF_1]], i32 [[INDVARS_MID]]
-; CHECK-NEXT: [[VA:%.*]] = load atomic i32, i32* [[BUF0_A]] unordered, align 4
-; CHECK-NEXT: [[VB:%.*]] = load atomic i32, i32* [[BUF0_B]] unordered, align 4
+; CHECK-NEXT: [[BUF0_A:%.*]] = getelementptr i32, ptr [[BUF_0]], i32 [[INDVARS_IV]]
+; CHECK-NEXT: [[BUF0_B:%.*]] = getelementptr i32, ptr [[BUF_0]], i32 [[INDVARS_MID]]
+; CHECK-NEXT: [[BUF1_A:%.*]] = getelementptr i32, ptr [[BUF_1]], i32 [[INDVARS_IV]]
+; CHECK-NEXT: [[BUF1_B:%.*]] = getelementptr i32, ptr [[BUF_1]], i32 [[INDVARS_MID]]
+; CHECK-NEXT: [[VA:%.*]] = load atomic i32, ptr [[BUF0_A]] unordered, align 4
+; CHECK-NEXT: [[VB:%.*]] = load atomic i32, ptr [[BUF0_B]] unordered, align 4
; CHECK-NEXT: fence seq_cst
-; CHECK-NEXT: store atomic i32 [[VA]], i32* [[BUF1_A]] unordered, align 4
-; CHECK-NEXT: store atomic i32 [[VB]], i32* [[BUF1_B]] unordered, align 4
+; CHECK-NEXT: store atomic i32 [[VA]], ptr [[BUF1_A]] unordered, align 4
+; CHECK-NEXT: store atomic i32 [[VB]], ptr [[BUF1_B]] unordered, align 4
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INDVARS_IV_NEXT]], 3200
; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
; CHECK: for.end:
@@ -834,15 +835,15 @@ for.body:
%indvars.iv = phi i32 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%indvars.iv.next = add i32 %indvars.iv, 2
%indvars.mid = add i32 %indvars.iv, 1
- %buf0_a = getelementptr i32, i32* %buf_0, i32 %indvars.iv
- %buf0_b = getelementptr i32, i32* %buf_0, i32 %indvars.mid
- %buf1_a = getelementptr i32, i32* %buf_1, i32 %indvars.iv
- %buf1_b = getelementptr i32, i32* %buf_1, i32 %indvars.mid
- %va = load atomic i32, i32* %buf0_a unordered, align 4
- %vb = load atomic i32, i32* %buf0_b unordered, align 4
+ %buf0_a = getelementptr i32, ptr %buf_0, i32 %indvars.iv
+ %buf0_b = getelementptr i32, ptr %buf_0, i32 %indvars.mid
+ %buf1_a = getelementptr i32, ptr %buf_1, i32 %indvars.iv
+ %buf1_b = getelementptr i32, ptr %buf_1, i32 %indvars.mid
+ %va = load atomic i32, ptr %buf0_a unordered, align 4
+ %vb = load atomic i32, ptr %buf0_b unordered, align 4
fence seq_cst
- store atomic i32 %va, i32* %buf1_a unordered, align 4
- store atomic i32 %vb, i32* %buf1_b unordered, align 4
+ store atomic i32 %va, ptr %buf1_a unordered, align 4
+ store atomic i32 %vb, ptr %buf1_b unordered, align 4
%cmp = icmp slt i32 %indvars.iv.next, 3200
br i1 %cmp, label %for.body, label %for.end
@@ -850,9 +851,9 @@ for.end:
ret void
}
-define void @pointer_bitcast_baseinst(i16* %arg, i8* %arg1, i64 %arg2) {
+define void @pointer_bitcast_baseinst(ptr %arg, ptr %arg1, i64 %arg2) {
; CHECK-LABEL: define void @pointer_bitcast_baseinst
-; CHECK-SAME: (i16* [[ARG:%.*]], i8* [[ARG1:%.*]], i64 [[ARG2:%.*]]) {
+; CHECK-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], i64 [[ARG2:%.*]]) {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[TMP0:%.*]] = add i64 [[ARG2]], -17
; CHECK-NEXT: [[TMP1:%.*]] = lshr i64 [[TMP0]], 4
@@ -864,12 +865,10 @@ define void @pointer_bitcast_baseinst(i16* %arg, i8* %arg1, i64 %arg2) {
; CHECK-NEXT: [[TMP4:%.*]] = shl nuw i64 [[INDVAR]], 3
; CHECK-NEXT: [[TMP5:%.*]] = add i64 [[TMP4]], 1
; CHECK-NEXT: [[INST5:%.*]] = shl nuw i64 [[TMP5]], 1
-; CHECK-NEXT: [[INST6:%.*]] = getelementptr i8, i8* [[ARG1]], i64 [[INST5]]
-; CHECK-NEXT: [[INST7:%.*]] = bitcast i8* [[INST6]] to <8 x i16>*
-; CHECK-NEXT: [[INST8:%.*]] = load <8 x i16>, <8 x i16>* [[INST7]], align 2
-; CHECK-NEXT: [[INST13:%.*]] = getelementptr i16, i16* [[ARG]], i64 [[TMP5]]
-; CHECK-NEXT: [[INST14:%.*]] = bitcast i16* [[INST13]] to <8 x i16>*
-; CHECK-NEXT: store <8 x i16> [[INST8]], <8 x i16>* [[INST14]], align 2
+; CHECK-NEXT: [[INST6:%.*]] = getelementptr i8, ptr [[ARG1]], i64 [[INST5]]
+; CHECK-NEXT: [[INST8:%.*]] = load <8 x i16>, ptr [[INST6]], align 2
+; CHECK-NEXT: [[INST13:%.*]] = getelementptr i16, ptr [[ARG]], i64 [[TMP5]]
+; CHECK-NEXT: store <8 x i16> [[INST8]], ptr [[INST13]], align 2
; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[INDVAR]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[INDVAR]], [[TMP3]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[BB19:%.*]], label [[BB3]]
@@ -883,19 +882,15 @@ bb3: ; preds = %bb3, %bb
%inst = phi i64 [ 1, %bb ], [ %inst17, %bb3 ]
%inst4 = add nuw i64 %inst, 8
%inst5 = shl nuw i64 %inst, 1
- %inst6 = getelementptr i8, i8* %arg1, i64 %inst5
- %inst7 = bitcast i8* %inst6 to <8 x i16>*
- %inst8 = load <8 x i16>, <8 x i16>* %inst7, align 2
+ %inst6 = getelementptr i8, ptr %arg1, i64 %inst5
+ %inst8 = load <8 x i16>, ptr %inst6, align 2
%inst9 = shl i64 %inst4, 1
- %inst10 = getelementptr i8, i8* %arg1, i64 %inst9
- %inst11 = bitcast i8* %inst10 to <8 x i16>*
- %inst12 = load <8 x i16>, <8 x i16>* %inst11, align 2
- %inst13 = getelementptr i16, i16* %arg, i64 %inst
- %inst14 = bitcast i16* %inst13 to <8 x i16>*
- store <8 x i16> %inst8, <8 x i16>* %inst14, align 2
- %inst15 = getelementptr i16, i16* %arg, i64 %inst4
- %inst16 = bitcast i16* %inst15 to <8 x i16>*
- store <8 x i16> %inst12, <8 x i16>* %inst16, align 2
+ %inst10 = getelementptr i8, ptr %arg1, i64 %inst9
+ %inst12 = load <8 x i16>, ptr %inst10, align 2
+ %inst13 = getelementptr i16, ptr %arg, i64 %inst
+ store <8 x i16> %inst8, ptr %inst13, align 2
+ %inst15 = getelementptr i16, ptr %arg, i64 %inst4
+ store <8 x i16> %inst12, ptr %inst15, align 2
%inst17 = add nuw nsw i64 %inst, 16
%inst18 = icmp eq i64 %inst17, %arg2
br i1 %inst18, label %bb19, label %bb3
@@ -904,9 +899,9 @@ bb19: ; preds = %bb3
ret void
}
-define void @bad_step(i32* nocapture readnone %x) #0 {
+define void @bad_step(ptr nocapture readnone %x) #0 {
; CHECK-LABEL: define void @bad_step
-; CHECK-SAME: (i32* nocapture readnone [[X:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nocapture readnone [[X:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
@@ -952,9 +947,9 @@ define void @ptr_step_crash() {
; CHECK-NEXT: [[K_2207_3:%.*]] = phi i32 [ -512, [[ENTRY:%.*]] ], [ [[INC63_3:%.*]], [[FOR_BODY42_3]] ]
; CHECK-NEXT: [[SUB46_3:%.*]] = add nsw i32 [[K_2207_3]], 512
; CHECK-NEXT: [[IDXPROM47_3:%.*]] = zext i32 [[SUB46_3]] to i64
-; CHECK-NEXT: [[ARRAYIDX48_3:%.*]] = getelementptr inbounds [2 x [512 x i64]], [2 x [512 x i64]]* @a, i64 0, i64 0, i64 [[IDXPROM47_3]]
-; CHECK-NEXT: [[ARRAYIDX55_3:%.*]] = getelementptr inbounds [512 x [4 x i64]], [512 x [4 x i64]]* @b, i64 0, i64 [[IDXPROM47_3]], i64 3
-; CHECK-NEXT: [[TMP0:%.*]] = load i64, i64* [[ARRAYIDX55_3]], align 8
+; CHECK-NEXT: [[ARRAYIDX48_3:%.*]] = getelementptr inbounds [2 x [512 x i64]], ptr @a, i64 0, i64 0, i64 [[IDXPROM47_3]]
+; CHECK-NEXT: [[ARRAYIDX55_3:%.*]] = getelementptr inbounds [512 x [4 x i64]], ptr @b, i64 0, i64 [[IDXPROM47_3]], i64 3
+; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[ARRAYIDX55_3]], align 8
; CHECK-NEXT: [[INC63_3]] = add nsw i32 [[K_2207_3]], 1
; CHECK-NEXT: br i1 true, label [[FOR_INC65_3:%.*]], label [[FOR_BODY42_3]]
; CHECK: for.inc65.3:
@@ -967,9 +962,9 @@ for.body42.3: ; preds = %for.body42.3, %entr
%k.2207.3 = phi i32 [ -512, %entry ], [ %inc63.3, %for.body42.3 ]
%sub46.3 = add nsw i32 %k.2207.3, 512
%idxprom47.3 = zext i32 %sub46.3 to i64
- %arrayidx48.3 = getelementptr inbounds [2 x [512 x i64]], [2 x [512 x i64]]* @a, i64 0, i64 0, i64 %idxprom47.3
- %arrayidx55.3 = getelementptr inbounds [512 x [4 x i64]], [512 x [4 x i64]]* @b, i64 0, i64 %idxprom47.3, i64 3
- %0 = load i64, i64* %arrayidx55.3, align 8
+ %arrayidx48.3 = getelementptr inbounds [2 x [512 x i64]], ptr @a, i64 0, i64 0, i64 %idxprom47.3
+ %arrayidx55.3 = getelementptr inbounds [512 x [4 x i64]], ptr @b, i64 0, i64 %idxprom47.3, i64 3
+ %0 = load i64, ptr %arrayidx55.3, align 8
%inc63.3 = add nsw i32 %k.2207.3, 1
br i1 undef, label %for.inc65.3, label %for.body42.3
diff --git a/llvm/test/Transforms/LoopReroll/extra_instr.ll b/llvm/test/Transforms/LoopReroll/extra_instr.ll
index dfb87f7f01c6..3114463a3e04 100644
--- a/llvm/test/Transforms/LoopReroll/extra_instr.ll
+++ b/llvm/test/Transforms/LoopReroll/extra_instr.ll
@@ -1,18 +1,22 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt -opaque-pointers=0 -S -passes=loop-reroll %s | FileCheck %s
+; RUN: opt -S -passes=loop-reroll %s | FileCheck %s
target triple = "aarch64--linux-gnu"
-define void @rerollable1([2 x i32]* nocapture %a) {
+define void @rerollable1(ptr nocapture %a) {
; CHECK-LABEL: define void @rerollable1
-; CHECK-SAME: ([2 x i32]* nocapture [[A:%.*]]) {
+; CHECK-SAME: (ptr nocapture [[A:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
-; CHECK-NEXT: [[SCEVGEP1:%.*]] = getelementptr [2 x i32], [2 x i32]* [[A]], i64 20, i64 [[IV]]
-; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr [2 x i32], [2 x i32]* [[A]], i64 10, i64 [[IV]]
-; CHECK-NEXT: [[VALUE0:%.*]] = load i32, i32* [[SCEVGEP1]], align 4
-; CHECK-NEXT: store i32 [[VALUE0]], i32* [[SCEVGEP]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = shl nuw nsw i64 [[IV]], 2
+; CHECK-NEXT: [[TMP1:%.*]] = add i64 [[TMP0]], 160
+; CHECK-NEXT: [[SCEVGEP1:%.*]] = getelementptr i8, ptr [[A]], i64 [[TMP1]]
+; CHECK-NEXT: [[TMP2:%.*]] = shl nuw nsw i64 [[IV]], 2
+; CHECK-NEXT: [[TMP3:%.*]] = add i64 [[TMP2]], 80
+; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[A]], i64 [[TMP3]]
+; CHECK-NEXT: [[VALUE0:%.*]] = load i32, ptr [[SCEVGEP1]], align 4
+; CHECK-NEXT: store i32 [[VALUE0]], ptr [[SCEVGEP]], align 4
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[IV]], 1
; CHECK-NEXT: [[EXITCOND2:%.*]] = icmp eq i64 [[IV]], 9
; CHECK-NEXT: br i1 [[EXITCOND2]], label [[EXIT:%.*]], label [[LOOP]]
@@ -35,16 +39,16 @@ loop:
%plus10 = add nuw nsw i64 %iv, 10
; root instruction 0
- %ldptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus20, i64 0
- %value0 = load i32, i32* %ldptr0, align 4
- %stptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus10, i64 0
- store i32 %value0, i32* %stptr0, align 4
+ %ldptr0 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus20, i64 0
+ %value0 = load i32, ptr %ldptr0, align 4
+ %stptr0 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus10, i64 0
+ store i32 %value0, ptr %stptr0, align 4
; root instruction 1
- %ldptr1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus20, i64 1
- %value1 = load i32, i32* %ldptr1, align 4
- %stptr1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus10, i64 1
- store i32 %value1, i32* %stptr1, align 4
+ %ldptr1 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus20, i64 1
+ %value1 = load i32, ptr %ldptr1, align 4
+ %stptr1 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus10, i64 1
+ store i32 %value1, ptr %stptr1, align 4
; loop-increment
%iv.next = add nuw nsw i64 %iv, 1
@@ -57,25 +61,25 @@ exit:
ret void
}
-define void @unrerollable1([2 x i32]* nocapture %a) {
+define void @unrerollable1(ptr nocapture %a) {
; CHECK-LABEL: define void @unrerollable1
-; CHECK-SAME: ([2 x i32]* nocapture [[A:%.*]]) {
+; CHECK-SAME: (ptr nocapture [[A:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
-; CHECK-NEXT: [[STPTRX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[IV]], i64 0
-; CHECK-NEXT: store i32 999, i32* [[STPTRX]], align 4
+; CHECK-NEXT: [[STPTRX:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[IV]], i64 0
+; CHECK-NEXT: store i32 999, ptr [[STPTRX]], align 4
; CHECK-NEXT: [[PLUS20:%.*]] = add nuw nsw i64 [[IV]], 20
; CHECK-NEXT: [[PLUS10:%.*]] = add nuw nsw i64 [[IV]], 10
-; CHECK-NEXT: [[LDPTR0:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[PLUS20]], i64 0
-; CHECK-NEXT: [[VALUE0:%.*]] = load i32, i32* [[LDPTR0]], align 4
-; CHECK-NEXT: [[STPTR0:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[PLUS10]], i64 0
-; CHECK-NEXT: store i32 [[VALUE0]], i32* [[STPTR0]], align 4
-; CHECK-NEXT: [[LDPTR1:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[PLUS20]], i64 1
-; CHECK-NEXT: [[VALUE1:%.*]] = load i32, i32* [[LDPTR1]], align 4
-; CHECK-NEXT: [[STPTR1:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[PLUS10]], i64 1
-; CHECK-NEXT: store i32 [[VALUE1]], i32* [[STPTR1]], align 4
+; CHECK-NEXT: [[LDPTR0:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[PLUS20]], i64 0
+; CHECK-NEXT: [[VALUE0:%.*]] = load i32, ptr [[LDPTR0]], align 4
+; CHECK-NEXT: [[STPTR0:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[PLUS10]], i64 0
+; CHECK-NEXT: store i32 [[VALUE0]], ptr [[STPTR0]], align 4
+; CHECK-NEXT: [[LDPTR1:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[PLUS20]], i64 1
+; CHECK-NEXT: [[VALUE1:%.*]] = load i32, ptr [[LDPTR1]], align 4
+; CHECK-NEXT: [[STPTR1:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[PLUS10]], i64 1
+; CHECK-NEXT: store i32 [[VALUE1]], ptr [[STPTR1]], align 4
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[IV]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[IV_NEXT]], 5
; CHECK-NEXT: br i1 [[EXITCOND]], label [[EXIT:%.*]], label [[LOOP]]
@@ -92,24 +96,24 @@ loop:
%iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
; unrerollable instructions using %iv
- %stptrx = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %iv, i64 0
- store i32 999, i32* %stptrx, align 4
+ %stptrx = getelementptr inbounds [2 x i32], ptr %a, i64 %iv, i64 0
+ store i32 999, ptr %stptrx, align 4
; extra simple arithmetic operations, used by root instructions
%plus20 = add nuw nsw i64 %iv, 20
%plus10 = add nuw nsw i64 %iv, 10
; root instruction 0
- %ldptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus20, i64 0
- %value0 = load i32, i32* %ldptr0, align 4
- %stptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus10, i64 0
- store i32 %value0, i32* %stptr0, align 4
+ %ldptr0 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus20, i64 0
+ %value0 = load i32, ptr %ldptr0, align 4
+ %stptr0 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus10, i64 0
+ store i32 %value0, ptr %stptr0, align 4
; root instruction 1
- %ldptr1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus20, i64 1
- %value1 = load i32, i32* %ldptr1, align 4
- %stptr1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus10, i64 1
- store i32 %value1, i32* %stptr1, align 4
+ %ldptr1 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus20, i64 1
+ %value1 = load i32, ptr %ldptr1, align 4
+ %stptr1 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus10, i64 1
+ store i32 %value1, ptr %stptr1, align 4
; loop-increment
%iv.next = add nuw nsw i64 %iv, 1
@@ -122,26 +126,26 @@ exit:
ret void
}
-define void @unrerollable2([2 x i32]* nocapture %a) {
+define void @unrerollable2(ptr nocapture %a) {
; CHECK-LABEL: define void @unrerollable2
-; CHECK-SAME: ([2 x i32]* nocapture [[A:%.*]]) {
+; CHECK-SAME: (ptr nocapture [[A:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[IV]], 1
-; CHECK-NEXT: [[STPTRX:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[IV_NEXT]], i64 0
-; CHECK-NEXT: store i32 999, i32* [[STPTRX]], align 4
+; CHECK-NEXT: [[STPTRX:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[IV_NEXT]], i64 0
+; CHECK-NEXT: store i32 999, ptr [[STPTRX]], align 4
; CHECK-NEXT: [[PLUS20:%.*]] = add nuw nsw i64 [[IV]], 20
; CHECK-NEXT: [[PLUS10:%.*]] = add nuw nsw i64 [[IV]], 10
-; CHECK-NEXT: [[LDPTR0:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[PLUS20]], i64 0
-; CHECK-NEXT: [[VALUE0:%.*]] = load i32, i32* [[LDPTR0]], align 4
-; CHECK-NEXT: [[STPTR0:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[PLUS10]], i64 0
-; CHECK-NEXT: store i32 [[VALUE0]], i32* [[STPTR0]], align 4
-; CHECK-NEXT: [[LDPTR1:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[PLUS20]], i64 1
-; CHECK-NEXT: [[VALUE1:%.*]] = load i32, i32* [[LDPTR1]], align 4
-; CHECK-NEXT: [[STPTR1:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 [[PLUS10]], i64 1
-; CHECK-NEXT: store i32 [[VALUE1]], i32* [[STPTR1]], align 4
+; CHECK-NEXT: [[LDPTR0:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[PLUS20]], i64 0
+; CHECK-NEXT: [[VALUE0:%.*]] = load i32, ptr [[LDPTR0]], align 4
+; CHECK-NEXT: [[STPTR0:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[PLUS10]], i64 0
+; CHECK-NEXT: store i32 [[VALUE0]], ptr [[STPTR0]], align 4
+; CHECK-NEXT: [[LDPTR1:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[PLUS20]], i64 1
+; CHECK-NEXT: [[VALUE1:%.*]] = load i32, ptr [[LDPTR1]], align 4
+; CHECK-NEXT: [[STPTR1:%.*]] = getelementptr inbounds [2 x i32], ptr [[A]], i64 [[PLUS10]], i64 1
+; CHECK-NEXT: store i32 [[VALUE1]], ptr [[STPTR1]], align 4
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[IV_NEXT]], 5
; CHECK-NEXT: br i1 [[EXITCOND]], label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
@@ -160,24 +164,24 @@ loop:
%iv.next = add nuw nsw i64 %iv, 1
; unrerollable instructions using %iv.next
- %stptrx = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %iv.next, i64 0
- store i32 999, i32* %stptrx, align 4
+ %stptrx = getelementptr inbounds [2 x i32], ptr %a, i64 %iv.next, i64 0
+ store i32 999, ptr %stptrx, align 4
; extra simple arithmetic operations, used by root instructions
%plus20 = add nuw nsw i64 %iv, 20
%plus10 = add nuw nsw i64 %iv, 10
; root instruction 0
- %ldptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus20, i64 0
- %value0 = load i32, i32* %ldptr0, align 4
- %stptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus10, i64 0
- store i32 %value0, i32* %stptr0, align 4
+ %ldptr0 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus20, i64 0
+ %value0 = load i32, ptr %ldptr0, align 4
+ %stptr0 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus10, i64 0
+ store i32 %value0, ptr %stptr0, align 4
; root instruction 1
- %ldptr1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus20, i64 1
- %value1 = load i32, i32* %ldptr1, align 4
- %stptr1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus10, i64 1
- store i32 %value1, i32* %stptr1, align 4
+ %ldptr1 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus20, i64 1
+ %value1 = load i32, ptr %ldptr1, align 4
+ %stptr1 = getelementptr inbounds [2 x i32], ptr %a, i64 %plus10, i64 1
+ store i32 %value1, ptr %stptr1, align 4
; latch
%exitcond = icmp eq i64 %iv.next, 5
diff --git a/llvm/test/Transforms/LoopReroll/ptrindvar.ll b/llvm/test/Transforms/LoopReroll/ptrindvar.ll
index 020eb91654c3..90f6353197b2 100644
--- a/llvm/test/Transforms/LoopReroll/ptrindvar.ll
+++ b/llvm/test/Transforms/LoopReroll/ptrindvar.ll
@@ -1,14 +1,14 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt -opaque-pointers=0 -S -passes=loop-reroll %s | FileCheck %s
+; RUN: opt -S -passes=loop-reroll %s | FileCheck %s
target triple = "aarch64--linux-gnu"
-define i32 @test(i32* readonly %buf, i32* readnone %end) #0 {
+define i32 @test(ptr readonly %buf, ptr readnone %end) #0 {
; CHECK-LABEL: define i32 @test
-; CHECK-SAME: (i32* readonly [[BUF:%.*]], i32* readnone [[END:%.*]]) {
+; CHECK-SAME: (ptr readonly [[BUF:%.*]], ptr readnone [[END:%.*]]) {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[BUF2:%.*]] = ptrtoint i32* [[BUF]] to i64
-; CHECK-NEXT: [[END1:%.*]] = ptrtoint i32* [[END]] to i64
-; CHECK-NEXT: [[CMP_9:%.*]] = icmp eq i32* [[BUF]], [[END]]
+; CHECK-NEXT: [[BUF2:%.*]] = ptrtoint ptr [[BUF]] to i64
+; CHECK-NEXT: [[END1:%.*]] = ptrtoint ptr [[END]] to i64
+; CHECK-NEXT: [[CMP_9:%.*]] = icmp eq ptr [[BUF]], [[END]]
; CHECK-NEXT: br i1 [[CMP_9]], label [[WHILE_END:%.*]], label [[WHILE_BODY_PREHEADER:%.*]]
; CHECK: while.body.preheader:
; CHECK-NEXT: [[TMP0:%.*]] = add i64 [[END1]], -8
@@ -20,9 +20,10 @@ define i32 @test(i32* readonly %buf, i32* readnone %end) #0 {
; CHECK: while.body:
; CHECK-NEXT: [[INDVAR:%.*]] = phi i64 [ [[INDVAR_NEXT:%.*]], [[WHILE_BODY]] ], [ 0, [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[S_011:%.*]] = phi i32 [ [[ADD:%.*]], [[WHILE_BODY]] ], [ undef, [[WHILE_BODY_PREHEADER]] ]
-; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i32, i32* [[BUF]], i64 [[INDVAR]]
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[SCEVGEP]], align 4
-; CHECK-NEXT: [[ADD]] = add nsw i32 [[TMP5]], [[S_011]]
+; CHECK-NEXT: [[TMP5:%.*]] = shl nuw i64 [[INDVAR]], 2
+; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[BUF]], i64 [[TMP5]]
+; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[SCEVGEP]], align 4
+; CHECK-NEXT: [[ADD]] = add nsw i32 [[TMP6]], [[S_011]]
; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[INDVAR]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[INDVAR]], [[TMP4]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[WHILE_END_LOOPEXIT:%.*]], label [[WHILE_BODY]]
@@ -34,7 +35,7 @@ define i32 @test(i32* readonly %buf, i32* readnone %end) #0 {
; CHECK-NEXT: ret i32 [[S_0_LCSSA]]
;
entry:
- %cmp.9 = icmp eq i32* %buf, %end
+ %cmp.9 = icmp eq ptr %buf, %end
br i1 %cmp.9, label %while.end, label %while.body.preheader
while.body.preheader:
@@ -43,14 +44,14 @@ while.body.preheader:
while.body:
%S.011 = phi i32 [ %add2, %while.body ], [ undef, %while.body.preheader ]
- %buf.addr.010 = phi i32* [ %add.ptr, %while.body ], [ %buf, %while.body.preheader ]
- %0 = load i32, i32* %buf.addr.010, align 4
+ %buf.addr.010 = phi ptr [ %add.ptr, %while.body ], [ %buf, %while.body.preheader ]
+ %0 = load i32, ptr %buf.addr.010, align 4
%add = add nsw i32 %0, %S.011
- %arrayidx1 = getelementptr inbounds i32, i32* %buf.addr.010, i64 1
- %1 = load i32, i32* %arrayidx1, align 4
+ %arrayidx1 = getelementptr inbounds i32, ptr %buf.addr.010, i64 1
+ %1 = load i32, ptr %arrayidx1, align 4
%add2 = add nsw i32 %add, %1
- %add.ptr = getelementptr inbounds i32, i32* %buf.addr.010, i64 2
- %cmp = icmp eq i32* %add.ptr, %end
+ %add.ptr = getelementptr inbounds i32, ptr %buf.addr.010, i64 2
+ %cmp = icmp eq ptr %add.ptr, %end
br i1 %cmp, label %while.end.loopexit, label %while.body
while.end.loopexit:
@@ -62,13 +63,13 @@ while.end:
ret i32 %S.0.lcssa
}
-define i32 @test2(i32* readonly %buf, i32* readnone %end) #0 {
+define i32 @test2(ptr readonly %buf, ptr readnone %end) #0 {
; CHECK-LABEL: define i32 @test2
-; CHECK-SAME: (i32* readonly [[BUF:%.*]], i32* readnone [[END:%.*]]) {
+; CHECK-SAME: (ptr readonly [[BUF:%.*]], ptr readnone [[END:%.*]]) {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[END2:%.*]] = ptrtoint i32* [[END]] to i64
-; CHECK-NEXT: [[BUF1:%.*]] = ptrtoint i32* [[BUF]] to i64
-; CHECK-NEXT: [[CMP_9:%.*]] = icmp eq i32* [[BUF]], [[END]]
+; CHECK-NEXT: [[END2:%.*]] = ptrtoint ptr [[END]] to i64
+; CHECK-NEXT: [[BUF1:%.*]] = ptrtoint ptr [[BUF]] to i64
+; CHECK-NEXT: [[CMP_9:%.*]] = icmp eq ptr [[BUF]], [[END]]
; CHECK-NEXT: br i1 [[CMP_9]], label [[WHILE_END:%.*]], label [[WHILE_BODY_PREHEADER:%.*]]
; CHECK: while.body.preheader:
; CHECK-NEXT: [[TMP0:%.*]] = add i64 [[BUF1]], -8
@@ -80,9 +81,9 @@ define i32 @test2(i32* readonly %buf, i32* readnone %end) #0 {
; CHECK: while.body:
; CHECK-NEXT: [[INDVAR:%.*]] = phi i64 [ [[INDVAR_NEXT:%.*]], [[WHILE_BODY]] ], [ 0, [[WHILE_BODY_PREHEADER]] ]
; CHECK-NEXT: [[S_011:%.*]] = phi i32 [ [[ADD:%.*]], [[WHILE_BODY]] ], [ undef, [[WHILE_BODY_PREHEADER]] ]
-; CHECK-NEXT: [[TMP5:%.*]] = mul nsw i64 [[INDVAR]], -1
-; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i32, i32* [[BUF]], i64 [[TMP5]]
-; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* [[SCEVGEP]], align 4
+; CHECK-NEXT: [[TMP5:%.*]] = mul nsw i64 [[INDVAR]], -4
+; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[BUF]], i64 [[TMP5]]
+; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[SCEVGEP]], align 4
; CHECK-NEXT: [[ADD]] = add nsw i32 [[TMP6]], [[S_011]]
; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[INDVAR]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[INDVAR]], [[TMP4]]
@@ -95,7 +96,7 @@ define i32 @test2(i32* readonly %buf, i32* readnone %end) #0 {
; CHECK-NEXT: ret i32 [[S_0_LCSSA]]
;
entry:
- %cmp.9 = icmp eq i32* %buf, %end
+ %cmp.9 = icmp eq ptr %buf, %end
br i1 %cmp.9, label %while.end, label %while.body.preheader
while.body.preheader:
@@ -104,14 +105,14 @@ while.body.preheader:
while.body:
%S.011 = phi i32 [ %add2, %while.body ], [ undef, %while.body.preheader ]
- %buf.addr.010 = phi i32* [ %add.ptr, %while.body ], [ %buf, %while.body.preheader ]
- %0 = load i32, i32* %buf.addr.010, align 4
+ %buf.addr.010 = phi ptr [ %add.ptr, %while.body ], [ %buf, %while.body.preheader ]
+ %0 = load i32, ptr %buf.addr.010, align 4
%add = add nsw i32 %0, %S.011
- %arrayidx1 = getelementptr inbounds i32, i32* %buf.addr.010, i64 -1
- %1 = load i32, i32* %arrayidx1, align 4
+ %arrayidx1 = getelementptr inbounds i32, ptr %buf.addr.010, i64 -1
+ %1 = load i32, ptr %arrayidx1, align 4
%add2 = add nsw i32 %add, %1
- %add.ptr = getelementptr inbounds i32, i32* %buf.addr.010, i64 -2
- %cmp = icmp eq i32* %add.ptr, %end
+ %add.ptr = getelementptr inbounds i32, ptr %buf.addr.010, i64 -2
+ %cmp = icmp eq ptr %add.ptr, %end
br i1 %cmp, label %while.end.loopexit, label %while.body
while.end.loopexit:
More information about the llvm-commits
mailing list