[llvm] a34ae06 - [SLPVectorizer] Convert some tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 4 07:35:09 PST 2023
Author: Nikita Popov
Date: 2023-01-04T16:34:39+01:00
New Revision: a34ae06c209752cdb3756cad89e0ea227fffd4d4
URL: https://github.com/llvm/llvm-project/commit/a34ae06c209752cdb3756cad89e0ea227fffd4d4
DIFF: https://github.com/llvm/llvm-project/commit/a34ae06c209752cdb3756cad89e0ea227fffd4d4.diff
LOG: [SLPVectorizer] Convert some tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/SLPVectorizer/AArch64/loadi8.ll
llvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks.ll
llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-di.ll
llvm/test/Transforms/SLPVectorizer/ARM/sroa.ll
llvm/test/Transforms/SLPVectorizer/X86/bad-reduction.ll
llvm/test/Transforms/SLPVectorizer/X86/combined-stores-chains.ll
llvm/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll
llvm/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll
llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll
llvm/test/Transforms/SLPVectorizer/X86/cse.ll
llvm/test/Transforms/SLPVectorizer/X86/multi_block.ll
llvm/test/Transforms/SLPVectorizer/X86/pr35497.ll
llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll
llvm/test/Transforms/SLPVectorizer/X86/reorder-reused-masked-gather2.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/loadi8.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/loadi8.ll
index 4ee040a29bb30..90a30808aeeba 100644
--- a/llvm/test/Transforms/SLPVectorizer/AArch64/loadi8.ll
+++ b/llvm/test/Transforms/SLPVectorizer/AArch64/loadi8.ll
@@ -6,37 +6,33 @@ target triple = "aarch64"
%struct.weight_t = type { i32, i32 }
-define void @f_noalias(i8* noalias nocapture %dst, i8* noalias nocapture readonly %src, %struct.weight_t* noalias nocapture readonly %w) {
+define void @f_noalias(ptr noalias nocapture %dst, ptr noalias nocapture readonly %src, ptr noalias nocapture readonly %w) {
; CHECK-LABEL: @f_noalias(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SCALE:%.*]] = getelementptr inbounds [[STRUCT_WEIGHT_T:%.*]], %struct.weight_t* [[W:%.*]], i64 0, i32 0
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[SCALE]], align 16
-; CHECK-NEXT: [[OFFSET:%.*]] = getelementptr inbounds [[STRUCT_WEIGHT_T]], %struct.weight_t* [[W]], i64 0, i32 1
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[OFFSET]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[SRC:%.*]] to <4 x i8>*
-; CHECK-NEXT: [[TMP3:%.*]] = load <4 x i8>, <4 x i8>* [[TMP2]], align 1
-; CHECK-NEXT: [[TMP4:%.*]] = zext <4 x i8> [[TMP3]] to <4 x i32>
-; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x i32> [[TMP5]], <4 x i32> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: [[TMP6:%.*]] = mul nsw <4 x i32> [[SHUFFLE]], [[TMP4]]
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[W:%.*]], align 16
+; CHECK-NEXT: [[OFFSET:%.*]] = getelementptr inbounds [[STRUCT_WEIGHT_T:%.*]], ptr [[W]], i64 0, i32 1
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[OFFSET]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i8>, ptr [[SRC:%.*]], align 1
+; CHECK-NEXT: [[TMP3:%.*]] = zext <4 x i8> [[TMP2]] to <4 x i32>
+; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i32 0
+; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i32> [[TMP4]], <4 x i32> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP6:%.*]] = mul nsw <4 x i32> [[TMP5]], [[TMP3]]
; CHECK-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> poison, i32 [[TMP1]], i32 0
-; CHECK-NEXT: [[SHUFFLE1:%.*]] = shufflevector <4 x i32> [[TMP7]], <4 x i32> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: [[TMP8:%.*]] = add nsw <4 x i32> [[TMP6]], [[SHUFFLE1]]
-; CHECK-NEXT: [[TMP9:%.*]] = icmp ult <4 x i32> [[TMP8]], <i32 256, i32 256, i32 256, i32 256>
-; CHECK-NEXT: [[TMP10:%.*]] = icmp sgt <4 x i32> [[TMP8]], zeroinitializer
-; CHECK-NEXT: [[TMP11:%.*]] = sext <4 x i1> [[TMP10]] to <4 x i32>
-; CHECK-NEXT: [[TMP12:%.*]] = select <4 x i1> [[TMP9]], <4 x i32> [[TMP8]], <4 x i32> [[TMP11]]
-; CHECK-NEXT: [[TMP13:%.*]] = trunc <4 x i32> [[TMP12]] to <4 x i8>
-; CHECK-NEXT: [[TMP14:%.*]] = bitcast i8* [[DST:%.*]] to <4 x i8>*
-; CHECK-NEXT: store <4 x i8> [[TMP13]], <4 x i8>* [[TMP14]], align 1
+; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <4 x i32> [[TMP7]], <4 x i32> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP9:%.*]] = add nsw <4 x i32> [[TMP6]], [[TMP8]]
+; CHECK-NEXT: [[TMP10:%.*]] = icmp ult <4 x i32> [[TMP9]], <i32 256, i32 256, i32 256, i32 256>
+; CHECK-NEXT: [[TMP11:%.*]] = icmp sgt <4 x i32> [[TMP9]], zeroinitializer
+; CHECK-NEXT: [[TMP12:%.*]] = sext <4 x i1> [[TMP11]] to <4 x i32>
+; CHECK-NEXT: [[TMP13:%.*]] = select <4 x i1> [[TMP10]], <4 x i32> [[TMP9]], <4 x i32> [[TMP12]]
+; CHECK-NEXT: [[TMP14:%.*]] = trunc <4 x i32> [[TMP13]] to <4 x i8>
+; CHECK-NEXT: store <4 x i8> [[TMP14]], ptr [[DST:%.*]], align 1
; CHECK-NEXT: ret void
;
entry:
- %scale = getelementptr inbounds %struct.weight_t, %struct.weight_t* %w, i64 0, i32 0
- %0 = load i32, i32* %scale, align 16
- %offset = getelementptr inbounds %struct.weight_t, %struct.weight_t* %w, i64 0, i32 1
- %1 = load i32, i32* %offset, align 4
- %2 = load i8, i8* %src, align 1
+ %0 = load i32, ptr %w, align 16
+ %offset = getelementptr inbounds %struct.weight_t, ptr %w, i64 0, i32 1
+ %1 = load i32, ptr %offset, align 4
+ %2 = load i8, ptr %src, align 1
%conv = zext i8 %2 to i32
%mul = mul nsw i32 %0, %conv
%add = add nsw i32 %mul, %1
@@ -45,9 +41,9 @@ entry:
%shr.i = sext i1 %3 to i32
%cond.i = select i1 %tobool.not.i, i32 %add, i32 %shr.i
%conv.i = trunc i32 %cond.i to i8
- store i8 %conv.i, i8* %dst, align 1
- %arrayidx.1 = getelementptr inbounds i8, i8* %src, i64 1
- %4 = load i8, i8* %arrayidx.1, align 1
+ store i8 %conv.i, ptr %dst, align 1
+ %arrayidx.1 = getelementptr inbounds i8, ptr %src, i64 1
+ %4 = load i8, ptr %arrayidx.1, align 1
%conv.1 = zext i8 %4 to i32
%mul.1 = mul nsw i32 %0, %conv.1
%add.1 = add nsw i32 %mul.1, %1
@@ -56,10 +52,10 @@ entry:
%shr.i.1 = sext i1 %5 to i32
%cond.i.1 = select i1 %tobool.not.i.1, i32 %add.1, i32 %shr.i.1
%conv.i.1 = trunc i32 %cond.i.1 to i8
- %arrayidx2.1 = getelementptr inbounds i8, i8* %dst, i64 1
- store i8 %conv.i.1, i8* %arrayidx2.1, align 1
- %arrayidx.2 = getelementptr inbounds i8, i8* %src, i64 2
- %6 = load i8, i8* %arrayidx.2, align 1
+ %arrayidx2.1 = getelementptr inbounds i8, ptr %dst, i64 1
+ store i8 %conv.i.1, ptr %arrayidx2.1, align 1
+ %arrayidx.2 = getelementptr inbounds i8, ptr %src, i64 2
+ %6 = load i8, ptr %arrayidx.2, align 1
%conv.2 = zext i8 %6 to i32
%mul.2 = mul nsw i32 %0, %conv.2
%add.2 = add nsw i32 %mul.2, %1
@@ -68,10 +64,10 @@ entry:
%shr.i.2 = sext i1 %7 to i32
%cond.i.2 = select i1 %tobool.not.i.2, i32 %add.2, i32 %shr.i.2
%conv.i.2 = trunc i32 %cond.i.2 to i8
- %arrayidx2.2 = getelementptr inbounds i8, i8* %dst, i64 2
- store i8 %conv.i.2, i8* %arrayidx2.2, align 1
- %arrayidx.3 = getelementptr inbounds i8, i8* %src, i64 3
- %8 = load i8, i8* %arrayidx.3, align 1
+ %arrayidx2.2 = getelementptr inbounds i8, ptr %dst, i64 2
+ store i8 %conv.i.2, ptr %arrayidx2.2, align 1
+ %arrayidx.3 = getelementptr inbounds i8, ptr %src, i64 3
+ %8 = load i8, ptr %arrayidx.3, align 1
%conv.3 = zext i8 %8 to i32
%mul.3 = mul nsw i32 %0, %conv.3
%add.3 = add nsw i32 %mul.3, %1
@@ -80,8 +76,8 @@ entry:
%shr.i.3 = sext i1 %9 to i32
%cond.i.3 = select i1 %tobool.not.i.3, i32 %add.3, i32 %shr.i.3
%conv.i.3 = trunc i32 %cond.i.3 to i8
- %arrayidx2.3 = getelementptr inbounds i8, i8* %dst, i64 3
- store i8 %conv.i.3, i8* %arrayidx2.3, align 1
+ %arrayidx2.3 = getelementptr inbounds i8, ptr %dst, i64 3
+ store i8 %conv.i.3, ptr %arrayidx2.3, align 1
ret void
}
@@ -89,14 +85,13 @@ entry:
; This currently prevents SLP vectorization, but the SLP vectorizer should
; be taught to emit runtime checks enabling vectorization.
;
-define void @f_alias(i8* nocapture %dst, i8* nocapture readonly %src, %struct.weight_t* nocapture readonly %w) {
+define void @f_alias(ptr nocapture %dst, ptr nocapture readonly %src, ptr nocapture readonly %w) {
; CHECK-LABEL: @f_alias(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SCALE:%.*]] = getelementptr inbounds [[STRUCT_WEIGHT_T:%.*]], %struct.weight_t* [[W:%.*]], i64 0, i32 0
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[SCALE]], align 16
-; CHECK-NEXT: [[OFFSET:%.*]] = getelementptr inbounds [[STRUCT_WEIGHT_T]], %struct.weight_t* [[W]], i64 0, i32 1
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[OFFSET]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = load i8, i8* [[SRC:%.*]], align 1
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[W:%.*]], align 16
+; CHECK-NEXT: [[OFFSET:%.*]] = getelementptr inbounds [[STRUCT_WEIGHT_T:%.*]], ptr [[W]], i64 0, i32 1
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[OFFSET]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load i8, ptr [[SRC:%.*]], align 1
; CHECK-NEXT: [[CONV:%.*]] = zext i8 [[TMP2]] to i32
; CHECK-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP0]], [[CONV]]
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[MUL]], [[TMP1]]
@@ -105,9 +100,9 @@ define void @f_alias(i8* nocapture %dst, i8* nocapture readonly %src, %struct.we
; CHECK-NEXT: [[SHR_I:%.*]] = sext i1 [[TMP3]] to i32
; CHECK-NEXT: [[COND_I:%.*]] = select i1 [[TOBOOL_NOT_I]], i32 [[ADD]], i32 [[SHR_I]]
; CHECK-NEXT: [[CONV_I:%.*]] = trunc i32 [[COND_I]] to i8
-; CHECK-NEXT: store i8 [[CONV_I]], i8* [[DST:%.*]], align 1
-; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds i8, i8* [[SRC]], i64 1
-; CHECK-NEXT: [[TMP4:%.*]] = load i8, i8* [[ARRAYIDX_1]], align 1
+; CHECK-NEXT: store i8 [[CONV_I]], ptr [[DST:%.*]], align 1
+; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[TMP4:%.*]] = load i8, ptr [[ARRAYIDX_1]], align 1
; CHECK-NEXT: [[CONV_1:%.*]] = zext i8 [[TMP4]] to i32
; CHECK-NEXT: [[MUL_1:%.*]] = mul nsw i32 [[TMP0]], [[CONV_1]]
; CHECK-NEXT: [[ADD_1:%.*]] = add nsw i32 [[MUL_1]], [[TMP1]]
@@ -116,10 +111,10 @@ define void @f_alias(i8* nocapture %dst, i8* nocapture readonly %src, %struct.we
; CHECK-NEXT: [[SHR_I_1:%.*]] = sext i1 [[TMP5]] to i32
; CHECK-NEXT: [[COND_I_1:%.*]] = select i1 [[TOBOOL_NOT_I_1]], i32 [[ADD_1]], i32 [[SHR_I_1]]
; CHECK-NEXT: [[CONV_I_1:%.*]] = trunc i32 [[COND_I_1]] to i8
-; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds i8, i8* [[DST]], i64 1
-; CHECK-NEXT: store i8 [[CONV_I_1]], i8* [[ARRAYIDX2_1]], align 1
-; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds i8, i8* [[SRC]], i64 2
-; CHECK-NEXT: [[TMP6:%.*]] = load i8, i8* [[ARRAYIDX_2]], align 1
+; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 1
+; CHECK-NEXT: store i8 [[CONV_I_1]], ptr [[ARRAYIDX2_1]], align 1
+; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i64 2
+; CHECK-NEXT: [[TMP6:%.*]] = load i8, ptr [[ARRAYIDX_2]], align 1
; CHECK-NEXT: [[CONV_2:%.*]] = zext i8 [[TMP6]] to i32
; CHECK-NEXT: [[MUL_2:%.*]] = mul nsw i32 [[TMP0]], [[CONV_2]]
; CHECK-NEXT: [[ADD_2:%.*]] = add nsw i32 [[MUL_2]], [[TMP1]]
@@ -128,10 +123,10 @@ define void @f_alias(i8* nocapture %dst, i8* nocapture readonly %src, %struct.we
; CHECK-NEXT: [[SHR_I_2:%.*]] = sext i1 [[TMP7]] to i32
; CHECK-NEXT: [[COND_I_2:%.*]] = select i1 [[TOBOOL_NOT_I_2]], i32 [[ADD_2]], i32 [[SHR_I_2]]
; CHECK-NEXT: [[CONV_I_2:%.*]] = trunc i32 [[COND_I_2]] to i8
-; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds i8, i8* [[DST]], i64 2
-; CHECK-NEXT: store i8 [[CONV_I_2]], i8* [[ARRAYIDX2_2]], align 1
-; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds i8, i8* [[SRC]], i64 3
-; CHECK-NEXT: [[TMP8:%.*]] = load i8, i8* [[ARRAYIDX_3]], align 1
+; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 2
+; CHECK-NEXT: store i8 [[CONV_I_2]], ptr [[ARRAYIDX2_2]], align 1
+; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i64 3
+; CHECK-NEXT: [[TMP8:%.*]] = load i8, ptr [[ARRAYIDX_3]], align 1
; CHECK-NEXT: [[CONV_3:%.*]] = zext i8 [[TMP8]] to i32
; CHECK-NEXT: [[MUL_3:%.*]] = mul nsw i32 [[TMP0]], [[CONV_3]]
; CHECK-NEXT: [[ADD_3:%.*]] = add nsw i32 [[MUL_3]], [[TMP1]]
@@ -140,16 +135,15 @@ define void @f_alias(i8* nocapture %dst, i8* nocapture readonly %src, %struct.we
; CHECK-NEXT: [[SHR_I_3:%.*]] = sext i1 [[TMP9]] to i32
; CHECK-NEXT: [[COND_I_3:%.*]] = select i1 [[TOBOOL_NOT_I_3]], i32 [[ADD_3]], i32 [[SHR_I_3]]
; CHECK-NEXT: [[CONV_I_3:%.*]] = trunc i32 [[COND_I_3]] to i8
-; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds i8, i8* [[DST]], i64 3
-; CHECK-NEXT: store i8 [[CONV_I_3]], i8* [[ARRAYIDX2_3]], align 1
+; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 3
+; CHECK-NEXT: store i8 [[CONV_I_3]], ptr [[ARRAYIDX2_3]], align 1
; CHECK-NEXT: ret void
;
entry:
- %scale = getelementptr inbounds %struct.weight_t, %struct.weight_t* %w, i64 0, i32 0
- %0 = load i32, i32* %scale, align 16
- %offset = getelementptr inbounds %struct.weight_t, %struct.weight_t* %w, i64 0, i32 1
- %1 = load i32, i32* %offset, align 4
- %2 = load i8, i8* %src, align 1
+ %0 = load i32, ptr %w, align 16
+ %offset = getelementptr inbounds %struct.weight_t, ptr %w, i64 0, i32 1
+ %1 = load i32, ptr %offset, align 4
+ %2 = load i8, ptr %src, align 1
%conv = zext i8 %2 to i32
%mul = mul nsw i32 %0, %conv
%add = add nsw i32 %mul, %1
@@ -158,9 +152,9 @@ entry:
%shr.i = sext i1 %3 to i32
%cond.i = select i1 %tobool.not.i, i32 %add, i32 %shr.i
%conv.i = trunc i32 %cond.i to i8
- store i8 %conv.i, i8* %dst, align 1
- %arrayidx.1 = getelementptr inbounds i8, i8* %src, i64 1
- %4 = load i8, i8* %arrayidx.1, align 1
+ store i8 %conv.i, ptr %dst, align 1
+ %arrayidx.1 = getelementptr inbounds i8, ptr %src, i64 1
+ %4 = load i8, ptr %arrayidx.1, align 1
%conv.1 = zext i8 %4 to i32
%mul.1 = mul nsw i32 %0, %conv.1
%add.1 = add nsw i32 %mul.1, %1
@@ -169,10 +163,10 @@ entry:
%shr.i.1 = sext i1 %5 to i32
%cond.i.1 = select i1 %tobool.not.i.1, i32 %add.1, i32 %shr.i.1
%conv.i.1 = trunc i32 %cond.i.1 to i8
- %arrayidx2.1 = getelementptr inbounds i8, i8* %dst, i64 1
- store i8 %conv.i.1, i8* %arrayidx2.1, align 1
- %arrayidx.2 = getelementptr inbounds i8, i8* %src, i64 2
- %6 = load i8, i8* %arrayidx.2, align 1
+ %arrayidx2.1 = getelementptr inbounds i8, ptr %dst, i64 1
+ store i8 %conv.i.1, ptr %arrayidx2.1, align 1
+ %arrayidx.2 = getelementptr inbounds i8, ptr %src, i64 2
+ %6 = load i8, ptr %arrayidx.2, align 1
%conv.2 = zext i8 %6 to i32
%mul.2 = mul nsw i32 %0, %conv.2
%add.2 = add nsw i32 %mul.2, %1
@@ -181,10 +175,10 @@ entry:
%shr.i.2 = sext i1 %7 to i32
%cond.i.2 = select i1 %tobool.not.i.2, i32 %add.2, i32 %shr.i.2
%conv.i.2 = trunc i32 %cond.i.2 to i8
- %arrayidx2.2 = getelementptr inbounds i8, i8* %dst, i64 2
- store i8 %conv.i.2, i8* %arrayidx2.2, align 1
- %arrayidx.3 = getelementptr inbounds i8, i8* %src, i64 3
- %8 = load i8, i8* %arrayidx.3, align 1
+ %arrayidx2.2 = getelementptr inbounds i8, ptr %dst, i64 2
+ store i8 %conv.i.2, ptr %arrayidx2.2, align 1
+ %arrayidx.3 = getelementptr inbounds i8, ptr %src, i64 3
+ %8 = load i8, ptr %arrayidx.3, align 1
%conv.3 = zext i8 %8 to i32
%mul.3 = mul nsw i32 %0, %conv.3
%add.3 = add nsw i32 %mul.3, %1
@@ -193,7 +187,7 @@ entry:
%shr.i.3 = sext i1 %9 to i32
%cond.i.3 = select i1 %tobool.not.i.3, i32 %add.3, i32 %shr.i.3
%conv.i.3 = trunc i32 %cond.i.3 to i8
- %arrayidx2.3 = getelementptr inbounds i8, i8* %dst, i64 3
- store i8 %conv.i.3, i8* %arrayidx2.3, align 1
+ %arrayidx2.3 = getelementptr inbounds i8, ptr %dst, i64 3
+ store i8 %conv.i.3, ptr %arrayidx2.3, align 1
ret void
}
diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks.ll
index a33857391af10..5bdbfbbfe96df 100644
--- a/llvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks.ll
+++ b/llvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks.ll
@@ -1,141 +1,141 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -aa-pipeline='basic-aa,scoped-noalias-aa' -passes=slp-vectorizer -mtriple=arm64-apple-darwin -S %s | FileCheck %s
-define void @needs_versioning_not_profitable(i32* %dst, i32* %src) {
+define void @needs_versioning_not_profitable(ptr %dst, ptr %src) {
; CHECK-LABEL: @needs_versioning_not_profitable(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC:%.*]], align 4
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
; CHECK-NEXT: ret void
;
entry:
- %src.0 = load i32, i32* %src, align 4
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
ret void
}
-define void @needs_versioning_profitable(i32* %dst, i32* %src) {
+define void @needs_versioning_profitable(ptr %dst, ptr %src) {
; CHECK-LABEL: @needs_versioning_profitable(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC:%.*]], align 4
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
-; CHECK-NEXT: [[SRC_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 2
-; CHECK-NEXT: [[SRC_2:%.*]] = load i32, i32* [[SRC_GEP_2]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[SRC_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 2
+; CHECK-NEXT: [[SRC_2:%.*]] = load i32, ptr [[SRC_GEP_2]], align 4
; CHECK-NEXT: [[R_2:%.*]] = ashr i32 [[SRC_2]], 16
-; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 2
-; CHECK-NEXT: store i32 [[R_2]], i32* [[DST_GEP_2]], align 4
-; CHECK-NEXT: [[SRC_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 3
-; CHECK-NEXT: [[SRC_3:%.*]] = load i32, i32* [[SRC_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 2
+; CHECK-NEXT: store i32 [[R_2]], ptr [[DST_GEP_2]], align 4
+; CHECK-NEXT: [[SRC_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 3
+; CHECK-NEXT: [[SRC_3:%.*]] = load i32, ptr [[SRC_GEP_3]], align 4
; CHECK-NEXT: [[R_3:%.*]] = ashr i32 [[SRC_3]], 16
-; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 3
-; CHECK-NEXT: store i32 [[R_3]], i32* [[DST_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 3
+; CHECK-NEXT: store i32 [[R_3]], ptr [[DST_GEP_3]], align 4
; CHECK-NEXT: ret void
;
entry:
- %src.0 = load i32, i32* %src, align 4
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
- %src.gep.2 = getelementptr inbounds i32, i32* %src, i64 2
- %src.2 = load i32, i32* %src.gep.2, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
+ %src.gep.2 = getelementptr inbounds i32, ptr %src, i64 2
+ %src.2 = load i32, ptr %src.gep.2, align 4
%r.2 = ashr i32 %src.2, 16
- %dst.gep.2 = getelementptr inbounds i32, i32* %dst, i64 2
- store i32 %r.2, i32* %dst.gep.2, align 4
- %src.gep.3 = getelementptr inbounds i32, i32* %src, i64 3
- %src.3 = load i32, i32* %src.gep.3, align 4
+ %dst.gep.2 = getelementptr inbounds i32, ptr %dst, i64 2
+ store i32 %r.2, ptr %dst.gep.2, align 4
+ %src.gep.3 = getelementptr inbounds i32, ptr %src, i64 3
+ %src.3 = load i32, ptr %src.gep.3, align 4
%r.3 = ashr i32 %src.3, 16
- %dst.gep.3 = getelementptr inbounds i32, i32* %dst, i64 3
- store i32 %r.3, i32* %dst.gep.3, align 4
+ %dst.gep.3 = getelementptr inbounds i32, ptr %dst, i64 3
+ store i32 %r.3, ptr %dst.gep.3, align 4
ret void
}
-define void @needs_versioning_profitable_2_sources(i32* %dst, i32* %A, i32* %B) {
+define void @needs_versioning_profitable_2_sources(ptr %dst, ptr %A, ptr %B) {
; CHECK-LABEL: @needs_versioning_profitable_2_sources(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[A_0:%.*]] = load i32, i32* [[A:%.*]], align 4
-; CHECK-NEXT: [[B_0:%.*]] = load i32, i32* [[B:%.*]], align 4
+; CHECK-NEXT: [[A_0:%.*]] = load i32, ptr [[A:%.*]], align 4
+; CHECK-NEXT: [[B_0:%.*]] = load i32, ptr [[B:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = add i32 [[A_0]], [[B_0]]
; CHECK-NEXT: [[MUL_0:%.*]] = mul i32 [[R_0]], 2
-; CHECK-NEXT: store i32 [[MUL_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 1
-; CHECK-NEXT: [[A_1:%.*]] = load i32, i32* [[A_GEP_1]], align 4
-; CHECK-NEXT: [[B_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 1
-; CHECK-NEXT: [[B_1:%.*]] = load i32, i32* [[B_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[MUL_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 1
+; CHECK-NEXT: [[A_1:%.*]] = load i32, ptr [[A_GEP_1]], align 4
+; CHECK-NEXT: [[B_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[B]], i64 1
+; CHECK-NEXT: [[B_1:%.*]] = load i32, ptr [[B_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = add i32 [[A_1]], [[B_1]]
; CHECK-NEXT: [[MUL_1:%.*]] = mul i32 [[R_1]], 2
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[MUL_1]], i32* [[DST_GEP_1]], align 4
-; CHECK-NEXT: [[A_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 2
-; CHECK-NEXT: [[A_2:%.*]] = load i32, i32* [[A_GEP_2]], align 4
-; CHECK-NEXT: [[B_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 2
-; CHECK-NEXT: [[B_2:%.*]] = load i32, i32* [[B_GEP_2]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[MUL_1]], ptr [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[A_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 2
+; CHECK-NEXT: [[A_2:%.*]] = load i32, ptr [[A_GEP_2]], align 4
+; CHECK-NEXT: [[B_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[B]], i64 2
+; CHECK-NEXT: [[B_2:%.*]] = load i32, ptr [[B_GEP_2]], align 4
; CHECK-NEXT: [[R_2:%.*]] = add i32 [[A_2]], [[B_2]]
; CHECK-NEXT: [[MUL_2:%.*]] = mul i32 [[R_2]], 2
-; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 2
-; CHECK-NEXT: store i32 [[MUL_2]], i32* [[DST_GEP_2]], align 4
-; CHECK-NEXT: [[A_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 3
-; CHECK-NEXT: [[A_3:%.*]] = load i32, i32* [[A_GEP_3]], align 4
-; CHECK-NEXT: [[B_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 3
-; CHECK-NEXT: [[B_3:%.*]] = load i32, i32* [[B_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 2
+; CHECK-NEXT: store i32 [[MUL_2]], ptr [[DST_GEP_2]], align 4
+; CHECK-NEXT: [[A_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 3
+; CHECK-NEXT: [[A_3:%.*]] = load i32, ptr [[A_GEP_3]], align 4
+; CHECK-NEXT: [[B_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[B]], i64 3
+; CHECK-NEXT: [[B_3:%.*]] = load i32, ptr [[B_GEP_3]], align 4
; CHECK-NEXT: [[R_3:%.*]] = add i32 [[A_3]], [[B_3]]
; CHECK-NEXT: [[MUL_3:%.*]] = mul i32 [[R_3]], 2
-; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 3
-; CHECK-NEXT: store i32 [[MUL_3]], i32* [[DST_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 3
+; CHECK-NEXT: store i32 [[MUL_3]], ptr [[DST_GEP_3]], align 4
; CHECK-NEXT: ret void
;
entry:
- %A.0 = load i32, i32* %A, align 4
- %B.0 = load i32, i32* %B, align 4
+ %A.0 = load i32, ptr %A, align 4
+ %B.0 = load i32, ptr %B, align 4
%r.0 = add i32 %A.0, %B.0
%mul.0 = mul i32 %r.0, 2
- store i32 %mul.0, i32* %dst, align 4
- %A.gep.1 = getelementptr inbounds i32, i32* %A, i64 1
- %A.1 = load i32, i32* %A.gep.1, align 4
- %B.gep.1 = getelementptr inbounds i32, i32* %B, i64 1
- %B.1 = load i32, i32* %B.gep.1, align 4
+ store i32 %mul.0, ptr %dst, align 4
+ %A.gep.1 = getelementptr inbounds i32, ptr %A, i64 1
+ %A.1 = load i32, ptr %A.gep.1, align 4
+ %B.gep.1 = getelementptr inbounds i32, ptr %B, i64 1
+ %B.1 = load i32, ptr %B.gep.1, align 4
%r.1 = add i32 %A.1, %B.1
%mul.1 = mul i32 %r.1, 2
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %mul.1, i32* %dst.gep.1, align 4
- %A.gep.2 = getelementptr inbounds i32, i32* %A, i64 2
- %A.2 = load i32, i32* %A.gep.2, align 4
- %B.gep.2 = getelementptr inbounds i32, i32* %B, i64 2
- %B.2 = load i32, i32* %B.gep.2, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %mul.1, ptr %dst.gep.1, align 4
+ %A.gep.2 = getelementptr inbounds i32, ptr %A, i64 2
+ %A.2 = load i32, ptr %A.gep.2, align 4
+ %B.gep.2 = getelementptr inbounds i32, ptr %B, i64 2
+ %B.2 = load i32, ptr %B.gep.2, align 4
%r.2 = add i32 %A.2, %B.2
%mul.2 = mul i32 %r.2, 2
- %dst.gep.2 = getelementptr inbounds i32, i32* %dst, i64 2
- store i32 %mul.2, i32* %dst.gep.2, align 4
- %A.gep.3 = getelementptr inbounds i32, i32* %A, i64 3
- %A.3 = load i32, i32* %A.gep.3, align 4
- %B.gep.3 = getelementptr inbounds i32, i32* %B, i64 3
- %B.3 = load i32, i32* %B.gep.3, align 4
+ %dst.gep.2 = getelementptr inbounds i32, ptr %dst, i64 2
+ store i32 %mul.2, ptr %dst.gep.2, align 4
+ %A.gep.3 = getelementptr inbounds i32, ptr %A, i64 3
+ %A.3 = load i32, ptr %A.gep.3, align 4
+ %B.gep.3 = getelementptr inbounds i32, ptr %B, i64 3
+ %B.3 = load i32, ptr %B.gep.3, align 4
%r.3 = add i32 %A.3, %B.3
%mul.3 = mul i32 %r.3, 2
- %dst.gep.3 = getelementptr inbounds i32, i32* %dst, i64 3
- store i32 %mul.3, i32* %dst.gep.3, align 4
+ %dst.gep.3 = getelementptr inbounds i32, ptr %dst, i64 3
+ store i32 %mul.3, ptr %dst.gep.3, align 4
ret void
}
@@ -144,30 +144,30 @@ declare void @use(i32)
declare void @bar()
-define void @needs_versioning_profitable_split_points(i32* %dst, i32* %src) {
+define void @needs_versioning_profitable_split_points(ptr %dst, ptr %src) {
; CHECK-LABEL: @needs_versioning_profitable_split_points(
; CHECK-NEXT: entry:
; CHECK-NEXT: call void @bar()
; CHECK-NEXT: call void @bar()
; CHECK-NEXT: call void @bar()
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC:%.*]], align 4
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
-; CHECK-NEXT: [[SRC_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 2
-; CHECK-NEXT: [[SRC_2:%.*]] = load i32, i32* [[SRC_GEP_2]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[SRC_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 2
+; CHECK-NEXT: [[SRC_2:%.*]] = load i32, ptr [[SRC_GEP_2]], align 4
; CHECK-NEXT: [[R_2:%.*]] = ashr i32 [[SRC_2]], 16
-; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 2
-; CHECK-NEXT: store i32 [[R_2]], i32* [[DST_GEP_2]], align 4
-; CHECK-NEXT: [[SRC_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 3
-; CHECK-NEXT: [[SRC_3:%.*]] = load i32, i32* [[SRC_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 2
+; CHECK-NEXT: store i32 [[R_2]], ptr [[DST_GEP_2]], align 4
+; CHECK-NEXT: [[SRC_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 3
+; CHECK-NEXT: [[SRC_3:%.*]] = load i32, ptr [[SRC_GEP_3]], align 4
; CHECK-NEXT: [[R_3:%.*]] = ashr i32 [[SRC_3]], 16
-; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 3
-; CHECK-NEXT: store i32 [[R_3]], i32* [[DST_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 3
+; CHECK-NEXT: store i32 [[R_3]], ptr [[DST_GEP_3]], align 4
; CHECK-NEXT: call void @bar()
; CHECK-NEXT: ret void
;
@@ -176,54 +176,54 @@ entry:
call void @bar()
call void @bar()
- %src.0 = load i32, i32* %src, align 4
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
- %src.gep.2 = getelementptr inbounds i32, i32* %src, i64 2
- %src.2 = load i32, i32* %src.gep.2, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
+ %src.gep.2 = getelementptr inbounds i32, ptr %src, i64 2
+ %src.2 = load i32, ptr %src.gep.2, align 4
%r.2 = ashr i32 %src.2, 16
- %dst.gep.2 = getelementptr inbounds i32, i32* %dst, i64 2
- store i32 %r.2, i32* %dst.gep.2, align 4
- %src.gep.3 = getelementptr inbounds i32, i32* %src, i64 3
- %src.3 = load i32, i32* %src.gep.3, align 4
+ %dst.gep.2 = getelementptr inbounds i32, ptr %dst, i64 2
+ store i32 %r.2, ptr %dst.gep.2, align 4
+ %src.gep.3 = getelementptr inbounds i32, ptr %src, i64 3
+ %src.3 = load i32, ptr %src.gep.3, align 4
%r.3 = ashr i32 %src.3, 16
- %dst.gep.3 = getelementptr inbounds i32, i32* %dst, i64 3
- store i32 %r.3, i32* %dst.gep.3, align 4
+ %dst.gep.3 = getelementptr inbounds i32, ptr %dst, i64 3
+ store i32 %r.3, ptr %dst.gep.3, align 4
call void @bar()
ret void
}
-define void @needs_versioning_profitable_load_used_outside_region1(i32* %dst, i32* %src, i1 %c) {
+define void @needs_versioning_profitable_load_used_outside_region1(ptr %dst, ptr %src, i1 %c) {
; CHECK-LABEL: @needs_versioning_profitable_load_used_outside_region1(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[C:%.*]], label [[THEN:%.*]], label [[EXIT:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC:%.*]], align 4
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
-; CHECK-NEXT: [[SRC_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 2
-; CHECK-NEXT: [[SRC_2:%.*]] = load i32, i32* [[SRC_GEP_2]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[SRC_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 2
+; CHECK-NEXT: [[SRC_2:%.*]] = load i32, ptr [[SRC_GEP_2]], align 4
; CHECK-NEXT: [[R_2:%.*]] = ashr i32 [[SRC_2]], 16
-; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 2
-; CHECK-NEXT: store i32 [[R_2]], i32* [[DST_GEP_2]], align 4
-; CHECK-NEXT: [[SRC_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 3
-; CHECK-NEXT: [[SRC_3:%.*]] = load i32, i32* [[SRC_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 2
+; CHECK-NEXT: store i32 [[R_2]], ptr [[DST_GEP_2]], align 4
+; CHECK-NEXT: [[SRC_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 3
+; CHECK-NEXT: [[SRC_3:%.*]] = load i32, ptr [[SRC_GEP_3]], align 4
; CHECK-NEXT: [[R_3:%.*]] = ashr i32 [[SRC_3]], 16
-; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 3
-; CHECK-NEXT: store i32 [[R_3]], i32* [[DST_GEP_3]], align 4
-; CHECK-NEXT: [[SRC_GEP_5:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 5
-; CHECK-NEXT: [[L:%.*]] = load i32, i32* [[SRC_GEP_5]], align 4
+; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 3
+; CHECK-NEXT: store i32 [[R_3]], ptr [[DST_GEP_3]], align 4
+; CHECK-NEXT: [[SRC_GEP_5:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 5
+; CHECK-NEXT: [[L:%.*]] = load i32, ptr [[SRC_GEP_5]], align 4
; CHECK-NEXT: call void @use(i32 [[L]])
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
@@ -233,26 +233,26 @@ entry:
br i1 %c, label %then, label %exit
then:
- %src.0 = load i32, i32* %src, align 4
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
- %src.gep.2 = getelementptr inbounds i32, i32* %src, i64 2
- %src.2 = load i32, i32* %src.gep.2, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
+ %src.gep.2 = getelementptr inbounds i32, ptr %src, i64 2
+ %src.2 = load i32, ptr %src.gep.2, align 4
%r.2 = ashr i32 %src.2, 16
- %dst.gep.2 = getelementptr inbounds i32, i32* %dst, i64 2
- store i32 %r.2, i32* %dst.gep.2, align 4
- %src.gep.3 = getelementptr inbounds i32, i32* %src, i64 3
- %src.3 = load i32, i32* %src.gep.3, align 4
+ %dst.gep.2 = getelementptr inbounds i32, ptr %dst, i64 2
+ store i32 %r.2, ptr %dst.gep.2, align 4
+ %src.gep.3 = getelementptr inbounds i32, ptr %src, i64 3
+ %src.3 = load i32, ptr %src.gep.3, align 4
%r.3 = ashr i32 %src.3, 16
- %dst.gep.3 = getelementptr inbounds i32, i32* %dst, i64 3
- store i32 %r.3, i32* %dst.gep.3, align 4
- %src.gep.5 = getelementptr inbounds i32, i32* %src, i64 5
- %l = load i32, i32* %src.gep.5
+ %dst.gep.3 = getelementptr inbounds i32, ptr %dst, i64 3
+ store i32 %r.3, ptr %dst.gep.3, align 4
+ %src.gep.5 = getelementptr inbounds i32, ptr %src, i64 5
+ %l = load i32, ptr %src.gep.5
call void @use(i32 %l)
br label %exit
@@ -260,31 +260,31 @@ exit:
ret void
}
-define void @needs_versioning_profitable_load_used_outside_region2(i32* %dst, i32* %src, i1 %c) {
+define void @needs_versioning_profitable_load_used_outside_region2(ptr %dst, ptr %src, i1 %c) {
; CHECK-LABEL: @needs_versioning_profitable_load_used_outside_region2(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[C:%.*]], label [[THEN:%.*]], label [[EXIT:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC:%.*]], align 4
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
-; CHECK-NEXT: [[SRC_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 2
-; CHECK-NEXT: [[SRC_2:%.*]] = load i32, i32* [[SRC_GEP_2]], align 4
-; CHECK-NEXT: [[SRC_GEP_5:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 5
-; CHECK-NEXT: [[L:%.*]] = load i32, i32* [[SRC_GEP_5]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[SRC_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 2
+; CHECK-NEXT: [[SRC_2:%.*]] = load i32, ptr [[SRC_GEP_2]], align 4
+; CHECK-NEXT: [[SRC_GEP_5:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 5
+; CHECK-NEXT: [[L:%.*]] = load i32, ptr [[SRC_GEP_5]], align 4
; CHECK-NEXT: [[R_2:%.*]] = ashr i32 [[SRC_2]], 16
-; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 2
-; CHECK-NEXT: store i32 [[R_2]], i32* [[DST_GEP_2]], align 4
-; CHECK-NEXT: [[SRC_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 3
-; CHECK-NEXT: [[SRC_3:%.*]] = load i32, i32* [[SRC_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_2:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 2
+; CHECK-NEXT: store i32 [[R_2]], ptr [[DST_GEP_2]], align 4
+; CHECK-NEXT: [[SRC_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 3
+; CHECK-NEXT: [[SRC_3:%.*]] = load i32, ptr [[SRC_GEP_3]], align 4
; CHECK-NEXT: [[R_3:%.*]] = ashr i32 [[SRC_3]], 16
-; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 3
-; CHECK-NEXT: store i32 [[R_3]], i32* [[DST_GEP_3]], align 4
+; CHECK-NEXT: [[DST_GEP_3:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 3
+; CHECK-NEXT: store i32 [[R_3]], ptr [[DST_GEP_3]], align 4
; CHECK-NEXT: call void @use(i32 [[L]])
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
@@ -294,26 +294,26 @@ entry:
br i1 %c, label %then, label %exit
then:
- %src.0 = load i32, i32* %src, align 4
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
- %src.gep.2 = getelementptr inbounds i32, i32* %src, i64 2
- %src.2 = load i32, i32* %src.gep.2, align 4
- %src.gep.5 = getelementptr inbounds i32, i32* %src, i64 5
- %l = load i32, i32* %src.gep.5
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
+ %src.gep.2 = getelementptr inbounds i32, ptr %src, i64 2
+ %src.2 = load i32, ptr %src.gep.2, align 4
+ %src.gep.5 = getelementptr inbounds i32, ptr %src, i64 5
+ %l = load i32, ptr %src.gep.5
%r.2 = ashr i32 %src.2, 16
- %dst.gep.2 = getelementptr inbounds i32, i32* %dst, i64 2
- store i32 %r.2, i32* %dst.gep.2, align 4
- %src.gep.3 = getelementptr inbounds i32, i32* %src, i64 3
- %src.3 = load i32, i32* %src.gep.3, align 4
+ %dst.gep.2 = getelementptr inbounds i32, ptr %dst, i64 2
+ store i32 %r.2, ptr %dst.gep.2, align 4
+ %src.gep.3 = getelementptr inbounds i32, ptr %src, i64 3
+ %src.3 = load i32, ptr %src.gep.3, align 4
%r.3 = ashr i32 %src.3, 16
- %dst.gep.3 = getelementptr inbounds i32, i32* %dst, i64 3
- store i32 %r.3, i32* %dst.gep.3, align 4
+ %dst.gep.3 = getelementptr inbounds i32, ptr %dst, i64 3
+ store i32 %r.3, ptr %dst.gep.3, align 4
call void @use(i32 %l)
br label %exit
@@ -321,150 +321,148 @@ exit:
ret void
}
-define void @no_version(i32* nocapture %dst, i32* nocapture readonly %src) {
+define void @no_version(ptr nocapture %dst, ptr nocapture readonly %src) {
; CHECK-LABEL: @no_version(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[SRC:%.*]] to <2 x i32>*
-; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i32>, <2 x i32>* [[TMP0]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = ashr <2 x i32> [[TMP1]], <i32 16, i32 16>
-; CHECK-NEXT: [[TMP3:%.*]] = bitcast i32* [[DST:%.*]] to <2 x i32>*
-; CHECK-NEXT: store <2 x i32> [[TMP2]], <2 x i32>* [[TMP3]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[SRC:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = ashr <2 x i32> [[TMP0]], <i32 16, i32 16>
+; CHECK-NEXT: store <2 x i32> [[TMP1]], ptr [[DST:%.*]], align 4
; CHECK-NEXT: ret void
;
entry:
- %src.0 = load i32, i32* %src, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ %src.0 = load i32, ptr %src, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.0 = ashr i32 %src.0, 16
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.0, i32* %dst, align 4
- store i32 %r.1, i32* %dst.gep.1, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.0, ptr %dst, align 4
+ store i32 %r.1, ptr %dst.gep.1, align 4
ret void
}
-define void @version_multiple(i32* nocapture %out_block, i32* nocapture readonly %counter) {
+define void @version_multiple(ptr nocapture %out_block, ptr nocapture readonly %counter) {
; CHECK-LABEL: @version_multiple(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[COUNTER:%.*]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[OUT_BLOCK:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[COUNTER:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[OUT_BLOCK:%.*]], align 4
; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[TMP1]], [[TMP0]]
-; CHECK-NEXT: store i32 [[XOR]], i32* [[OUT_BLOCK]], align 4
-; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds i32, i32* [[COUNTER]], i64 1
-; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX_1]], align 4
-; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds i32, i32* [[OUT_BLOCK]], i64 1
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX2_1]], align 4
+; CHECK-NEXT: store i32 [[XOR]], ptr [[OUT_BLOCK]], align 4
+; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds i32, ptr [[COUNTER]], i64 1
+; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX_1]], align 4
+; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds i32, ptr [[OUT_BLOCK]], i64 1
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARRAYIDX2_1]], align 4
; CHECK-NEXT: [[XOR_1:%.*]] = xor i32 [[TMP3]], [[TMP2]]
-; CHECK-NEXT: store i32 [[XOR_1]], i32* [[ARRAYIDX2_1]], align 4
-; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds i32, i32* [[COUNTER]], i64 2
-; CHECK-NEXT: [[TMP4:%.*]] = load i32, i32* [[ARRAYIDX_2]], align 4
-; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds i32, i32* [[OUT_BLOCK]], i64 2
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[ARRAYIDX2_2]], align 4
+; CHECK-NEXT: store i32 [[XOR_1]], ptr [[ARRAYIDX2_1]], align 4
+; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds i32, ptr [[COUNTER]], i64 2
+; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[ARRAYIDX_2]], align 4
+; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds i32, ptr [[OUT_BLOCK]], i64 2
+; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[ARRAYIDX2_2]], align 4
; CHECK-NEXT: [[XOR_2:%.*]] = xor i32 [[TMP5]], [[TMP4]]
-; CHECK-NEXT: store i32 [[XOR_2]], i32* [[ARRAYIDX2_2]], align 4
-; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds i32, i32* [[COUNTER]], i64 3
-; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* [[ARRAYIDX_3]], align 4
-; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds i32, i32* [[OUT_BLOCK]], i64 3
-; CHECK-NEXT: [[TMP7:%.*]] = load i32, i32* [[ARRAYIDX2_3]], align 4
+; CHECK-NEXT: store i32 [[XOR_2]], ptr [[ARRAYIDX2_2]], align 4
+; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds i32, ptr [[COUNTER]], i64 3
+; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[ARRAYIDX_3]], align 4
+; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds i32, ptr [[OUT_BLOCK]], i64 3
+; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[ARRAYIDX2_3]], align 4
; CHECK-NEXT: [[XOR_3:%.*]] = xor i32 [[TMP7]], [[TMP6]]
-; CHECK-NEXT: store i32 [[XOR_3]], i32* [[ARRAYIDX2_3]], align 4
+; CHECK-NEXT: store i32 [[XOR_3]], ptr [[ARRAYIDX2_3]], align 4
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %counter, align 4
- %1 = load i32, i32* %out_block, align 4
+ %0 = load i32, ptr %counter, align 4
+ %1 = load i32, ptr %out_block, align 4
%xor = xor i32 %1, %0
- store i32 %xor, i32* %out_block, align 4
- %arrayidx.1 = getelementptr inbounds i32, i32* %counter, i64 1
- %2 = load i32, i32* %arrayidx.1, align 4
- %arrayidx2.1 = getelementptr inbounds i32, i32* %out_block, i64 1
- %3 = load i32, i32* %arrayidx2.1, align 4
+ store i32 %xor, ptr %out_block, align 4
+ %arrayidx.1 = getelementptr inbounds i32, ptr %counter, i64 1
+ %2 = load i32, ptr %arrayidx.1, align 4
+ %arrayidx2.1 = getelementptr inbounds i32, ptr %out_block, i64 1
+ %3 = load i32, ptr %arrayidx2.1, align 4
%xor.1 = xor i32 %3, %2
- store i32 %xor.1, i32* %arrayidx2.1, align 4
- %arrayidx.2 = getelementptr inbounds i32, i32* %counter, i64 2
- %4 = load i32, i32* %arrayidx.2, align 4
- %arrayidx2.2 = getelementptr inbounds i32, i32* %out_block, i64 2
- %5 = load i32, i32* %arrayidx2.2, align 4
+ store i32 %xor.1, ptr %arrayidx2.1, align 4
+ %arrayidx.2 = getelementptr inbounds i32, ptr %counter, i64 2
+ %4 = load i32, ptr %arrayidx.2, align 4
+ %arrayidx2.2 = getelementptr inbounds i32, ptr %out_block, i64 2
+ %5 = load i32, ptr %arrayidx2.2, align 4
%xor.2 = xor i32 %5, %4
- store i32 %xor.2, i32* %arrayidx2.2, align 4
- %arrayidx.3 = getelementptr inbounds i32, i32* %counter, i64 3
- %6 = load i32, i32* %arrayidx.3, align 4
- %arrayidx2.3 = getelementptr inbounds i32, i32* %out_block, i64 3
- %7 = load i32, i32* %arrayidx2.3, align 4
+ store i32 %xor.2, ptr %arrayidx2.2, align 4
+ %arrayidx.3 = getelementptr inbounds i32, ptr %counter, i64 3
+ %6 = load i32, ptr %arrayidx.3, align 4
+ %arrayidx2.3 = getelementptr inbounds i32, ptr %out_block, i64 3
+ %7 = load i32, ptr %arrayidx2.3, align 4
%xor.3 = xor i32 %7, %6
- store i32 %xor.3, i32* %arrayidx2.3, align 4
+ store i32 %xor.3, ptr %arrayidx2.3, align 4
ret void
}
-define i32 @use_outside_version_bb(i32* %dst, i32* %src, i1 %c.1) {
+define i32 @use_outside_version_bb(ptr %dst, ptr %src, i1 %c.1) {
; CHECK-LABEL: @use_outside_version_bb(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC:%.*]], align 4
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
; CHECK-NEXT: br label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: ret i32 [[R_0]]
;
entry:
- %src.0 = load i32, i32* %src, align 4
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
br label %exit
exit:
ret i32 %r.0
}
-define i32 @value_used_in_return(i32* %dst, i32* %src, i32 %x) {
+define i32 @value_used_in_return(ptr %dst, ptr %src, i32 %x) {
; CHECK-LABEL: @value_used_in_return(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC:%.*]], align 4
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
; CHECK-NEXT: [[ADD:%.*]] = add i32 [[X:%.*]], 20
; CHECK-NEXT: ret i32 [[ADD]]
;
entry:
- %src.0 = load i32, i32* %src, align 4
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
%add = add i32 %x, 20
ret i32 %add
}
-define i32 @needs_versioning2_cond_br(i32* %dst, i32* %src, i1 %c.1) {
+define i32 @needs_versioning2_cond_br(ptr %dst, ptr %src, i1 %c.1) {
; CHECK-LABEL: @needs_versioning2_cond_br(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[C_1:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC:%.*]], align 4
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC:%.*]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
; CHECK-NEXT: ret i32 10
; CHECK: else:
; CHECK-NEXT: ret i32 0
@@ -473,14 +471,14 @@ entry:
br i1 %c.1, label %then, label %else
then:
- %src.0 = load i32, i32* %src, align 4
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
ret i32 10
@@ -488,111 +486,107 @@ else:
ret i32 0
}
-define void @pointer_defined_in_bb(i32* %dst, i32** %src.p) {
+define void @pointer_defined_in_bb(ptr %dst, ptr %src.p) {
; CHECK-LABEL: @pointer_defined_in_bb(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SRC:%.*]] = load i32*, i32** [[SRC_P:%.*]], align 8
-; CHECK-NEXT: [[SRC_0:%.*]] = load i32, i32* [[SRC]], align 4
+; CHECK-NEXT: [[SRC:%.*]] = load ptr, ptr [[SRC_P:%.*]], align 8
+; CHECK-NEXT: [[SRC_0:%.*]] = load i32, ptr [[SRC]], align 4
; CHECK-NEXT: [[R_0:%.*]] = ashr i32 [[SRC_0]], 16
-; CHECK-NEXT: store i32 [[R_0]], i32* [[DST:%.*]], align 4
-; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[SRC]], i64 1
-; CHECK-NEXT: [[SRC_1:%.*]] = load i32, i32* [[SRC_GEP_1]], align 4
+; CHECK-NEXT: store i32 [[R_0]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[SRC_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
+; CHECK-NEXT: [[SRC_1:%.*]] = load i32, ptr [[SRC_GEP_1]], align 4
; CHECK-NEXT: [[R_1:%.*]] = ashr i32 [[SRC_1]], 16
-; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 1
-; CHECK-NEXT: store i32 [[R_1]], i32* [[DST_GEP_1]], align 4
+; CHECK-NEXT: [[DST_GEP_1:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 1
+; CHECK-NEXT: store i32 [[R_1]], ptr [[DST_GEP_1]], align 4
; CHECK-NEXT: ret void
;
entry:
- %src = load i32*, i32** %src.p
- %src.0 = load i32, i32* %src, align 4
+ %src = load ptr, ptr %src.p
+ %src.0 = load i32, ptr %src, align 4
%r.0 = ashr i32 %src.0, 16
- store i32 %r.0, i32* %dst, align 4
- %src.gep.1 = getelementptr inbounds i32, i32* %src, i64 1
- %src.1 = load i32, i32* %src.gep.1, align 4
+ store i32 %r.0, ptr %dst, align 4
+ %src.gep.1 = getelementptr inbounds i32, ptr %src, i64 1
+ %src.1 = load i32, ptr %src.gep.1, align 4
%r.1 = ashr i32 %src.1, 16
- %dst.gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %r.1, i32* %dst.gep.1, align 4
+ %dst.gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %r.1, ptr %dst.gep.1, align 4
ret void
}
-define void @clobber_same_underlying_object(i32* %this) {
+define void @clobber_same_underlying_object(ptr %this) {
; CHECK-LABEL: @clobber_same_underlying_object(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[P_3:%.*]] = getelementptr inbounds i32, i32* [[THIS:%.*]], i32 3
-; CHECK-NEXT: store i32 10, i32* [[P_3]], align 8
+; CHECK-NEXT: [[P_3:%.*]] = getelementptr inbounds i32, ptr [[THIS:%.*]], i32 3
+; CHECK-NEXT: store i32 10, ptr [[P_3]], align 8
; CHECK-NEXT: tail call void @clobber()
-; CHECK-NEXT: [[P_4:%.*]] = getelementptr inbounds i32, i32* [[THIS]], i32 4
-; CHECK-NEXT: [[L2:%.*]] = load i32, i32* [[P_4]], align 8
-; CHECK-NEXT: store i32 20, i32* [[P_4]], align 8
+; CHECK-NEXT: [[P_4:%.*]] = getelementptr inbounds i32, ptr [[THIS]], i32 4
+; CHECK-NEXT: [[L2:%.*]] = load i32, ptr [[P_4]], align 8
+; CHECK-NEXT: store i32 20, ptr [[P_4]], align 8
; CHECK-NEXT: ret void
;
entry:
- %p.3 = getelementptr inbounds i32, i32* %this, i32 3
- store i32 10, i32* %p.3, align 8
+ %p.3 = getelementptr inbounds i32, ptr %this, i32 3
+ store i32 10, ptr %p.3, align 8
tail call void @clobber()
- %p.4 = getelementptr inbounds i32, i32* %this, i32 4
- %l2 = load i32, i32* %p.4, align 8
- store i32 20, i32* %p.4, align 8
+ %p.4 = getelementptr inbounds i32, ptr %this, i32 4
+ %l2 = load i32, ptr %p.4, align 8
+ store i32 20, ptr %p.4, align 8
ret void
}
declare void @clobber()
-define void @slp_not_beneficial(i32* %A, i32* %B) {
+define void @slp_not_beneficial(ptr %A, ptr %B) {
; CHECK-LABEL: @slp_not_beneficial(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i32 4
-; CHECK-NEXT: store i32 0, i32* [[TMP]], align 8
-; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, i32* [[A]], i32 5
-; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds i32, i32* [[B:%.*]], i32 4
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 8
-; CHECK-NEXT: store i32 [[TMP5]], i32* [[TMP3]], align 8
+; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i32 4
+; CHECK-NEXT: store i32 0, ptr [[TMP]], align 8
+; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, ptr [[A]], i32 5
+; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds i32, ptr [[B:%.*]], i32 4
+; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 8
+; CHECK-NEXT: store i32 [[TMP5]], ptr [[TMP3]], align 8
; CHECK-NEXT: ret void
;
bb:
- %tmp = getelementptr inbounds i32, i32* %A, i32 4
- store i32 0, i32* %tmp, align 8
- %tmp3 = getelementptr inbounds i32, i32* %A, i32 5
- %tmp4 = getelementptr inbounds i32, i32* %B, i32 4
- %tmp5 = load i32, i32* %tmp4, align 8
- store i32 %tmp5, i32* %tmp3, align 8
+ %tmp = getelementptr inbounds i32, ptr %A, i32 4
+ store i32 0, ptr %tmp, align 8
+ %tmp3 = getelementptr inbounds i32, ptr %A, i32 5
+ %tmp4 = getelementptr inbounds i32, ptr %B, i32 4
+ %tmp5 = load i32, ptr %tmp4, align 8
+ store i32 %tmp5, ptr %tmp3, align 8
ret void
}
-define void @widget(double* %ptr, double* %ptr.2) {
+define void @widget(ptr %ptr, ptr %ptr.2) {
; CHECK-LABEL: @widget(
; CHECK-NEXT: bb1:
-; CHECK-NEXT: [[TMP3:%.*]] = load double, double* null, align 8
+; CHECK-NEXT: [[TMP3:%.*]] = load double, ptr null, align 8
; CHECK-NEXT: [[TMP4:%.*]] = fmul double undef, [[TMP3]]
-; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds double, double* [[PTR:%.*]], i32 0
-; CHECK-NEXT: [[TMP6:%.*]] = load double, double* [[TMP5]], align 8
+; CHECK-NEXT: [[TMP6:%.*]] = load double, ptr [[PTR:%.*]], align 8
; CHECK-NEXT: [[TMP7:%.*]] = fadd double [[TMP6]], [[TMP4]]
-; CHECK-NEXT: store double [[TMP7]], double* [[TMP5]], align 8
-; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds double, double* [[PTR_2:%.*]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = load double, double* [[TMP8]], align 8
+; CHECK-NEXT: store double [[TMP7]], ptr [[PTR]], align 8
+; CHECK-NEXT: [[TMP9:%.*]] = load double, ptr [[PTR_2:%.*]], align 8
; CHECK-NEXT: [[TMP10:%.*]] = fmul double undef, [[TMP9]]
-; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds double, double* [[PTR]], i32 1
-; CHECK-NEXT: [[TMP12:%.*]] = load double, double* [[TMP11]], align 8
+; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds double, ptr [[PTR]], i32 1
+; CHECK-NEXT: [[TMP12:%.*]] = load double, ptr [[TMP11]], align 8
; CHECK-NEXT: [[TMP13:%.*]] = fadd double [[TMP12]], [[TMP10]]
-; CHECK-NEXT: store double [[TMP13]], double* [[TMP11]], align 8
+; CHECK-NEXT: store double [[TMP13]], ptr [[TMP11]], align 8
; CHECK-NEXT: br label [[BB15:%.*]]
; CHECK: bb15:
; CHECK-NEXT: br label [[BB15]]
;
bb1: ; preds = %bb
- %tmp3 = load double, double* null, align 8
+ %tmp3 = load double, ptr null, align 8
%tmp4 = fmul double undef, %tmp3
- %tmp5 = getelementptr inbounds double, double* %ptr, i32 0
- %tmp6 = load double, double* %tmp5, align 8
+ %tmp6 = load double, ptr %ptr, align 8
%tmp7 = fadd double %tmp6, %tmp4
- store double %tmp7, double* %tmp5, align 8
- %tmp8 = getelementptr inbounds double, double* %ptr.2, i64 0
- %tmp9 = load double, double* %tmp8, align 8
+ store double %tmp7, ptr %ptr, align 8
+ %tmp9 = load double, ptr %ptr.2, align 8
%tmp10 = fmul double undef, %tmp9
- %tmp11 = getelementptr inbounds double, double* %ptr, i32 1
- %tmp12 = load double, double* %tmp11, align 8
+ %tmp11 = getelementptr inbounds double, ptr %ptr, i32 1
+ %tmp12 = load double, ptr %tmp11, align 8
%tmp13 = fadd double %tmp12, %tmp10
- store double %tmp13, double* %tmp11, align 8
+ store double %tmp13, ptr %tmp11, align 8
br label %bb15
bb15: ; preds = %bb15, %bb14
@@ -603,25 +597,22 @@ bb15: ; preds = %bb15, %bb14
; Some points we collected as candidates for runtime checks have been removed
; before generating runtime checks. Make sure versioning is skipped.
-define void @test_bounds_removed_before_runtime_checks(%struct * %A, i32** %B, i1 %c) {
+define void @test_bounds_removed_before_runtime_checks(ptr %A, ptr %B, i1 %c) {
; CHECK-LABEL: @test_bounds_removed_before_runtime_checks(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT:%.*]], %struct* [[A:%.*]], i64 0, i32 0
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[TMP11]] to <2 x i32>*
-; CHECK-NEXT: store <2 x i32> <i32 10, i32 300>, <2 x i32>* [[TMP0]], align 8
-; CHECK-NEXT: [[TMP13:%.*]] = load i32*, i32** [[B:%.*]], align 8
+; CHECK-NEXT: store <2 x i32> <i32 10, i32 300>, ptr [[A:%.*]], align 8
+; CHECK-NEXT: [[TMP13:%.*]] = load ptr, ptr [[B:%.*]], align 8
; CHECK-NEXT: br i1 [[C:%.*]], label [[BB23:%.*]], label [[BB14:%.*]]
; CHECK: bb14:
; CHECK-NEXT: [[TMP15:%.*]] = sext i32 10 to i64
; CHECK-NEXT: [[TMP16:%.*]] = add nsw i64 2, [[TMP15]]
-; CHECK-NEXT: [[TMP17:%.*]] = getelementptr inbounds i32, i32* [[TMP13]], i64 [[TMP16]]
-; CHECK-NEXT: [[TMP18:%.*]] = bitcast i32* [[TMP17]] to i8*
-; CHECK-NEXT: [[TMP19:%.*]] = getelementptr inbounds i8, i8* [[TMP18]], i64 3
-; CHECK-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT]], %struct* [[A]], i64 0, i32 2
-; CHECK-NEXT: store float 0.000000e+00, float* [[TMP20]], align 8
-; CHECK-NEXT: [[TMP21:%.*]] = load i8, i8* [[TMP19]], align 1
-; CHECK-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT]], %struct* [[A]], i64 0, i32 3
-; CHECK-NEXT: store float 0.000000e+00, float* [[TMP22]], align 4
+; CHECK-NEXT: [[TMP17:%.*]] = getelementptr inbounds i32, ptr [[TMP13]], i64 [[TMP16]]
+; CHECK-NEXT: [[TMP19:%.*]] = getelementptr inbounds i8, ptr [[TMP17]], i64 3
+; CHECK-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT:%.*]], ptr [[A]], i64 0, i32 2
+; CHECK-NEXT: store float 0.000000e+00, ptr [[TMP20]], align 8
+; CHECK-NEXT: [[TMP21:%.*]] = load i8, ptr [[TMP19]], align 1
+; CHECK-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT]], ptr [[A]], i64 0, i32 3
+; CHECK-NEXT: store float 0.000000e+00, ptr [[TMP22]], align 4
; CHECK-NEXT: br label [[BB23]]
; CHECK: bb23:
; CHECK-NEXT: ret void
@@ -637,24 +628,22 @@ entry:
%tmp8 = icmp sgt i32 200, %tmp4
%tmp9 = select i1 %tmp8, i32 %tmp4, i32 300
%tmp10 = select i1 false, i32 0, i32 %tmp9
- %tmp11 = getelementptr inbounds %struct, %struct* %A, i64 0, i32 0
- store i32 %tmp7, i32* %tmp11, align 8
- %tmp12 = getelementptr inbounds %struct, %struct* %A, i64 0, i32 1
- store i32 %tmp10, i32* %tmp12, align 4
- %tmp13 = load i32*, i32** %B, align 8
+ store i32 %tmp7, ptr %A, align 8
+ %tmp12 = getelementptr inbounds %struct, ptr %A, i64 0, i32 1
+ store i32 %tmp10, ptr %tmp12, align 4
+ %tmp13 = load ptr, ptr %B, align 8
br i1 %c, label %bb23, label %bb14
bb14:
%tmp15 = sext i32 %tmp7 to i64
%tmp16 = add nsw i64 2, %tmp15
- %tmp17 = getelementptr inbounds i32, i32* %tmp13, i64 %tmp16
- %tmp18 = bitcast i32* %tmp17 to i8*
- %tmp19 = getelementptr inbounds i8, i8* %tmp18, i64 3
- %tmp20 = getelementptr inbounds %struct, %struct* %A, i64 0, i32 2
- store float 0.0, float* %tmp20, align 8
- %tmp21 = load i8, i8* %tmp19, align 1
- %tmp22 = getelementptr inbounds %struct, %struct* %A, i64 0, i32 3
- store float 0.0, float* %tmp22, align 4
+ %tmp17 = getelementptr inbounds i32, ptr %tmp13, i64 %tmp16
+ %tmp19 = getelementptr inbounds i8, ptr %tmp17, i64 3
+ %tmp20 = getelementptr inbounds %struct, ptr %A, i64 0, i32 2
+ store float 0.0, ptr %tmp20, align 8
+ %tmp21 = load i8, ptr %tmp19, align 1
+ %tmp22 = getelementptr inbounds %struct, ptr %A, i64 0, i32 3
+ store float 0.0, ptr %tmp22, align 4
br label %bb23
bb23:
@@ -662,561 +651,533 @@ bb23:
}
; In this test there's a single bound, do not generate runtime checks.
-define void @single_membound(double* %arg, double* %arg1, double %x) {
+define void @single_membound(ptr %arg, ptr %arg1, double %x) {
; CHECK-LABEL: @single_membound(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP:%.*]] = fsub double [[X:%.*]], 9.900000e+01
-; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds double, double* [[ARG:%.*]], i64 1
-; CHECK-NEXT: store double [[TMP]], double* [[TMP9]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds double, double* [[ARG1:%.*]], i64 0
-; CHECK-NEXT: [[TMP12:%.*]] = load double, double* [[TMP10]], align 8
+; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds double, ptr [[ARG:%.*]], i64 1
+; CHECK-NEXT: store double [[TMP]], ptr [[TMP9]], align 8
+; CHECK-NEXT: [[TMP12:%.*]] = load double, ptr [[ARG1:%.*]], align 8
; CHECK-NEXT: [[TMP13:%.*]] = fsub double 1.000000e+00, [[TMP12]]
-; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds double, double* [[ARG]], i64 2
+; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds double, ptr [[ARG]], i64 2
; CHECK-NEXT: br label [[BB15:%.*]]
; CHECK: bb15:
; CHECK-NEXT: [[TMP16:%.*]] = fmul double [[TMP]], 2.000000e+01
-; CHECK-NEXT: store double [[TMP16]], double* [[TMP9]], align 8
+; CHECK-NEXT: store double [[TMP16]], ptr [[TMP9]], align 8
; CHECK-NEXT: [[TMP17:%.*]] = fmul double [[TMP13]], 3.000000e+01
-; CHECK-NEXT: store double [[TMP17]], double* [[TMP14]], align 8
+; CHECK-NEXT: store double [[TMP17]], ptr [[TMP14]], align 8
; CHECK-NEXT: ret void
;
entry:
%tmp = fsub double %x, 99.0
- %tmp9 = getelementptr inbounds double, double* %arg, i64 1
- store double %tmp, double* %tmp9, align 8
- %tmp10 = getelementptr inbounds double, double* %arg1, i64 0
- %tmp12 = load double, double* %tmp10, align 8
+ %tmp9 = getelementptr inbounds double, ptr %arg, i64 1
+ store double %tmp, ptr %tmp9, align 8
+ %tmp12 = load double, ptr %arg1, align 8
%tmp13 = fsub double 1.0, %tmp12
- %tmp14 = getelementptr inbounds double, double* %arg, i64 2
+ %tmp14 = getelementptr inbounds double, ptr %arg, i64 2
br label %bb15
bb15:
%tmp16 = fmul double %tmp, 20.0
- store double %tmp16, double* %tmp9, align 8
+ store double %tmp16, ptr %tmp9, align 8
%tmp17 = fmul double %tmp13, 30.0
- store double %tmp17, double* %tmp14, align 8
+ store double %tmp17, ptr %tmp14, align 8
ret void
}
%struct.2 = type { [4 x float] }
; Make sure we do not crash when we encounter a SCEVCouldNotCompute.
-define void @no_lcssa_phi(%struct.2* %A, float* %B, i1 %c) {
+define void @no_lcssa_phi(ptr %A, ptr %B, i1 %c) {
; CHECK-LABEL: @no_lcssa_phi(
; CHECK-NEXT: bb:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: [[PTR_PHI:%.*]] = phi %struct.2* [ [[A:%.*]], [[BB:%.*]] ], [ null, [[LOOP]] ]
+; CHECK-NEXT: [[PTR_PHI:%.*]] = phi ptr [ [[A:%.*]], [[BB:%.*]] ], [ null, [[LOOP]] ]
; CHECK-NEXT: br i1 [[C:%.*]], label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
-; CHECK-NEXT: [[B_GEP_0:%.*]] = getelementptr inbounds float, float* [[B:%.*]], i64 0
-; CHECK-NEXT: [[L_0:%.*]] = load float, float* [[B_GEP_0]], align 8
+; CHECK-NEXT: [[L_0:%.*]] = load float, ptr [[B:%.*]], align 8
; CHECK-NEXT: [[ADD_0:%.*]] = fadd float [[L_0]], 1.000000e+01
; CHECK-NEXT: [[MUL_0:%.*]] = fmul float [[ADD_0]], 3.000000e+01
-; CHECK-NEXT: [[A_GEP_0:%.*]] = getelementptr inbounds [[STRUCT_2:%.*]], %struct.2* [[PTR_PHI]], i64 0, i32 0, i32 0
-; CHECK-NEXT: store float [[MUL_0]], float* [[A_GEP_0]], align 8
-; CHECK-NEXT: [[B_GEP_1:%.*]] = getelementptr inbounds float, float* [[B]], i64 1
-; CHECK-NEXT: [[L_1:%.*]] = load float, float* [[B_GEP_1]], align 8
+; CHECK-NEXT: store float [[MUL_0]], ptr [[PTR_PHI]], align 8
+; CHECK-NEXT: [[B_GEP_1:%.*]] = getelementptr inbounds float, ptr [[B]], i64 1
+; CHECK-NEXT: [[L_1:%.*]] = load float, ptr [[B_GEP_1]], align 8
; CHECK-NEXT: [[ADD_1:%.*]] = fadd float [[L_1]], 1.000000e+01
; CHECK-NEXT: [[MUL_1:%.*]] = fmul float [[ADD_1]], 3.000000e+01
-; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr inbounds [[STRUCT_2]], %struct.2* [[PTR_PHI]], i64 0, i32 0, i32 1
-; CHECK-NEXT: store float [[MUL_1]], float* [[A_GEP_1]], align 8
-; CHECK-NEXT: [[B_GEP_2:%.*]] = getelementptr inbounds float, float* [[B]], i64 2
-; CHECK-NEXT: [[L_2:%.*]] = load float, float* [[B_GEP_2]], align 8
+; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr inbounds [[STRUCT_2:%.*]], ptr [[PTR_PHI]], i64 0, i32 0, i32 1
+; CHECK-NEXT: store float [[MUL_1]], ptr [[A_GEP_1]], align 8
+; CHECK-NEXT: [[B_GEP_2:%.*]] = getelementptr inbounds float, ptr [[B]], i64 2
+; CHECK-NEXT: [[L_2:%.*]] = load float, ptr [[B_GEP_2]], align 8
; CHECK-NEXT: [[ADD_2:%.*]] = fadd float [[L_2]], 1.000000e+01
; CHECK-NEXT: [[MUL_2:%.*]] = fmul float [[ADD_2]], 3.000000e+01
-; CHECK-NEXT: [[A_GEP_2:%.*]] = getelementptr inbounds [[STRUCT_2]], %struct.2* [[PTR_PHI]], i64 0, i32 0, i32 2
-; CHECK-NEXT: store float [[MUL_2]], float* [[A_GEP_2]], align 8
-; CHECK-NEXT: [[B_GEP_3:%.*]] = getelementptr inbounds float, float* [[B]], i64 3
-; CHECK-NEXT: [[L_3:%.*]] = load float, float* [[B_GEP_3]], align 8
+; CHECK-NEXT: [[A_GEP_2:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[PTR_PHI]], i64 0, i32 0, i32 2
+; CHECK-NEXT: store float [[MUL_2]], ptr [[A_GEP_2]], align 8
+; CHECK-NEXT: [[B_GEP_3:%.*]] = getelementptr inbounds float, ptr [[B]], i64 3
+; CHECK-NEXT: [[L_3:%.*]] = load float, ptr [[B_GEP_3]], align 8
; CHECK-NEXT: [[ADD_3:%.*]] = fadd float [[L_3]], 1.000000e+01
; CHECK-NEXT: [[MUL_3:%.*]] = fmul float [[ADD_3]], 3.000000e+01
-; CHECK-NEXT: [[A_GEP_3:%.*]] = getelementptr inbounds [[STRUCT_2]], %struct.2* [[PTR_PHI]], i64 0, i32 0, i32 3
-; CHECK-NEXT: store float [[MUL_3]], float* [[A_GEP_3]], align 8
+; CHECK-NEXT: [[A_GEP_3:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[PTR_PHI]], i64 0, i32 0, i32 3
+; CHECK-NEXT: store float [[MUL_3]], ptr [[A_GEP_3]], align 8
; CHECK-NEXT: ret void
;
bb:
br label %loop
loop:
- %ptr.phi = phi %struct.2* [ %A, %bb ], [ null, %loop ]
+ %ptr.phi = phi ptr [ %A, %bb ], [ null, %loop ]
br i1 %c, label %exit, label %loop
exit:
- %B.gep.0 = getelementptr inbounds float, float* %B, i64 0
- %l.0 = load float, float* %B.gep.0, align 8
+ %l.0 = load float, ptr %B, align 8
%add.0 = fadd float %l.0, 10.0
%mul.0 = fmul float %add.0, 30.0
- %A.gep.0 = getelementptr inbounds %struct.2, %struct.2* %ptr.phi, i64 0, i32 0, i32 0
- store float %mul.0, float* %A.gep.0, align 8
- %B.gep.1 = getelementptr inbounds float, float* %B, i64 1
- %l.1 = load float, float* %B.gep.1, align 8
+ store float %mul.0, ptr %ptr.phi, align 8
+ %B.gep.1 = getelementptr inbounds float, ptr %B, i64 1
+ %l.1 = load float, ptr %B.gep.1, align 8
%add.1 = fadd float %l.1, 10.0
%mul.1 = fmul float %add.1, 30.0
- %A.gep.1 = getelementptr inbounds %struct.2, %struct.2* %ptr.phi, i64 0, i32 0, i32 1
- store float %mul.1, float* %A.gep.1, align 8
- %B.gep.2 = getelementptr inbounds float, float* %B, i64 2
- %l.2 = load float, float* %B.gep.2, align 8
+ %A.gep.1 = getelementptr inbounds %struct.2, ptr %ptr.phi, i64 0, i32 0, i32 1
+ store float %mul.1, ptr %A.gep.1, align 8
+ %B.gep.2 = getelementptr inbounds float, ptr %B, i64 2
+ %l.2 = load float, ptr %B.gep.2, align 8
%add.2 = fadd float %l.2, 10.0
%mul.2 = fmul float %add.2, 30.0
- %A.gep.2 = getelementptr inbounds %struct.2, %struct.2* %ptr.phi, i64 0, i32 0, i32 2
- store float %mul.2, float* %A.gep.2, align 8
- %B.gep.3 = getelementptr inbounds float, float* %B, i64 3
- %l.3 = load float, float* %B.gep.3, align 8
+ %A.gep.2 = getelementptr inbounds %struct.2, ptr %ptr.phi, i64 0, i32 0, i32 2
+ store float %mul.2, ptr %A.gep.2, align 8
+ %B.gep.3 = getelementptr inbounds float, ptr %B, i64 3
+ %l.3 = load float, ptr %B.gep.3, align 8
%add.3 = fadd float %l.3, 10.0
%mul.3 = fmul float %add.3, 30.0
- %A.gep.3 = getelementptr inbounds %struct.2, %struct.2* %ptr.phi, i64 0, i32 0, i32 3
- store float %mul.3, float* %A.gep.3, align 8
+ %A.gep.3 = getelementptr inbounds %struct.2, ptr %ptr.phi, i64 0, i32 0, i32 3
+ store float %mul.3, ptr %A.gep.3, align 8
ret void
}
; Make sure lcssa phis as pointer bases are handled properly.
-define void @lcssa_phi(%struct.2* %A, float* %B, i1 %c) {
+define void @lcssa_phi(ptr %A, ptr %B, i1 %c) {
; CHECK-LABEL: @lcssa_phi(
; CHECK-NEXT: bb:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: [[PTR_PHI:%.*]] = phi %struct.2* [ [[A:%.*]], [[BB:%.*]] ], [ null, [[LOOP]] ]
+; CHECK-NEXT: [[PTR_PHI:%.*]] = phi ptr [ [[A:%.*]], [[BB:%.*]] ], [ null, [[LOOP]] ]
; CHECK-NEXT: br i1 [[C:%.*]], label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
-; CHECK-NEXT: [[PTR_PHI_LCSSA:%.*]] = phi %struct.2* [ [[PTR_PHI]], [[LOOP]] ]
-; CHECK-NEXT: [[B_GEP_0:%.*]] = getelementptr inbounds float, float* [[B:%.*]], i64 0
-; CHECK-NEXT: [[L_0:%.*]] = load float, float* [[B_GEP_0]], align 8
+; CHECK-NEXT: [[PTR_PHI_LCSSA:%.*]] = phi ptr [ [[PTR_PHI]], [[LOOP]] ]
+; CHECK-NEXT: [[L_0:%.*]] = load float, ptr [[B:%.*]], align 8
; CHECK-NEXT: [[ADD_0:%.*]] = fadd float [[L_0]], 1.000000e+01
; CHECK-NEXT: [[MUL_0:%.*]] = fmul float [[ADD_0]], 3.000000e+01
-; CHECK-NEXT: [[A_GEP_0:%.*]] = getelementptr inbounds [[STRUCT_2:%.*]], %struct.2* [[PTR_PHI_LCSSA]], i64 0, i32 0, i32 0
-; CHECK-NEXT: store float [[MUL_0]], float* [[A_GEP_0]], align 8
-; CHECK-NEXT: [[B_GEP_1:%.*]] = getelementptr inbounds float, float* [[B]], i64 1
-; CHECK-NEXT: [[L_1:%.*]] = load float, float* [[B_GEP_1]], align 8
+; CHECK-NEXT: store float [[MUL_0]], ptr [[PTR_PHI_LCSSA]], align 8
+; CHECK-NEXT: [[B_GEP_1:%.*]] = getelementptr inbounds float, ptr [[B]], i64 1
+; CHECK-NEXT: [[L_1:%.*]] = load float, ptr [[B_GEP_1]], align 8
; CHECK-NEXT: [[ADD_1:%.*]] = fadd float [[L_1]], 1.000000e+01
; CHECK-NEXT: [[MUL_1:%.*]] = fmul float [[ADD_1]], 3.000000e+01
-; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr inbounds [[STRUCT_2]], %struct.2* [[PTR_PHI_LCSSA]], i64 0, i32 0, i32 1
-; CHECK-NEXT: store float [[MUL_1]], float* [[A_GEP_1]], align 8
-; CHECK-NEXT: [[B_GEP_2:%.*]] = getelementptr inbounds float, float* [[B]], i64 2
-; CHECK-NEXT: [[L_2:%.*]] = load float, float* [[B_GEP_2]], align 8
+; CHECK-NEXT: [[A_GEP_1:%.*]] = getelementptr inbounds [[STRUCT_2:%.*]], ptr [[PTR_PHI_LCSSA]], i64 0, i32 0, i32 1
+; CHECK-NEXT: store float [[MUL_1]], ptr [[A_GEP_1]], align 8
+; CHECK-NEXT: [[B_GEP_2:%.*]] = getelementptr inbounds float, ptr [[B]], i64 2
+; CHECK-NEXT: [[L_2:%.*]] = load float, ptr [[B_GEP_2]], align 8
; CHECK-NEXT: [[ADD_2:%.*]] = fadd float [[L_2]], 1.000000e+01
; CHECK-NEXT: [[MUL_2:%.*]] = fmul float [[ADD_2]], 3.000000e+01
-; CHECK-NEXT: [[A_GEP_2:%.*]] = getelementptr inbounds [[STRUCT_2]], %struct.2* [[PTR_PHI_LCSSA]], i64 0, i32 0, i32 2
-; CHECK-NEXT: store float [[MUL_2]], float* [[A_GEP_2]], align 8
-; CHECK-NEXT: [[B_GEP_3:%.*]] = getelementptr inbounds float, float* [[B]], i64 3
-; CHECK-NEXT: [[L_3:%.*]] = load float, float* [[B_GEP_3]], align 8
+; CHECK-NEXT: [[A_GEP_2:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[PTR_PHI_LCSSA]], i64 0, i32 0, i32 2
+; CHECK-NEXT: store float [[MUL_2]], ptr [[A_GEP_2]], align 8
+; CHECK-NEXT: [[B_GEP_3:%.*]] = getelementptr inbounds float, ptr [[B]], i64 3
+; CHECK-NEXT: [[L_3:%.*]] = load float, ptr [[B_GEP_3]], align 8
; CHECK-NEXT: [[ADD_3:%.*]] = fadd float [[L_3]], 1.000000e+01
; CHECK-NEXT: [[MUL_3:%.*]] = fmul float [[ADD_3]], 3.000000e+01
-; CHECK-NEXT: [[A_GEP_3:%.*]] = getelementptr inbounds [[STRUCT_2]], %struct.2* [[PTR_PHI_LCSSA]], i64 0, i32 0, i32 3
-; CHECK-NEXT: store float [[MUL_3]], float* [[A_GEP_3]], align 8
+; CHECK-NEXT: [[A_GEP_3:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[PTR_PHI_LCSSA]], i64 0, i32 0, i32 3
+; CHECK-NEXT: store float [[MUL_3]], ptr [[A_GEP_3]], align 8
; CHECK-NEXT: ret void
;
bb:
br label %loop
loop:
- %ptr.phi = phi %struct.2* [ %A, %bb ], [ null, %loop ]
+ %ptr.phi = phi ptr [ %A, %bb ], [ null, %loop ]
br i1 %c, label %exit, label %loop
exit:
- %ptr.phi.lcssa = phi %struct.2* [ %ptr.phi, %loop ]
- %B.gep.0 = getelementptr inbounds float, float* %B, i64 0
- %l.0 = load float, float* %B.gep.0, align 8
+ %ptr.phi.lcssa = phi ptr [ %ptr.phi, %loop ]
+ %l.0 = load float, ptr %B, align 8
%add.0 = fadd float %l.0, 10.0
%mul.0 = fmul float %add.0, 30.0
- %A.gep.0 = getelementptr inbounds %struct.2, %struct.2* %ptr.phi.lcssa, i64 0, i32 0, i32 0
- store float %mul.0, float* %A.gep.0, align 8
- %B.gep.1 = getelementptr inbounds float, float* %B, i64 1
- %l.1 = load float, float* %B.gep.1, align 8
+ store float %mul.0, ptr %ptr.phi.lcssa, align 8
+ %B.gep.1 = getelementptr inbounds float, ptr %B, i64 1
+ %l.1 = load float, ptr %B.gep.1, align 8
%add.1 = fadd float %l.1, 10.0
%mul.1 = fmul float %add.1, 30.0
- %A.gep.1 = getelementptr inbounds %struct.2, %struct.2* %ptr.phi.lcssa, i64 0, i32 0, i32 1
- store float %mul.1, float* %A.gep.1, align 8
- %B.gep.2 = getelementptr inbounds float, float* %B, i64 2
- %l.2 = load float, float* %B.gep.2, align 8
+ %A.gep.1 = getelementptr inbounds %struct.2, ptr %ptr.phi.lcssa, i64 0, i32 0, i32 1
+ store float %mul.1, ptr %A.gep.1, align 8
+ %B.gep.2 = getelementptr inbounds float, ptr %B, i64 2
+ %l.2 = load float, ptr %B.gep.2, align 8
%add.2 = fadd float %l.2, 10.0
%mul.2 = fmul float %add.2, 30.0
- %A.gep.2 = getelementptr inbounds %struct.2, %struct.2* %ptr.phi.lcssa, i64 0, i32 0, i32 2
- store float %mul.2, float* %A.gep.2, align 8
- %B.gep.3 = getelementptr inbounds float, float* %B, i64 3
- %l.3 = load float, float* %B.gep.3, align 8
+ %A.gep.2 = getelementptr inbounds %struct.2, ptr %ptr.phi.lcssa, i64 0, i32 0, i32 2
+ store float %mul.2, ptr %A.gep.2, align 8
+ %B.gep.3 = getelementptr inbounds float, ptr %B, i64 3
+ %l.3 = load float, ptr %B.gep.3, align 8
%add.3 = fadd float %l.3, 10.0
%mul.3 = fmul float %add.3, 30.0
- %A.gep.3 = getelementptr inbounds %struct.2, %struct.2* %ptr.phi.lcssa, i64 0, i32 0, i32 3
- store float %mul.3, float* %A.gep.3, align 8
+ %A.gep.3 = getelementptr inbounds %struct.2, ptr %ptr.phi.lcssa, i64 0, i32 0, i32 3
+ store float %mul.3, ptr %A.gep.3, align 8
ret void
}
%struct.spam = type { [60 x i32], i32, [12 x i8] }
-declare void @foo(i8*)
+declare void @foo(ptr)
; Test case with a basic block where parts can be vectorized without versioning.
-define i32 @block_partly_vectorized_without_versioning(%struct.spam* readonly %arg, i8* nocapture readonly %arg1, i8* nocapture %arg2, i8* nocapture readonly %arg3, i8* %A, i8* %B) {
+define i32 @block_partly_vectorized_without_versioning(ptr readonly %arg, ptr nocapture readonly %arg1, ptr nocapture %arg2, ptr nocapture readonly %arg3, ptr %A, ptr %B) {
; CHECK-LABEL: @block_partly_vectorized_without_versioning(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[T:%.*]] = alloca <16 x i8>, align 16
-; CHECK-NEXT: [[T4:%.*]] = getelementptr inbounds <16 x i8>, <16 x i8>* [[T]], i64 0, i64 0
-; CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds i8, i8* [[ARG3:%.*]], i64 1
-; CHECK-NEXT: [[T6:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 2
-; CHECK-NEXT: [[T7:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 3
-; CHECK-NEXT: [[T8:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 4
-; CHECK-NEXT: [[T9:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 5
-; CHECK-NEXT: [[T10:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 6
-; CHECK-NEXT: [[T11:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 7
-; CHECK-NEXT: [[T12:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 8
-; CHECK-NEXT: [[T13:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 9
-; CHECK-NEXT: [[T14:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 10
-; CHECK-NEXT: [[T15:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 11
-; CHECK-NEXT: [[T16:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 12
-; CHECK-NEXT: [[T17:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 13
-; CHECK-NEXT: [[T18:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 14
-; CHECK-NEXT: [[T19:%.*]] = bitcast i8* [[ARG1:%.*]] to <16 x i8>*
-; CHECK-NEXT: [[A_GEP_0:%.*]] = getelementptr i8, i8* [[A:%.*]], i64 0
-; CHECK-NEXT: [[B_GEP_0:%.*]] = getelementptr i8, i8* [[B:%.*]], i64 0
-; CHECK-NEXT: [[R_GEP_0:%.*]] = getelementptr i8, i8* [[ARG1]], i64 0
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[A_GEP_0]] to <16 x i8>*
-; CHECK-NEXT: [[TMP1:%.*]] = load <16 x i8>, <16 x i8>* [[TMP0]], align 1
-; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[B_GEP_0]] to <16 x i8>*
-; CHECK-NEXT: [[TMP3:%.*]] = load <16 x i8>, <16 x i8>* [[TMP2]], align 1
-; CHECK-NEXT: [[TMP4:%.*]] = xor <16 x i8> [[TMP1]], [[TMP3]]
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[R_GEP_0]] to <16 x i8>*
-; CHECK-NEXT: store <16 x i8> [[TMP4]], <16 x i8>* [[TMP5]], align 1
-; CHECK-NEXT: [[T21:%.*]] = getelementptr inbounds i8, i8* [[ARG3]], i64 15
-; CHECK-NEXT: [[T22:%.*]] = bitcast i8* [[ARG3]] to <16 x i8>*
-; CHECK-NEXT: call void @foo(i8* nonnull [[T4]])
-; CHECK-NEXT: [[T26:%.*]] = load i8, i8* [[ARG3]], align 1
-; CHECK-NEXT: [[T27:%.*]] = load i8, i8* [[ARG2:%.*]], align 1
+; CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds i8, ptr [[ARG3:%.*]], i64 1
+; CHECK-NEXT: [[T6:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 2
+; CHECK-NEXT: [[T7:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 3
+; CHECK-NEXT: [[T8:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 4
+; CHECK-NEXT: [[T9:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 5
+; CHECK-NEXT: [[T10:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 6
+; CHECK-NEXT: [[T11:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 7
+; CHECK-NEXT: [[T12:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 8
+; CHECK-NEXT: [[T13:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 9
+; CHECK-NEXT: [[T14:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 10
+; CHECK-NEXT: [[T15:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 11
+; CHECK-NEXT: [[T16:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 12
+; CHECK-NEXT: [[T17:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 13
+; CHECK-NEXT: [[T18:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 14
+; CHECK-NEXT: [[TMP0:%.*]] = load <16 x i8>, ptr [[A:%.*]], align 1
+; CHECK-NEXT: [[TMP1:%.*]] = load <16 x i8>, ptr [[B:%.*]], align 1
+; CHECK-NEXT: [[TMP2:%.*]] = xor <16 x i8> [[TMP0]], [[TMP1]]
+; CHECK-NEXT: store <16 x i8> [[TMP2]], ptr [[ARG1:%.*]], align 1
+; CHECK-NEXT: [[T21:%.*]] = getelementptr inbounds i8, ptr [[ARG3]], i64 15
+; CHECK-NEXT: call void @foo(ptr nonnull [[T]])
+; CHECK-NEXT: [[T26:%.*]] = load i8, ptr [[ARG3]], align 1
+; CHECK-NEXT: [[T27:%.*]] = load i8, ptr [[ARG2:%.*]], align 1
; CHECK-NEXT: [[T28:%.*]] = xor i8 [[T27]], [[T26]]
-; CHECK-NEXT: store i8 [[T28]], i8* [[ARG2]], align 1
-; CHECK-NEXT: [[T29:%.*]] = load i8, i8* [[T5]], align 1
-; CHECK-NEXT: [[T30:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 1
-; CHECK-NEXT: [[T31:%.*]] = load i8, i8* [[T30]], align 1
+; CHECK-NEXT: store i8 [[T28]], ptr [[ARG2]], align 1
+; CHECK-NEXT: [[T29:%.*]] = load i8, ptr [[T5]], align 1
+; CHECK-NEXT: [[T30:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 1
+; CHECK-NEXT: [[T31:%.*]] = load i8, ptr [[T30]], align 1
; CHECK-NEXT: [[T32:%.*]] = xor i8 [[T31]], [[T29]]
-; CHECK-NEXT: store i8 [[T32]], i8* [[T30]], align 1
-; CHECK-NEXT: [[T33:%.*]] = load i8, i8* [[T6]], align 1
-; CHECK-NEXT: [[T34:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 2
-; CHECK-NEXT: [[T35:%.*]] = load i8, i8* [[T34]], align 1
+; CHECK-NEXT: store i8 [[T32]], ptr [[T30]], align 1
+; CHECK-NEXT: [[T33:%.*]] = load i8, ptr [[T6]], align 1
+; CHECK-NEXT: [[T34:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 2
+; CHECK-NEXT: [[T35:%.*]] = load i8, ptr [[T34]], align 1
; CHECK-NEXT: [[T36:%.*]] = xor i8 [[T35]], [[T33]]
-; CHECK-NEXT: store i8 [[T36]], i8* [[T34]], align 1
-; CHECK-NEXT: [[T37:%.*]] = load i8, i8* [[T7]], align 1
-; CHECK-NEXT: [[T38:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 3
-; CHECK-NEXT: [[T39:%.*]] = load i8, i8* [[T38]], align 1
+; CHECK-NEXT: store i8 [[T36]], ptr [[T34]], align 1
+; CHECK-NEXT: [[T37:%.*]] = load i8, ptr [[T7]], align 1
+; CHECK-NEXT: [[T38:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 3
+; CHECK-NEXT: [[T39:%.*]] = load i8, ptr [[T38]], align 1
; CHECK-NEXT: [[T40:%.*]] = xor i8 [[T39]], [[T37]]
-; CHECK-NEXT: store i8 [[T40]], i8* [[T38]], align 1
-; CHECK-NEXT: [[T41:%.*]] = load i8, i8* [[T8]], align 1
-; CHECK-NEXT: [[T42:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 4
-; CHECK-NEXT: [[T43:%.*]] = load i8, i8* [[T42]], align 1
+; CHECK-NEXT: store i8 [[T40]], ptr [[T38]], align 1
+; CHECK-NEXT: [[T41:%.*]] = load i8, ptr [[T8]], align 1
+; CHECK-NEXT: [[T42:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 4
+; CHECK-NEXT: [[T43:%.*]] = load i8, ptr [[T42]], align 1
; CHECK-NEXT: [[T44:%.*]] = xor i8 [[T43]], [[T41]]
-; CHECK-NEXT: store i8 [[T44]], i8* [[T42]], align 1
-; CHECK-NEXT: [[T45:%.*]] = load i8, i8* [[T9]], align 1
-; CHECK-NEXT: [[T46:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 5
-; CHECK-NEXT: [[T47:%.*]] = load i8, i8* [[T46]], align 1
+; CHECK-NEXT: store i8 [[T44]], ptr [[T42]], align 1
+; CHECK-NEXT: [[T45:%.*]] = load i8, ptr [[T9]], align 1
+; CHECK-NEXT: [[T46:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 5
+; CHECK-NEXT: [[T47:%.*]] = load i8, ptr [[T46]], align 1
; CHECK-NEXT: [[T48:%.*]] = xor i8 [[T47]], [[T45]]
-; CHECK-NEXT: store i8 [[T48]], i8* [[T46]], align 1
-; CHECK-NEXT: [[T49:%.*]] = load i8, i8* [[T10]], align 1
-; CHECK-NEXT: [[T50:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 6
-; CHECK-NEXT: [[T51:%.*]] = load i8, i8* [[T50]], align 1
+; CHECK-NEXT: store i8 [[T48]], ptr [[T46]], align 1
+; CHECK-NEXT: [[T49:%.*]] = load i8, ptr [[T10]], align 1
+; CHECK-NEXT: [[T50:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 6
+; CHECK-NEXT: [[T51:%.*]] = load i8, ptr [[T50]], align 1
; CHECK-NEXT: [[T52:%.*]] = xor i8 [[T51]], [[T49]]
-; CHECK-NEXT: store i8 [[T52]], i8* [[T50]], align 1
-; CHECK-NEXT: [[T53:%.*]] = load i8, i8* [[T11]], align 1
-; CHECK-NEXT: [[T54:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 7
-; CHECK-NEXT: [[T55:%.*]] = load i8, i8* [[T54]], align 1
+; CHECK-NEXT: store i8 [[T52]], ptr [[T50]], align 1
+; CHECK-NEXT: [[T53:%.*]] = load i8, ptr [[T11]], align 1
+; CHECK-NEXT: [[T54:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 7
+; CHECK-NEXT: [[T55:%.*]] = load i8, ptr [[T54]], align 1
; CHECK-NEXT: [[T56:%.*]] = xor i8 [[T55]], [[T53]]
-; CHECK-NEXT: store i8 [[T56]], i8* [[T54]], align 1
-; CHECK-NEXT: [[T57:%.*]] = load i8, i8* [[T12]], align 1
-; CHECK-NEXT: [[T58:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 8
-; CHECK-NEXT: [[T59:%.*]] = load i8, i8* [[T58]], align 1
+; CHECK-NEXT: store i8 [[T56]], ptr [[T54]], align 1
+; CHECK-NEXT: [[T57:%.*]] = load i8, ptr [[T12]], align 1
+; CHECK-NEXT: [[T58:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 8
+; CHECK-NEXT: [[T59:%.*]] = load i8, ptr [[T58]], align 1
; CHECK-NEXT: [[T60:%.*]] = xor i8 [[T59]], [[T57]]
-; CHECK-NEXT: store i8 [[T60]], i8* [[T58]], align 1
-; CHECK-NEXT: [[T61:%.*]] = load i8, i8* [[T13]], align 1
-; CHECK-NEXT: [[T62:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 9
-; CHECK-NEXT: [[T63:%.*]] = load i8, i8* [[T62]], align 1
+; CHECK-NEXT: store i8 [[T60]], ptr [[T58]], align 1
+; CHECK-NEXT: [[T61:%.*]] = load i8, ptr [[T13]], align 1
+; CHECK-NEXT: [[T62:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 9
+; CHECK-NEXT: [[T63:%.*]] = load i8, ptr [[T62]], align 1
; CHECK-NEXT: [[T64:%.*]] = xor i8 [[T63]], [[T61]]
-; CHECK-NEXT: store i8 [[T64]], i8* [[T62]], align 1
-; CHECK-NEXT: [[T65:%.*]] = load i8, i8* [[T14]], align 1
-; CHECK-NEXT: [[T66:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 10
-; CHECK-NEXT: [[T67:%.*]] = load i8, i8* [[T66]], align 1
+; CHECK-NEXT: store i8 [[T64]], ptr [[T62]], align 1
+; CHECK-NEXT: [[T65:%.*]] = load i8, ptr [[T14]], align 1
+; CHECK-NEXT: [[T66:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 10
+; CHECK-NEXT: [[T67:%.*]] = load i8, ptr [[T66]], align 1
; CHECK-NEXT: [[T68:%.*]] = xor i8 [[T67]], [[T65]]
-; CHECK-NEXT: store i8 [[T68]], i8* [[T66]], align 1
-; CHECK-NEXT: [[T69:%.*]] = load i8, i8* [[T15]], align 1
-; CHECK-NEXT: [[T70:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 11
-; CHECK-NEXT: [[T71:%.*]] = load i8, i8* [[T70]], align 1
+; CHECK-NEXT: store i8 [[T68]], ptr [[T66]], align 1
+; CHECK-NEXT: [[T69:%.*]] = load i8, ptr [[T15]], align 1
+; CHECK-NEXT: [[T70:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 11
+; CHECK-NEXT: [[T71:%.*]] = load i8, ptr [[T70]], align 1
; CHECK-NEXT: [[T72:%.*]] = xor i8 [[T71]], [[T69]]
-; CHECK-NEXT: store i8 [[T72]], i8* [[T70]], align 1
-; CHECK-NEXT: [[T73:%.*]] = load i8, i8* [[T16]], align 1
-; CHECK-NEXT: [[T74:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 12
-; CHECK-NEXT: [[T75:%.*]] = load i8, i8* [[T74]], align 1
+; CHECK-NEXT: store i8 [[T72]], ptr [[T70]], align 1
+; CHECK-NEXT: [[T73:%.*]] = load i8, ptr [[T16]], align 1
+; CHECK-NEXT: [[T74:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 12
+; CHECK-NEXT: [[T75:%.*]] = load i8, ptr [[T74]], align 1
; CHECK-NEXT: [[T76:%.*]] = xor i8 [[T75]], [[T73]]
-; CHECK-NEXT: store i8 [[T76]], i8* [[T74]], align 1
-; CHECK-NEXT: [[T77:%.*]] = load i8, i8* [[T17]], align 1
-; CHECK-NEXT: [[T78:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 13
-; CHECK-NEXT: [[T79:%.*]] = load i8, i8* [[T78]], align 1
+; CHECK-NEXT: store i8 [[T76]], ptr [[T74]], align 1
+; CHECK-NEXT: [[T77:%.*]] = load i8, ptr [[T17]], align 1
+; CHECK-NEXT: [[T78:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 13
+; CHECK-NEXT: [[T79:%.*]] = load i8, ptr [[T78]], align 1
; CHECK-NEXT: [[T80:%.*]] = xor i8 [[T79]], [[T77]]
-; CHECK-NEXT: store i8 [[T80]], i8* [[T78]], align 1
-; CHECK-NEXT: [[T81:%.*]] = load i8, i8* [[T18]], align 1
-; CHECK-NEXT: [[T82:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 14
-; CHECK-NEXT: [[T83:%.*]] = load i8, i8* [[T82]], align 1
+; CHECK-NEXT: store i8 [[T80]], ptr [[T78]], align 1
+; CHECK-NEXT: [[T81:%.*]] = load i8, ptr [[T18]], align 1
+; CHECK-NEXT: [[T82:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 14
+; CHECK-NEXT: [[T83:%.*]] = load i8, ptr [[T82]], align 1
; CHECK-NEXT: [[T84:%.*]] = xor i8 [[T83]], [[T81]]
-; CHECK-NEXT: store i8 [[T84]], i8* [[T82]], align 1
-; CHECK-NEXT: [[T85:%.*]] = load i8, i8* [[T21]], align 1
-; CHECK-NEXT: [[T86:%.*]] = getelementptr inbounds i8, i8* [[ARG2]], i64 15
-; CHECK-NEXT: [[T87:%.*]] = load i8, i8* [[T86]], align 1
+; CHECK-NEXT: store i8 [[T84]], ptr [[T82]], align 1
+; CHECK-NEXT: [[T85:%.*]] = load i8, ptr [[T21]], align 1
+; CHECK-NEXT: [[T86:%.*]] = getelementptr inbounds i8, ptr [[ARG2]], i64 15
+; CHECK-NEXT: [[T87:%.*]] = load i8, ptr [[T86]], align 1
; CHECK-NEXT: [[T88:%.*]] = xor i8 [[T87]], [[T85]]
-; CHECK-NEXT: store i8 [[T88]], i8* [[T86]], align 1
+; CHECK-NEXT: store i8 [[T88]], ptr [[T86]], align 1
; CHECK-NEXT: ret i32 1
;
bb:
%t = alloca <16 x i8>, align 16
- %t4 = getelementptr inbounds <16 x i8>, <16 x i8>* %t, i64 0, i64 0
- %t5 = getelementptr inbounds i8, i8* %arg3, i64 1
- %t6 = getelementptr inbounds i8, i8* %arg3, i64 2
- %t7 = getelementptr inbounds i8, i8* %arg3, i64 3
- %t8 = getelementptr inbounds i8, i8* %arg3, i64 4
- %t9 = getelementptr inbounds i8, i8* %arg3, i64 5
- %t10 = getelementptr inbounds i8, i8* %arg3, i64 6
- %t11 = getelementptr inbounds i8, i8* %arg3, i64 7
- %t12 = getelementptr inbounds i8, i8* %arg3, i64 8
- %t13 = getelementptr inbounds i8, i8* %arg3, i64 9
- %t14 = getelementptr inbounds i8, i8* %arg3, i64 10
- %t15 = getelementptr inbounds i8, i8* %arg3, i64 11
- %t16 = getelementptr inbounds i8, i8* %arg3, i64 12
- %t17 = getelementptr inbounds i8, i8* %arg3, i64 13
- %t18 = getelementptr inbounds i8, i8* %arg3, i64 14
- %t19 = bitcast i8* %arg1 to <16 x i8>*
- %A.gep.0 = getelementptr i8, i8* %A, i64 0
- %A.0 = load i8, i8* %A.gep.0
- %B.gep.0 = getelementptr i8, i8* %B, i64 0
- %B.0 = load i8, i8* %B.gep.0
+ %t5 = getelementptr inbounds i8, ptr %arg3, i64 1
+ %t6 = getelementptr inbounds i8, ptr %arg3, i64 2
+ %t7 = getelementptr inbounds i8, ptr %arg3, i64 3
+ %t8 = getelementptr inbounds i8, ptr %arg3, i64 4
+ %t9 = getelementptr inbounds i8, ptr %arg3, i64 5
+ %t10 = getelementptr inbounds i8, ptr %arg3, i64 6
+ %t11 = getelementptr inbounds i8, ptr %arg3, i64 7
+ %t12 = getelementptr inbounds i8, ptr %arg3, i64 8
+ %t13 = getelementptr inbounds i8, ptr %arg3, i64 9
+ %t14 = getelementptr inbounds i8, ptr %arg3, i64 10
+ %t15 = getelementptr inbounds i8, ptr %arg3, i64 11
+ %t16 = getelementptr inbounds i8, ptr %arg3, i64 12
+ %t17 = getelementptr inbounds i8, ptr %arg3, i64 13
+ %t18 = getelementptr inbounds i8, ptr %arg3, i64 14
+ %A.0 = load i8, ptr %A
+ %B.0 = load i8, ptr %B
%xor.0 = xor i8 %A.0, %B.0
- %A.gep.1 = getelementptr i8, i8* %A, i64 1
- %A.1 = load i8, i8* %A.gep.1
- %B.gep.1 = getelementptr i8, i8* %B, i64 1
- %B.1 = load i8, i8* %B.gep.1
+ %A.gep.1 = getelementptr i8, ptr %A, i64 1
+ %A.1 = load i8, ptr %A.gep.1
+ %B.gep.1 = getelementptr i8, ptr %B, i64 1
+ %B.1 = load i8, ptr %B.gep.1
%xor.1 = xor i8 %A.1, %B.1
- %A.gep.2 = getelementptr i8, i8* %A, i64 2
- %A.2 = load i8, i8* %A.gep.2
- %B.gep.2 = getelementptr i8, i8* %B, i64 2
- %B.2 = load i8, i8* %B.gep.2
+ %A.gep.2 = getelementptr i8, ptr %A, i64 2
+ %A.2 = load i8, ptr %A.gep.2
+ %B.gep.2 = getelementptr i8, ptr %B, i64 2
+ %B.2 = load i8, ptr %B.gep.2
%xor.2 = xor i8 %A.2, %B.2
- %A.gep.3 = getelementptr i8, i8* %A, i64 3
- %A.3 = load i8, i8* %A.gep.3
- %B.gep.3 = getelementptr i8, i8* %B, i64 3
- %B.3 = load i8, i8* %B.gep.3
+ %A.gep.3 = getelementptr i8, ptr %A, i64 3
+ %A.3 = load i8, ptr %A.gep.3
+ %B.gep.3 = getelementptr i8, ptr %B, i64 3
+ %B.3 = load i8, ptr %B.gep.3
%xor.3 = xor i8 %A.3, %B.3
- %A.gep.4 = getelementptr i8, i8* %A, i64 4
- %A.4 = load i8, i8* %A.gep.4
- %B.gep.4 = getelementptr i8, i8* %B, i64 4
- %B.4 = load i8, i8* %B.gep.4
+ %A.gep.4 = getelementptr i8, ptr %A, i64 4
+ %A.4 = load i8, ptr %A.gep.4
+ %B.gep.4 = getelementptr i8, ptr %B, i64 4
+ %B.4 = load i8, ptr %B.gep.4
%xor.4 = xor i8 %A.4, %B.4
- %A.gep.5 = getelementptr i8, i8* %A, i64 5
- %A.5 = load i8, i8* %A.gep.5
- %B.gep.5 = getelementptr i8, i8* %B, i64 5
- %B.5 = load i8, i8* %B.gep.5
+ %A.gep.5 = getelementptr i8, ptr %A, i64 5
+ %A.5 = load i8, ptr %A.gep.5
+ %B.gep.5 = getelementptr i8, ptr %B, i64 5
+ %B.5 = load i8, ptr %B.gep.5
%xor.5 = xor i8 %A.5, %B.5
- %A.gep.6 = getelementptr i8, i8* %A, i64 6
- %A.6 = load i8, i8* %A.gep.6
- %B.gep.6 = getelementptr i8, i8* %B, i64 6
- %B.6 = load i8, i8* %B.gep.6
+ %A.gep.6 = getelementptr i8, ptr %A, i64 6
+ %A.6 = load i8, ptr %A.gep.6
+ %B.gep.6 = getelementptr i8, ptr %B, i64 6
+ %B.6 = load i8, ptr %B.gep.6
%xor.6 = xor i8 %A.6, %B.6
- %A.gep.7 = getelementptr i8, i8* %A, i64 7
- %A.7 = load i8, i8* %A.gep.7
- %B.gep.7 = getelementptr i8, i8* %B, i64 7
- %B.7 = load i8, i8* %B.gep.7
+ %A.gep.7 = getelementptr i8, ptr %A, i64 7
+ %A.7 = load i8, ptr %A.gep.7
+ %B.gep.7 = getelementptr i8, ptr %B, i64 7
+ %B.7 = load i8, ptr %B.gep.7
%xor.7 = xor i8 %A.7, %B.7
- %A.gep.8 = getelementptr i8, i8* %A, i64 8
- %A.8 = load i8, i8* %A.gep.8
- %B.gep.8 = getelementptr i8, i8* %B, i64 8
- %B.8 = load i8, i8* %B.gep.8
+ %A.gep.8 = getelementptr i8, ptr %A, i64 8
+ %A.8 = load i8, ptr %A.gep.8
+ %B.gep.8 = getelementptr i8, ptr %B, i64 8
+ %B.8 = load i8, ptr %B.gep.8
%xor.8 = xor i8 %A.8, %B.8
- %A.gep.9 = getelementptr i8, i8* %A, i64 9
- %A.9 = load i8, i8* %A.gep.9
- %B.gep.9 = getelementptr i8, i8* %B, i64 9
- %B.9 = load i8, i8* %B.gep.9
+ %A.gep.9 = getelementptr i8, ptr %A, i64 9
+ %A.9 = load i8, ptr %A.gep.9
+ %B.gep.9 = getelementptr i8, ptr %B, i64 9
+ %B.9 = load i8, ptr %B.gep.9
%xor.9 = xor i8 %A.9, %B.9
- %A.gep.10 = getelementptr i8, i8* %A, i64 10
- %A.10 = load i8, i8* %A.gep.10
- %B.gep.10 = getelementptr i8, i8* %B, i64 10
- %B.10 = load i8, i8* %B.gep.10
+ %A.gep.10 = getelementptr i8, ptr %A, i64 10
+ %A.10 = load i8, ptr %A.gep.10
+ %B.gep.10 = getelementptr i8, ptr %B, i64 10
+ %B.10 = load i8, ptr %B.gep.10
%xor.10 = xor i8 %A.10, %B.10
- %A.gep.11 = getelementptr i8, i8* %A, i64 11
- %A.11 = load i8, i8* %A.gep.11
- %B.gep.11 = getelementptr i8, i8* %B, i64 11
- %B.11 = load i8, i8* %B.gep.11
+ %A.gep.11 = getelementptr i8, ptr %A, i64 11
+ %A.11 = load i8, ptr %A.gep.11
+ %B.gep.11 = getelementptr i8, ptr %B, i64 11
+ %B.11 = load i8, ptr %B.gep.11
%xor.11 = xor i8 %A.11, %B.11
- %A.gep.12 = getelementptr i8, i8* %A, i64 12
- %A.12 = load i8, i8* %A.gep.12
- %B.gep.12 = getelementptr i8, i8* %B, i64 12
- %B.12 = load i8, i8* %B.gep.12
+ %A.gep.12 = getelementptr i8, ptr %A, i64 12
+ %A.12 = load i8, ptr %A.gep.12
+ %B.gep.12 = getelementptr i8, ptr %B, i64 12
+ %B.12 = load i8, ptr %B.gep.12
%xor.12 = xor i8 %A.12, %B.12
- %A.gep.13 = getelementptr i8, i8* %A, i64 13
- %A.13 = load i8, i8* %A.gep.13
- %B.gep.13 = getelementptr i8, i8* %B, i64 13
- %B.13 = load i8, i8* %B.gep.13
+ %A.gep.13 = getelementptr i8, ptr %A, i64 13
+ %A.13 = load i8, ptr %A.gep.13
+ %B.gep.13 = getelementptr i8, ptr %B, i64 13
+ %B.13 = load i8, ptr %B.gep.13
%xor.13 = xor i8 %A.13, %B.13
- %A.gep.14 = getelementptr i8, i8* %A, i64 14
- %A.14 = load i8, i8* %A.gep.14
- %B.gep.14 = getelementptr i8, i8* %B, i64 14
- %B.14 = load i8, i8* %B.gep.14
+ %A.gep.14 = getelementptr i8, ptr %A, i64 14
+ %A.14 = load i8, ptr %A.gep.14
+ %B.gep.14 = getelementptr i8, ptr %B, i64 14
+ %B.14 = load i8, ptr %B.gep.14
%xor.14 = xor i8 %A.14, %B.14
- %A.gep.15 = getelementptr i8, i8* %A, i64 15
- %A.15 = load i8, i8* %A.gep.15
- %B.gep.15 = getelementptr i8, i8* %B, i64 15
- %B.15 = load i8, i8* %B.gep.15
+ %A.gep.15 = getelementptr i8, ptr %A, i64 15
+ %A.15 = load i8, ptr %A.gep.15
+ %B.gep.15 = getelementptr i8, ptr %B, i64 15
+ %B.15 = load i8, ptr %B.gep.15
%xor.15 = xor i8 %A.15, %B.15
- %R.gep.0 = getelementptr i8, i8* %arg1, i64 0
- store i8 %xor.0, i8* %R.gep.0
- %R.gep.1 = getelementptr i8, i8* %arg1, i64 1
- store i8 %xor.1, i8* %R.gep.1
- %R.gep.2 = getelementptr i8, i8* %arg1, i64 2
- store i8 %xor.2, i8* %R.gep.2
- %R.gep.3 = getelementptr i8, i8* %arg1, i64 3
- store i8 %xor.3, i8* %R.gep.3
- %R.gep.4 = getelementptr i8, i8* %arg1, i64 4
- store i8 %xor.4, i8* %R.gep.4
- %R.gep.5 = getelementptr i8, i8* %arg1, i64 5
- store i8 %xor.5, i8* %R.gep.5
- %R.gep.6 = getelementptr i8, i8* %arg1, i64 6
- store i8 %xor.6, i8* %R.gep.6
- %R.gep.7 = getelementptr i8, i8* %arg1, i64 7
- store i8 %xor.7, i8* %R.gep.7
- %R.gep.8 = getelementptr i8, i8* %arg1, i64 8
- store i8 %xor.8, i8* %R.gep.8
- %R.gep.9 = getelementptr i8, i8* %arg1, i64 9
- store i8 %xor.9, i8* %R.gep.9
- %R.gep.10 = getelementptr i8, i8* %arg1, i64 10
- store i8 %xor.10, i8* %R.gep.10
- %R.gep.11 = getelementptr i8, i8* %arg1, i64 11
- store i8 %xor.11, i8* %R.gep.11
- %R.gep.12 = getelementptr i8, i8* %arg1, i64 12
- store i8 %xor.12, i8* %R.gep.12
- %R.gep.13 = getelementptr i8, i8* %arg1, i64 13
- store i8 %xor.13, i8* %R.gep.13
- %R.gep.14 = getelementptr i8, i8* %arg1, i64 14
- store i8 %xor.14, i8* %R.gep.14
- %R.gep.15 = getelementptr i8, i8* %arg1, i64 15
- store i8 %xor.15, i8* %R.gep.15
+ store i8 %xor.0, ptr %arg1
+ %R.gep.1 = getelementptr i8, ptr %arg1, i64 1
+ store i8 %xor.1, ptr %R.gep.1
+ %R.gep.2 = getelementptr i8, ptr %arg1, i64 2
+ store i8 %xor.2, ptr %R.gep.2
+ %R.gep.3 = getelementptr i8, ptr %arg1, i64 3
+ store i8 %xor.3, ptr %R.gep.3
+ %R.gep.4 = getelementptr i8, ptr %arg1, i64 4
+ store i8 %xor.4, ptr %R.gep.4
+ %R.gep.5 = getelementptr i8, ptr %arg1, i64 5
+ store i8 %xor.5, ptr %R.gep.5
+ %R.gep.6 = getelementptr i8, ptr %arg1, i64 6
+ store i8 %xor.6, ptr %R.gep.6
+ %R.gep.7 = getelementptr i8, ptr %arg1, i64 7
+ store i8 %xor.7, ptr %R.gep.7
+ %R.gep.8 = getelementptr i8, ptr %arg1, i64 8
+ store i8 %xor.8, ptr %R.gep.8
+ %R.gep.9 = getelementptr i8, ptr %arg1, i64 9
+ store i8 %xor.9, ptr %R.gep.9
+ %R.gep.10 = getelementptr i8, ptr %arg1, i64 10
+ store i8 %xor.10, ptr %R.gep.10
+ %R.gep.11 = getelementptr i8, ptr %arg1, i64 11
+ store i8 %xor.11, ptr %R.gep.11
+ %R.gep.12 = getelementptr i8, ptr %arg1, i64 12
+ store i8 %xor.12, ptr %R.gep.12
+ %R.gep.13 = getelementptr i8, ptr %arg1, i64 13
+ store i8 %xor.13, ptr %R.gep.13
+ %R.gep.14 = getelementptr i8, ptr %arg1, i64 14
+ store i8 %xor.14, ptr %R.gep.14
+ %R.gep.15 = getelementptr i8, ptr %arg1, i64 15
+ store i8 %xor.15, ptr %R.gep.15
- %t21 = getelementptr inbounds i8, i8* %arg3, i64 15
- %t22 = bitcast i8* %arg3 to <16 x i8>*
+ %t21 = getelementptr inbounds i8, ptr %arg3, i64 15
- call void @foo(i8* nonnull %t4)
- %t26 = load i8, i8* %arg3, align 1
- %t27 = load i8, i8* %arg2, align 1
+ call void @foo(ptr nonnull %t)
+ %t26 = load i8, ptr %arg3, align 1
+ %t27 = load i8, ptr %arg2, align 1
%t28 = xor i8 %t27, %t26
- store i8 %t28, i8* %arg2, align 1
- %t29 = load i8, i8* %t5, align 1
- %t30 = getelementptr inbounds i8, i8* %arg2, i64 1
- %t31 = load i8, i8* %t30, align 1
+ store i8 %t28, ptr %arg2, align 1
+ %t29 = load i8, ptr %t5, align 1
+ %t30 = getelementptr inbounds i8, ptr %arg2, i64 1
+ %t31 = load i8, ptr %t30, align 1
%t32 = xor i8 %t31, %t29
- store i8 %t32, i8* %t30, align 1
- %t33 = load i8, i8* %t6, align 1
- %t34 = getelementptr inbounds i8, i8* %arg2, i64 2
- %t35 = load i8, i8* %t34, align 1
+ store i8 %t32, ptr %t30, align 1
+ %t33 = load i8, ptr %t6, align 1
+ %t34 = getelementptr inbounds i8, ptr %arg2, i64 2
+ %t35 = load i8, ptr %t34, align 1
%t36 = xor i8 %t35, %t33
- store i8 %t36, i8* %t34, align 1
- %t37 = load i8, i8* %t7, align 1
- %t38 = getelementptr inbounds i8, i8* %arg2, i64 3
- %t39 = load i8, i8* %t38, align 1
+ store i8 %t36, ptr %t34, align 1
+ %t37 = load i8, ptr %t7, align 1
+ %t38 = getelementptr inbounds i8, ptr %arg2, i64 3
+ %t39 = load i8, ptr %t38, align 1
%t40 = xor i8 %t39, %t37
- store i8 %t40, i8* %t38, align 1
- %t41 = load i8, i8* %t8, align 1
- %t42 = getelementptr inbounds i8, i8* %arg2, i64 4
- %t43 = load i8, i8* %t42, align 1
+ store i8 %t40, ptr %t38, align 1
+ %t41 = load i8, ptr %t8, align 1
+ %t42 = getelementptr inbounds i8, ptr %arg2, i64 4
+ %t43 = load i8, ptr %t42, align 1
%t44 = xor i8 %t43, %t41
- store i8 %t44, i8* %t42, align 1
- %t45 = load i8, i8* %t9, align 1
- %t46 = getelementptr inbounds i8, i8* %arg2, i64 5
- %t47 = load i8, i8* %t46, align 1
+ store i8 %t44, ptr %t42, align 1
+ %t45 = load i8, ptr %t9, align 1
+ %t46 = getelementptr inbounds i8, ptr %arg2, i64 5
+ %t47 = load i8, ptr %t46, align 1
%t48 = xor i8 %t47, %t45
- store i8 %t48, i8* %t46, align 1
- %t49 = load i8, i8* %t10, align 1
- %t50 = getelementptr inbounds i8, i8* %arg2, i64 6
- %t51 = load i8, i8* %t50, align 1
+ store i8 %t48, ptr %t46, align 1
+ %t49 = load i8, ptr %t10, align 1
+ %t50 = getelementptr inbounds i8, ptr %arg2, i64 6
+ %t51 = load i8, ptr %t50, align 1
%t52 = xor i8 %t51, %t49
- store i8 %t52, i8* %t50, align 1
- %t53 = load i8, i8* %t11, align 1
- %t54 = getelementptr inbounds i8, i8* %arg2, i64 7
- %t55 = load i8, i8* %t54, align 1
+ store i8 %t52, ptr %t50, align 1
+ %t53 = load i8, ptr %t11, align 1
+ %t54 = getelementptr inbounds i8, ptr %arg2, i64 7
+ %t55 = load i8, ptr %t54, align 1
%t56 = xor i8 %t55, %t53
- store i8 %t56, i8* %t54, align 1
- %t57 = load i8, i8* %t12, align 1
- %t58 = getelementptr inbounds i8, i8* %arg2, i64 8
- %t59 = load i8, i8* %t58, align 1
+ store i8 %t56, ptr %t54, align 1
+ %t57 = load i8, ptr %t12, align 1
+ %t58 = getelementptr inbounds i8, ptr %arg2, i64 8
+ %t59 = load i8, ptr %t58, align 1
%t60 = xor i8 %t59, %t57
- store i8 %t60, i8* %t58, align 1
- %t61 = load i8, i8* %t13, align 1
- %t62 = getelementptr inbounds i8, i8* %arg2, i64 9
- %t63 = load i8, i8* %t62, align 1
+ store i8 %t60, ptr %t58, align 1
+ %t61 = load i8, ptr %t13, align 1
+ %t62 = getelementptr inbounds i8, ptr %arg2, i64 9
+ %t63 = load i8, ptr %t62, align 1
%t64 = xor i8 %t63, %t61
- store i8 %t64, i8* %t62, align 1
- %t65 = load i8, i8* %t14, align 1
- %t66 = getelementptr inbounds i8, i8* %arg2, i64 10
- %t67 = load i8, i8* %t66, align 1
+ store i8 %t64, ptr %t62, align 1
+ %t65 = load i8, ptr %t14, align 1
+ %t66 = getelementptr inbounds i8, ptr %arg2, i64 10
+ %t67 = load i8, ptr %t66, align 1
%t68 = xor i8 %t67, %t65
- store i8 %t68, i8* %t66, align 1
- %t69 = load i8, i8* %t15, align 1
- %t70 = getelementptr inbounds i8, i8* %arg2, i64 11
- %t71 = load i8, i8* %t70, align 1
+ store i8 %t68, ptr %t66, align 1
+ %t69 = load i8, ptr %t15, align 1
+ %t70 = getelementptr inbounds i8, ptr %arg2, i64 11
+ %t71 = load i8, ptr %t70, align 1
%t72 = xor i8 %t71, %t69
- store i8 %t72, i8* %t70, align 1
- %t73 = load i8, i8* %t16, align 1
- %t74 = getelementptr inbounds i8, i8* %arg2, i64 12
- %t75 = load i8, i8* %t74, align 1
+ store i8 %t72, ptr %t70, align 1
+ %t73 = load i8, ptr %t16, align 1
+ %t74 = getelementptr inbounds i8, ptr %arg2, i64 12
+ %t75 = load i8, ptr %t74, align 1
%t76 = xor i8 %t75, %t73
- store i8 %t76, i8* %t74, align 1
- %t77 = load i8, i8* %t17, align 1
- %t78 = getelementptr inbounds i8, i8* %arg2, i64 13
- %t79 = load i8, i8* %t78, align 1
+ store i8 %t76, ptr %t74, align 1
+ %t77 = load i8, ptr %t17, align 1
+ %t78 = getelementptr inbounds i8, ptr %arg2, i64 13
+ %t79 = load i8, ptr %t78, align 1
%t80 = xor i8 %t79, %t77
- store i8 %t80, i8* %t78, align 1
- %t81 = load i8, i8* %t18, align 1
- %t82 = getelementptr inbounds i8, i8* %arg2, i64 14
- %t83 = load i8, i8* %t82, align 1
+ store i8 %t80, ptr %t78, align 1
+ %t81 = load i8, ptr %t18, align 1
+ %t82 = getelementptr inbounds i8, ptr %arg2, i64 14
+ %t83 = load i8, ptr %t82, align 1
%t84 = xor i8 %t83, %t81
- store i8 %t84, i8* %t82, align 1
- %t85 = load i8, i8* %t21, align 1
- %t86 = getelementptr inbounds i8, i8* %arg2, i64 15
- %t87 = load i8, i8* %t86, align 1
+ store i8 %t84, ptr %t82, align 1
+ %t85 = load i8, ptr %t21, align 1
+ %t86 = getelementptr inbounds i8, ptr %arg2, i64 15
+ %t87 = load i8, ptr %t86, align 1
%t88 = xor i8 %t87, %t85
- store i8 %t88, i8* %t86, align 1
+ store i8 %t88, ptr %t86, align 1
ret i32 1
}
; A test case where instructions required to compute the pointer bounds get
; vectorized before versioning. Make sure there is no crash.
-define void @crash_instructions_deleted(float* %t, i32* %a, i32** noalias %ptr) {
+define void @crash_instructions_deleted(ptr %t, ptr %a, ptr noalias %ptr) {
; CHECK-LABEL: @crash_instructions_deleted(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[T15:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i32 2
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[T15]] to <2 x i32>*
-; CHECK-NEXT: store <2 x i32> <i32 0, i32 10>, <2 x i32>* [[TMP0]], align 8
-; CHECK-NEXT: [[T17:%.*]] = load i32*, i32** [[PTR:%.*]], align 8
+; CHECK-NEXT: [[T15:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i32 2
+; CHECK-NEXT: store <2 x i32> <i32 0, i32 10>, ptr [[T15]], align 8
+; CHECK-NEXT: [[T17:%.*]] = load ptr, ptr [[PTR:%.*]], align 8
; CHECK-NEXT: br label [[BB18:%.*]]
; CHECK: bb18:
; CHECK-NEXT: [[T19:%.*]] = sext i32 0 to i64
; CHECK-NEXT: [[T20:%.*]] = add nsw i64 1, [[T19]]
-; CHECK-NEXT: [[T21:%.*]] = getelementptr inbounds i32, i32* [[T17]], i64 [[T20]]
-; CHECK-NEXT: [[T22:%.*]] = bitcast i32* [[T21]] to i8*
-; CHECK-NEXT: [[T23:%.*]] = getelementptr inbounds i8, i8* [[T22]], i64 1
-; CHECK-NEXT: [[T24:%.*]] = getelementptr inbounds i8, i8* [[T22]], i64 2
-; CHECK-NEXT: [[T25:%.*]] = getelementptr inbounds i8, i8* [[T22]], i64 3
-; CHECK-NEXT: [[T26:%.*]] = load i8, i8* [[T22]], align 1
+; CHECK-NEXT: [[T21:%.*]] = getelementptr inbounds i32, ptr [[T17]], i64 [[T20]]
+; CHECK-NEXT: [[T23:%.*]] = getelementptr inbounds i8, ptr [[T21]], i64 1
+; CHECK-NEXT: [[T24:%.*]] = getelementptr inbounds i8, ptr [[T21]], i64 2
+; CHECK-NEXT: [[T25:%.*]] = getelementptr inbounds i8, ptr [[T21]], i64 3
+; CHECK-NEXT: [[T26:%.*]] = load i8, ptr [[T21]], align 1
; CHECK-NEXT: [[T27:%.*]] = uitofp i8 [[T26]] to float
; CHECK-NEXT: [[T28:%.*]] = fdiv float [[T27]], 2.550000e+02
-; CHECK-NEXT: [[T29:%.*]] = getelementptr inbounds float, float* [[T:%.*]], i64 0
-; CHECK-NEXT: store float [[T28]], float* [[T29]], align 8
-; CHECK-NEXT: [[T30:%.*]] = load i8, i8* [[T23]], align 1
+; CHECK-NEXT: store float [[T28]], ptr [[T:%.*]], align 8
+; CHECK-NEXT: [[T30:%.*]] = load i8, ptr [[T23]], align 1
; CHECK-NEXT: [[T31:%.*]] = uitofp i8 [[T30]] to float
; CHECK-NEXT: [[T32:%.*]] = fdiv float [[T31]], 2.550000e+02
-; CHECK-NEXT: [[T33:%.*]] = getelementptr inbounds float, float* [[T]], i64 1
-; CHECK-NEXT: store float [[T32]], float* [[T33]], align 4
-; CHECK-NEXT: [[T34:%.*]] = load i8, i8* [[T24]], align 1
+; CHECK-NEXT: [[T33:%.*]] = getelementptr inbounds float, ptr [[T]], i64 1
+; CHECK-NEXT: store float [[T32]], ptr [[T33]], align 4
+; CHECK-NEXT: [[T34:%.*]] = load i8, ptr [[T24]], align 1
; CHECK-NEXT: [[T35:%.*]] = uitofp i8 [[T34]] to float
; CHECK-NEXT: [[T36:%.*]] = fdiv float [[T35]], 2.550000e+02
-; CHECK-NEXT: [[T37:%.*]] = getelementptr inbounds float, float* [[T]], i64 2
-; CHECK-NEXT: store float [[T36]], float* [[T37]], align 8
-; CHECK-NEXT: [[T38:%.*]] = load i8, i8* [[T25]], align 1
+; CHECK-NEXT: [[T37:%.*]] = getelementptr inbounds float, ptr [[T]], i64 2
+; CHECK-NEXT: store float [[T36]], ptr [[T37]], align 8
+; CHECK-NEXT: [[T38:%.*]] = load i8, ptr [[T25]], align 1
; CHECK-NEXT: [[T39:%.*]] = uitofp i8 [[T38]] to float
; CHECK-NEXT: [[T40:%.*]] = fdiv float [[T39]], 2.550000e+02
-; CHECK-NEXT: [[T41:%.*]] = getelementptr inbounds float, float* [[T]], i64 3
-; CHECK-NEXT: store float [[T40]], float* [[T41]], align 4
+; CHECK-NEXT: [[T41:%.*]] = getelementptr inbounds float, ptr [[T]], i64 3
+; CHECK-NEXT: store float [[T40]], ptr [[T41]], align 4
; CHECK-NEXT: ret void
;
bb:
@@ -1228,60 +1189,57 @@ bb:
%t12 = icmp sgt i32 20, 20
%t13 = select i1 %t12, i32 5, i32 10
%t14 = select i1 %t11, i32 0, i32 %t13
- %t15 = getelementptr inbounds i32, i32* %a, i32 2
- store i32 %t10, i32* %t15, align 8
- %t16 = getelementptr inbounds i32, i32* %a, i32 3
- store i32 %t14, i32* %t16, align 4
- %t17 = load i32*, i32** %ptr, align 8
+ %t15 = getelementptr inbounds i32, ptr %a, i32 2
+ store i32 %t10, ptr %t15, align 8
+ %t16 = getelementptr inbounds i32, ptr %a, i32 3
+ store i32 %t14, ptr %t16, align 4
+ %t17 = load ptr, ptr %ptr, align 8
br label %bb18
bb18: ; preds = %bb5
%t19 = sext i32 %t10 to i64
%t20 = add nsw i64 1, %t19
- %t21 = getelementptr inbounds i32, i32* %t17, i64 %t20
- %t22 = bitcast i32* %t21 to i8*
- %t23 = getelementptr inbounds i8, i8* %t22, i64 1
- %t24 = getelementptr inbounds i8, i8* %t22, i64 2
- %t25 = getelementptr inbounds i8, i8* %t22, i64 3
- %t26 = load i8, i8* %t22, align 1
+ %t21 = getelementptr inbounds i32, ptr %t17, i64 %t20
+ %t23 = getelementptr inbounds i8, ptr %t21, i64 1
+ %t24 = getelementptr inbounds i8, ptr %t21, i64 2
+ %t25 = getelementptr inbounds i8, ptr %t21, i64 3
+ %t26 = load i8, ptr %t21, align 1
%t27 = uitofp i8 %t26 to float
%t28 = fdiv float %t27, 2.550000e+02
- %t29 = getelementptr inbounds float, float* %t, i64 0
- store float %t28, float* %t29, align 8
- %t30 = load i8, i8* %t23, align 1
+ store float %t28, ptr %t, align 8
+ %t30 = load i8, ptr %t23, align 1
%t31 = uitofp i8 %t30 to float
%t32 = fdiv float %t31, 2.550000e+02
- %t33 = getelementptr inbounds float, float* %t, i64 1
- store float %t32, float* %t33, align 4
- %t34 = load i8, i8* %t24, align 1
+ %t33 = getelementptr inbounds float, ptr %t, i64 1
+ store float %t32, ptr %t33, align 4
+ %t34 = load i8, ptr %t24, align 1
%t35 = uitofp i8 %t34 to float
%t36 = fdiv float %t35, 2.550000e+02
- %t37 = getelementptr inbounds float, float* %t, i64 2
- store float %t36, float* %t37, align 8
- %t38 = load i8, i8* %t25, align 1
+ %t37 = getelementptr inbounds float, ptr %t, i64 2
+ store float %t36, ptr %t37, align 8
+ %t38 = load i8, ptr %t25, align 1
%t39 = uitofp i8 %t38 to float
%t40 = fdiv float %t39, 2.550000e+02
- %t41 = getelementptr inbounds float, float* %t, i64 3
- store float %t40, float* %t41, align 4
+ %t41 = getelementptr inbounds float, ptr %t, i64 3
+ store float %t40, ptr %t41, align 4
ret void
}
; A test case where there are no instructions accessing a tracked object in a
; block for which versioning was requested.
-define void @crash_no_tracked_instructions(float** %arg, float* %arg.2, float* %arg.3, i1 %c) {
+define void @crash_no_tracked_instructions(ptr %arg, ptr %arg.2, ptr %arg.3, i1 %c) {
; CHECK-LABEL: @crash_no_tracked_instructions(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[T19:%.*]] = load float*, float** [[ARG:%.*]], align 8
-; CHECK-NEXT: [[T20:%.*]] = load float, float* [[ARG_3:%.*]], align 4
-; CHECK-NEXT: [[T21:%.*]] = getelementptr inbounds float, float* [[ARG_2:%.*]], i64 0
+; CHECK-NEXT: [[T19:%.*]] = load ptr, ptr [[ARG:%.*]], align 8
+; CHECK-NEXT: [[T20:%.*]] = load float, ptr [[ARG_3:%.*]], align 4
; CHECK-NEXT: br i1 [[C:%.*]], label [[BB22:%.*]], label [[BB30:%.*]]
; CHECK: bb22:
; CHECK-NEXT: [[T23:%.*]] = fmul float [[T20]], 9.900000e+01
; CHECK-NEXT: [[T24:%.*]] = fmul float [[T23]], 9.900000e+01
-; CHECK-NEXT: [[T25:%.*]] = getelementptr inbounds float, float* [[T19]], i64 2
+; CHECK-NEXT: [[T25:%.*]] = getelementptr inbounds float, ptr [[T19]], i64 2
; CHECK-NEXT: [[T26:%.*]] = fmul float [[T23]], 1.000000e+01
-; CHECK-NEXT: store float [[T26]], float* [[T25]], align 4
-; CHECK-NEXT: [[T27:%.*]] = load float, float* [[T21]], align 8
+; CHECK-NEXT: store float [[T26]], ptr [[T25]], align 4
+; CHECK-NEXT: [[T27:%.*]] = load float, ptr [[ARG_2:%.*]], align 8
; CHECK-NEXT: [[T28:%.*]] = fadd float [[T24]], 2.000000e+01
; CHECK-NEXT: [[T29:%.*]] = fadd float [[T26]], 2.000000e+01
; CHECK-NEXT: br label [[BB30]]
@@ -1291,28 +1249,26 @@ define void @crash_no_tracked_instructions(float** %arg, float* %arg.2, float* %
; CHECK-NEXT: br label [[BB36:%.*]]
; CHECK: bb36:
; CHECK-NEXT: [[T37:%.*]] = fmul float [[T31]], 3.000000e+00
-; CHECK-NEXT: [[T38:%.*]] = getelementptr inbounds float, float* [[ARG_3]], i64 0
-; CHECK-NEXT: store float [[T37]], float* [[T38]], align 4
+; CHECK-NEXT: store float [[T37]], ptr [[ARG_3]], align 4
; CHECK-NEXT: [[T39:%.*]] = fmul float [[T32]], 3.000000e+00
-; CHECK-NEXT: [[T40:%.*]] = getelementptr inbounds float, float* [[ARG_3]], i64 1
-; CHECK-NEXT: store float [[T39]], float* [[T40]], align 4
+; CHECK-NEXT: [[T40:%.*]] = getelementptr inbounds float, ptr [[ARG_3]], i64 1
+; CHECK-NEXT: store float [[T39]], ptr [[T40]], align 4
; CHECK-NEXT: br label [[BB41:%.*]]
; CHECK: bb41:
; CHECK-NEXT: ret void
;
entry:
- %t19 = load float*, float** %arg
- %t20 = load float, float* %arg.3, align 4
- %t21 = getelementptr inbounds float, float* %arg.2, i64 0
+ %t19 = load ptr, ptr %arg
+ %t20 = load float, ptr %arg.3, align 4
br i1 %c, label %bb22, label %bb30
bb22:
%t23 = fmul float %t20, 99.0
%t24 = fmul float %t23, 99.0
- %t25 = getelementptr inbounds float, float* %t19, i64 2
+ %t25 = getelementptr inbounds float, ptr %t19, i64 2
%t26 = fmul float %t23, 10.0
- store float %t26, float* %t25, align 4
- %t27 = load float, float* %t21, align 8
+ store float %t26, ptr %t25, align 4
+ %t27 = load float, ptr %arg.2, align 8
%t28 = fadd float %t24, 20.0
%t29 = fadd float %t26, 20.0
br label %bb30
@@ -1324,11 +1280,10 @@ bb30:
bb36:
%t37 = fmul float %t31, 3.0
- %t38 = getelementptr inbounds float, float* %arg.3, i64 0
- store float %t37, float* %t38, align 4
+ store float %t37, ptr %arg.3, align 4
%t39 = fmul float %t32, 3.0
- %t40 = getelementptr inbounds float, float* %arg.3, i64 1
- store float %t39, float* %t40, align 4
+ %t40 = getelementptr inbounds float, ptr %arg.3, i64 1
+ store float %t39, ptr %t40, align 4
br label %bb41
bb41:
diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-di.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-di.ll
index e208255e3f243..834d706a22d2b 100644
--- a/llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-di.ll
+++ b/llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-di.ll
@@ -6,36 +6,34 @@ target triple = "aarch64"
%struct.S = type { i64, i64 }
-define void @patatino(i64 %n, i64 %i, %struct.S* %p) !dbg !7 {
+define void @patatino(i64 %n, i64 %i, ptr %p) !dbg !7 {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: entry:
; CHECK-NEXT: call void @llvm.dbg.value(metadata i64 [[N:%.*]], metadata [[META18:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]]
; CHECK-NEXT: call void @llvm.dbg.value(metadata i64 [[I:%.*]], metadata [[META19:![0-9]+]], metadata !DIExpression()), !dbg [[DBG24:![0-9]+]]
-; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.S* [[P:%.*]], metadata [[META20:![0-9]+]], metadata !DIExpression()), !dbg [[DBG25:![0-9]+]]
-; CHECK-NEXT: [[X1:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], %struct.S* [[P]], i64 [[N]], i32 0, !dbg [[DBG26:![0-9]+]]
+; CHECK-NEXT: call void @llvm.dbg.value(metadata ptr [[P:%.*]], metadata [[META20:![0-9]+]], metadata !DIExpression()), !dbg [[DBG25:![0-9]+]]
+; CHECK-NEXT: [[X1:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[P]], i64 [[N]], i32 0, !dbg [[DBG26:![0-9]+]]
; CHECK-NEXT: call void @llvm.dbg.value(metadata i64 undef, metadata [[META21:![0-9]+]], metadata !DIExpression()), !dbg [[DBG27:![0-9]+]]
; CHECK-NEXT: call void @llvm.dbg.value(metadata i64 undef, metadata [[META22:![0-9]+]], metadata !DIExpression()), !dbg [[DBG28:![0-9]+]]
-; CHECK-NEXT: [[X5:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[P]], i64 [[I]], i32 0, !dbg [[DBG29:![0-9]+]]
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i64* [[X1]] to <2 x i64>*, !dbg [[DBG26]]
-; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, <2 x i64>* [[TMP0]], align 8, !dbg [[DBG26]], !tbaa [[TBAA30:![0-9]+]]
-; CHECK-NEXT: [[TMP2:%.*]] = bitcast i64* [[X5]] to <2 x i64>*, !dbg [[DBG34:![0-9]+]]
-; CHECK-NEXT: store <2 x i64> [[TMP1]], <2 x i64>* [[TMP2]], align 8, !dbg [[DBG34]], !tbaa [[TBAA30]]
+; CHECK-NEXT: [[X5:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[P]], i64 [[I]], i32 0, !dbg [[DBG29:![0-9]+]]
+; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, ptr [[X1]], align 8, !dbg [[DBG26]], !tbaa [[TBAA30:![0-9]+]]
+; CHECK-NEXT: store <2 x i64> [[TMP0]], ptr [[X5]], align 8, !dbg [[DBG34:![0-9]+]], !tbaa [[TBAA30]]
; CHECK-NEXT: ret void, !dbg [[DBG35:![0-9]+]]
;
entry:
call void @llvm.dbg.value(metadata i64 %n, metadata !18, metadata !DIExpression()), !dbg !23
call void @llvm.dbg.value(metadata i64 %i, metadata !19, metadata !DIExpression()), !dbg !24
- call void @llvm.dbg.value(metadata %struct.S* %p, metadata !20, metadata !DIExpression()), !dbg !25
- %x1 = getelementptr inbounds %struct.S, %struct.S* %p, i64 %n, i32 0, !dbg !26
- %0 = load i64, i64* %x1, align 8, !dbg !26, !tbaa !27
+ call void @llvm.dbg.value(metadata ptr %p, metadata !20, metadata !DIExpression()), !dbg !25
+ %x1 = getelementptr inbounds %struct.S, ptr %p, i64 %n, i32 0, !dbg !26
+ %0 = load i64, ptr %x1, align 8, !dbg !26, !tbaa !27
call void @llvm.dbg.value(metadata i64 %0, metadata !21, metadata !DIExpression()), !dbg !32
- %y3 = getelementptr inbounds %struct.S, %struct.S* %p, i64 %n, i32 1, !dbg !33
- %1 = load i64, i64* %y3, align 8, !dbg !33, !tbaa !34
+ %y3 = getelementptr inbounds %struct.S, ptr %p, i64 %n, i32 1, !dbg !33
+ %1 = load i64, ptr %y3, align 8, !dbg !33, !tbaa !34
call void @llvm.dbg.value(metadata i64 %1, metadata !22, metadata !DIExpression()), !dbg !35
- %x5 = getelementptr inbounds %struct.S, %struct.S* %p, i64 %i, i32 0, !dbg !36
- store i64 %0, i64* %x5, align 8, !dbg !37, !tbaa !27
- %y7 = getelementptr inbounds %struct.S, %struct.S* %p, i64 %i, i32 1, !dbg !38
- store i64 %1, i64* %y7, align 8, !dbg !39, !tbaa !34
+ %x5 = getelementptr inbounds %struct.S, ptr %p, i64 %i, i32 0, !dbg !36
+ store i64 %0, ptr %x5, align 8, !dbg !37, !tbaa !27
+ %y7 = getelementptr inbounds %struct.S, ptr %p, i64 %i, i32 1, !dbg !38
+ store i64 %1, ptr %y7, align 8, !dbg !39, !tbaa !34
ret void, !dbg !40
}
diff --git a/llvm/test/Transforms/SLPVectorizer/ARM/sroa.ll b/llvm/test/Transforms/SLPVectorizer/ARM/sroa.ll
index f01d46887acba..1d43aa6a9b9dc 100644
--- a/llvm/test/Transforms/SLPVectorizer/ARM/sroa.ll
+++ b/llvm/test/Transforms/SLPVectorizer/ARM/sroa.ll
@@ -9,7 +9,7 @@ target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-
; because the scalar version of the shl/or are handled by the
; backend and disappear, the vectorized code stays.
-define void @SROAed(%class.Complex* noalias nocapture sret(%class.Complex) %agg.result, [4 x i32] %a.coerce, [4 x i32] %b.coerce) {
+define void @SROAed(ptr noalias nocapture sret(%class.Complex) %agg.result, [4 x i32] %a.coerce, [4 x i32] %b.coerce) {
; CHECK-LABEL: @SROAed(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_COERCE_FCA_0_EXTRACT:%.*]] = extractvalue [4 x i32] [[A_COERCE:%.*]], 0
@@ -42,10 +42,9 @@ define void @SROAed(%class.Complex* noalias nocapture sret(%class.Complex) %agg.
; CHECK-NEXT: [[TMP3:%.*]] = bitcast i64 [[B_SROA_3_12_INSERT_INSERT]] to double
; CHECK-NEXT: [[ADD:%.*]] = fadd double [[TMP0]], [[TMP2]]
; CHECK-NEXT: [[ADD3:%.*]] = fadd double [[TMP1]], [[TMP3]]
-; CHECK-NEXT: [[RE_I_I:%.*]] = getelementptr inbounds [[CLASS_COMPLEX:%.*]], %class.Complex* [[AGG_RESULT:%.*]], i32 0, i32 0
-; CHECK-NEXT: store double [[ADD]], double* [[RE_I_I]], align 4
-; CHECK-NEXT: [[IM_I_I:%.*]] = getelementptr inbounds [[CLASS_COMPLEX]], %class.Complex* [[AGG_RESULT]], i32 0, i32 1
-; CHECK-NEXT: store double [[ADD3]], double* [[IM_I_I]], align 4
+; CHECK-NEXT: store double [[ADD]], ptr [[AGG_RESULT:%.*]], align 4
+; CHECK-NEXT: [[IM_I_I:%.*]] = getelementptr inbounds [[CLASS_COMPLEX:%.*]], ptr [[AGG_RESULT]], i32 0, i32 1
+; CHECK-NEXT: store double [[ADD3]], ptr [[IM_I_I]], align 4
; CHECK-NEXT: ret void
;
entry:
@@ -79,9 +78,8 @@ entry:
%3 = bitcast i64 %b.sroa.3.12.insert.insert to double
%add = fadd double %0, %2
%add3 = fadd double %1, %3
- %re.i.i = getelementptr inbounds %class.Complex, %class.Complex* %agg.result, i32 0, i32 0
- store double %add, double* %re.i.i, align 4
- %im.i.i = getelementptr inbounds %class.Complex, %class.Complex* %agg.result, i32 0, i32 1
- store double %add3, double* %im.i.i, align 4
+ store double %add, ptr %agg.result, align 4
+ %im.i.i = getelementptr inbounds %class.Complex, ptr %agg.result, i32 0, i32 1
+ store double %add3, ptr %im.i.i, align 4
ret void
}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/bad-reduction.ll b/llvm/test/Transforms/SLPVectorizer/X86/bad-reduction.ll
index 6ac69951291de..91a920b27e73c 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/bad-reduction.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/bad-reduction.ll
@@ -5,24 +5,23 @@
; https://bugs.llvm.org/show_bug.cgi?id=43146
-define i64 @load_bswap(%v8i8* %p) {
+define i64 @load_bswap(ptr %p) {
; CHECK-LABEL: @load_bswap(
-; CHECK-NEXT: [[G0:%.*]] = getelementptr inbounds [[V8I8:%.*]], %v8i8* [[P:%.*]], i64 0, i32 0
-; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 1
-; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 2
-; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 3
-; CHECK-NEXT: [[G4:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 4
-; CHECK-NEXT: [[G5:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 5
-; CHECK-NEXT: [[G6:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 6
-; CHECK-NEXT: [[G7:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 7
-; CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[G0]], align 1
-; CHECK-NEXT: [[T1:%.*]] = load i8, i8* [[G1]], align 1
-; CHECK-NEXT: [[T2:%.*]] = load i8, i8* [[G2]], align 1
-; CHECK-NEXT: [[T3:%.*]] = load i8, i8* [[G3]], align 1
-; CHECK-NEXT: [[T4:%.*]] = load i8, i8* [[G4]], align 1
-; CHECK-NEXT: [[T5:%.*]] = load i8, i8* [[G5]], align 1
-; CHECK-NEXT: [[T6:%.*]] = load i8, i8* [[G6]], align 1
-; CHECK-NEXT: [[T7:%.*]] = load i8, i8* [[G7]], align 1
+; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds [[V8I8:%.*]], ptr [[P:%.*]], i64 0, i32 1
+; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 2
+; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 3
+; CHECK-NEXT: [[G4:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 4
+; CHECK-NEXT: [[G5:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 5
+; CHECK-NEXT: [[G6:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 6
+; CHECK-NEXT: [[G7:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 7
+; CHECK-NEXT: [[T0:%.*]] = load i8, ptr [[P]], align 1
+; CHECK-NEXT: [[T1:%.*]] = load i8, ptr [[G1]], align 1
+; CHECK-NEXT: [[T2:%.*]] = load i8, ptr [[G2]], align 1
+; CHECK-NEXT: [[T3:%.*]] = load i8, ptr [[G3]], align 1
+; CHECK-NEXT: [[T4:%.*]] = load i8, ptr [[G4]], align 1
+; CHECK-NEXT: [[T5:%.*]] = load i8, ptr [[G5]], align 1
+; CHECK-NEXT: [[T6:%.*]] = load i8, ptr [[G6]], align 1
+; CHECK-NEXT: [[T7:%.*]] = load i8, ptr [[G7]], align 1
; CHECK-NEXT: [[Z0:%.*]] = zext i8 [[T0]] to i64
; CHECK-NEXT: [[Z1:%.*]] = zext i8 [[T1]] to i64
; CHECK-NEXT: [[Z2:%.*]] = zext i8 [[T2]] to i64
@@ -47,23 +46,22 @@ define i64 @load_bswap(%v8i8* %p) {
; CHECK-NEXT: [[OR01234567:%.*]] = or i64 [[OR0123456]], [[Z7]]
; CHECK-NEXT: ret i64 [[OR01234567]]
;
- %g0 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 0
- %g1 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 1
- %g2 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 2
- %g3 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 3
- %g4 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 4
- %g5 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 5
- %g6 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 6
- %g7 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 7
+ %g1 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 1
+ %g2 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 2
+ %g3 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 3
+ %g4 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 4
+ %g5 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 5
+ %g6 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 6
+ %g7 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 7
- %t0 = load i8, i8* %g0
- %t1 = load i8, i8* %g1
- %t2 = load i8, i8* %g2
- %t3 = load i8, i8* %g3
- %t4 = load i8, i8* %g4
- %t5 = load i8, i8* %g5
- %t6 = load i8, i8* %g6
- %t7 = load i8, i8* %g7
+ %t0 = load i8, ptr %p
+ %t1 = load i8, ptr %g1
+ %t2 = load i8, ptr %g2
+ %t3 = load i8, ptr %g3
+ %t4 = load i8, ptr %g4
+ %t5 = load i8, ptr %g5
+ %t6 = load i8, ptr %g6
+ %t7 = load i8, ptr %g7
%z0 = zext i8 %t0 to i64
%z1 = zext i8 %t1 to i64
@@ -93,24 +91,23 @@ define i64 @load_bswap(%v8i8* %p) {
ret i64 %or01234567
}
-define i64 @load_bswap_nop_shift(%v8i8* %p) {
+define i64 @load_bswap_nop_shift(ptr %p) {
; CHECK-LABEL: @load_bswap_nop_shift(
-; CHECK-NEXT: [[G0:%.*]] = getelementptr inbounds [[V8I8:%.*]], %v8i8* [[P:%.*]], i64 0, i32 0
-; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 1
-; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 2
-; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 3
-; CHECK-NEXT: [[G4:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 4
-; CHECK-NEXT: [[G5:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 5
-; CHECK-NEXT: [[G6:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 6
-; CHECK-NEXT: [[G7:%.*]] = getelementptr inbounds [[V8I8]], %v8i8* [[P]], i64 0, i32 7
-; CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[G0]], align 1
-; CHECK-NEXT: [[T1:%.*]] = load i8, i8* [[G1]], align 1
-; CHECK-NEXT: [[T2:%.*]] = load i8, i8* [[G2]], align 1
-; CHECK-NEXT: [[T3:%.*]] = load i8, i8* [[G3]], align 1
-; CHECK-NEXT: [[T4:%.*]] = load i8, i8* [[G4]], align 1
-; CHECK-NEXT: [[T5:%.*]] = load i8, i8* [[G5]], align 1
-; CHECK-NEXT: [[T6:%.*]] = load i8, i8* [[G6]], align 1
-; CHECK-NEXT: [[T7:%.*]] = load i8, i8* [[G7]], align 1
+; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds [[V8I8:%.*]], ptr [[P:%.*]], i64 0, i32 1
+; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 2
+; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 3
+; CHECK-NEXT: [[G4:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 4
+; CHECK-NEXT: [[G5:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 5
+; CHECK-NEXT: [[G6:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 6
+; CHECK-NEXT: [[G7:%.*]] = getelementptr inbounds [[V8I8]], ptr [[P]], i64 0, i32 7
+; CHECK-NEXT: [[T0:%.*]] = load i8, ptr [[P]], align 1
+; CHECK-NEXT: [[T1:%.*]] = load i8, ptr [[G1]], align 1
+; CHECK-NEXT: [[T2:%.*]] = load i8, ptr [[G2]], align 1
+; CHECK-NEXT: [[T3:%.*]] = load i8, ptr [[G3]], align 1
+; CHECK-NEXT: [[T4:%.*]] = load i8, ptr [[G4]], align 1
+; CHECK-NEXT: [[T5:%.*]] = load i8, ptr [[G5]], align 1
+; CHECK-NEXT: [[T6:%.*]] = load i8, ptr [[G6]], align 1
+; CHECK-NEXT: [[T7:%.*]] = load i8, ptr [[G7]], align 1
; CHECK-NEXT: [[Z0:%.*]] = zext i8 [[T0]] to i64
; CHECK-NEXT: [[Z1:%.*]] = zext i8 [[T1]] to i64
; CHECK-NEXT: [[Z2:%.*]] = zext i8 [[T2]] to i64
@@ -136,23 +133,22 @@ define i64 @load_bswap_nop_shift(%v8i8* %p) {
; CHECK-NEXT: [[OR01234567:%.*]] = or i64 [[OR0123456]], [[SH7]]
; CHECK-NEXT: ret i64 [[OR01234567]]
;
- %g0 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 0
- %g1 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 1
- %g2 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 2
- %g3 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 3
- %g4 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 4
- %g5 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 5
- %g6 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 6
- %g7 = getelementptr inbounds %v8i8, %v8i8* %p, i64 0, i32 7
+ %g1 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 1
+ %g2 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 2
+ %g3 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 3
+ %g4 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 4
+ %g5 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 5
+ %g6 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 6
+ %g7 = getelementptr inbounds %v8i8, ptr %p, i64 0, i32 7
- %t0 = load i8, i8* %g0
- %t1 = load i8, i8* %g1
- %t2 = load i8, i8* %g2
- %t3 = load i8, i8* %g3
- %t4 = load i8, i8* %g4
- %t5 = load i8, i8* %g5
- %t6 = load i8, i8* %g6
- %t7 = load i8, i8* %g7
+ %t0 = load i8, ptr %p
+ %t1 = load i8, ptr %g1
+ %t2 = load i8, ptr %g2
+ %t3 = load i8, ptr %g3
+ %t4 = load i8, ptr %g4
+ %t5 = load i8, ptr %g5
+ %t6 = load i8, ptr %g6
+ %t7 = load i8, ptr %g7
%z0 = zext i8 %t0 to i64
%z1 = zext i8 %t1 to i64
@@ -184,23 +180,23 @@ define i64 @load_bswap_nop_shift(%v8i8* %p) {
; https://bugs.llvm.org/show_bug.cgi?id=42708
-define i64 @load64le(i8* %arg) {
+define i64 @load64le(ptr %arg) {
; CHECK-LABEL: @load64le(
-; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds i8, i8* [[ARG:%.*]], i64 1
-; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 2
-; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 3
-; CHECK-NEXT: [[G4:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 4
-; CHECK-NEXT: [[G5:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 5
-; CHECK-NEXT: [[G6:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 6
-; CHECK-NEXT: [[G7:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 7
-; CHECK-NEXT: [[LD0:%.*]] = load i8, i8* [[ARG]], align 1
-; CHECK-NEXT: [[LD1:%.*]] = load i8, i8* [[G1]], align 1
-; CHECK-NEXT: [[LD2:%.*]] = load i8, i8* [[G2]], align 1
-; CHECK-NEXT: [[LD3:%.*]] = load i8, i8* [[G3]], align 1
-; CHECK-NEXT: [[LD4:%.*]] = load i8, i8* [[G4]], align 1
-; CHECK-NEXT: [[LD5:%.*]] = load i8, i8* [[G5]], align 1
-; CHECK-NEXT: [[LD6:%.*]] = load i8, i8* [[G6]], align 1
-; CHECK-NEXT: [[LD7:%.*]] = load i8, i8* [[G7]], align 1
+; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds i8, ptr [[ARG:%.*]], i64 1
+; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 2
+; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 3
+; CHECK-NEXT: [[G4:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 4
+; CHECK-NEXT: [[G5:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 5
+; CHECK-NEXT: [[G6:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 6
+; CHECK-NEXT: [[G7:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 7
+; CHECK-NEXT: [[LD0:%.*]] = load i8, ptr [[ARG]], align 1
+; CHECK-NEXT: [[LD1:%.*]] = load i8, ptr [[G1]], align 1
+; CHECK-NEXT: [[LD2:%.*]] = load i8, ptr [[G2]], align 1
+; CHECK-NEXT: [[LD3:%.*]] = load i8, ptr [[G3]], align 1
+; CHECK-NEXT: [[LD4:%.*]] = load i8, ptr [[G4]], align 1
+; CHECK-NEXT: [[LD5:%.*]] = load i8, ptr [[G5]], align 1
+; CHECK-NEXT: [[LD6:%.*]] = load i8, ptr [[G6]], align 1
+; CHECK-NEXT: [[LD7:%.*]] = load i8, ptr [[G7]], align 1
; CHECK-NEXT: [[Z0:%.*]] = zext i8 [[LD0]] to i64
; CHECK-NEXT: [[Z1:%.*]] = zext i8 [[LD1]] to i64
; CHECK-NEXT: [[Z2:%.*]] = zext i8 [[LD2]] to i64
@@ -225,22 +221,22 @@ define i64 @load64le(i8* %arg) {
; CHECK-NEXT: [[O7:%.*]] = or i64 [[O6]], [[S7]]
; CHECK-NEXT: ret i64 [[O7]]
;
- %g1 = getelementptr inbounds i8, i8* %arg, i64 1
- %g2 = getelementptr inbounds i8, i8* %arg, i64 2
- %g3 = getelementptr inbounds i8, i8* %arg, i64 3
- %g4 = getelementptr inbounds i8, i8* %arg, i64 4
- %g5 = getelementptr inbounds i8, i8* %arg, i64 5
- %g6 = getelementptr inbounds i8, i8* %arg, i64 6
- %g7 = getelementptr inbounds i8, i8* %arg, i64 7
+ %g1 = getelementptr inbounds i8, ptr %arg, i64 1
+ %g2 = getelementptr inbounds i8, ptr %arg, i64 2
+ %g3 = getelementptr inbounds i8, ptr %arg, i64 3
+ %g4 = getelementptr inbounds i8, ptr %arg, i64 4
+ %g5 = getelementptr inbounds i8, ptr %arg, i64 5
+ %g6 = getelementptr inbounds i8, ptr %arg, i64 6
+ %g7 = getelementptr inbounds i8, ptr %arg, i64 7
- %ld0 = load i8, i8* %arg, align 1
- %ld1 = load i8, i8* %g1, align 1
- %ld2 = load i8, i8* %g2, align 1
- %ld3 = load i8, i8* %g3, align 1
- %ld4 = load i8, i8* %g4, align 1
- %ld5 = load i8, i8* %g5, align 1
- %ld6 = load i8, i8* %g6, align 1
- %ld7 = load i8, i8* %g7, align 1
+ %ld0 = load i8, ptr %arg, align 1
+ %ld1 = load i8, ptr %g1, align 1
+ %ld2 = load i8, ptr %g2, align 1
+ %ld3 = load i8, ptr %g3, align 1
+ %ld4 = load i8, ptr %g4, align 1
+ %ld5 = load i8, ptr %g5, align 1
+ %ld6 = load i8, ptr %g6, align 1
+ %ld7 = load i8, ptr %g7, align 1
%z0 = zext i8 %ld0 to i64
%z1 = zext i8 %ld1 to i64
@@ -270,23 +266,23 @@ define i64 @load64le(i8* %arg) {
ret i64 %o7
}
-define i64 @load64le_nop_shift(i8* %arg) {
+define i64 @load64le_nop_shift(ptr %arg) {
; CHECK-LABEL: @load64le_nop_shift(
-; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds i8, i8* [[ARG:%.*]], i64 1
-; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 2
-; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 3
-; CHECK-NEXT: [[G4:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 4
-; CHECK-NEXT: [[G5:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 5
-; CHECK-NEXT: [[G6:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 6
-; CHECK-NEXT: [[G7:%.*]] = getelementptr inbounds i8, i8* [[ARG]], i64 7
-; CHECK-NEXT: [[LD0:%.*]] = load i8, i8* [[ARG]], align 1
-; CHECK-NEXT: [[LD1:%.*]] = load i8, i8* [[G1]], align 1
-; CHECK-NEXT: [[LD2:%.*]] = load i8, i8* [[G2]], align 1
-; CHECK-NEXT: [[LD3:%.*]] = load i8, i8* [[G3]], align 1
-; CHECK-NEXT: [[LD4:%.*]] = load i8, i8* [[G4]], align 1
-; CHECK-NEXT: [[LD5:%.*]] = load i8, i8* [[G5]], align 1
-; CHECK-NEXT: [[LD6:%.*]] = load i8, i8* [[G6]], align 1
-; CHECK-NEXT: [[LD7:%.*]] = load i8, i8* [[G7]], align 1
+; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds i8, ptr [[ARG:%.*]], i64 1
+; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 2
+; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 3
+; CHECK-NEXT: [[G4:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 4
+; CHECK-NEXT: [[G5:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 5
+; CHECK-NEXT: [[G6:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 6
+; CHECK-NEXT: [[G7:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 7
+; CHECK-NEXT: [[LD0:%.*]] = load i8, ptr [[ARG]], align 1
+; CHECK-NEXT: [[LD1:%.*]] = load i8, ptr [[G1]], align 1
+; CHECK-NEXT: [[LD2:%.*]] = load i8, ptr [[G2]], align 1
+; CHECK-NEXT: [[LD3:%.*]] = load i8, ptr [[G3]], align 1
+; CHECK-NEXT: [[LD4:%.*]] = load i8, ptr [[G4]], align 1
+; CHECK-NEXT: [[LD5:%.*]] = load i8, ptr [[G5]], align 1
+; CHECK-NEXT: [[LD6:%.*]] = load i8, ptr [[G6]], align 1
+; CHECK-NEXT: [[LD7:%.*]] = load i8, ptr [[G7]], align 1
; CHECK-NEXT: [[Z0:%.*]] = zext i8 [[LD0]] to i64
; CHECK-NEXT: [[Z1:%.*]] = zext i8 [[LD1]] to i64
; CHECK-NEXT: [[Z2:%.*]] = zext i8 [[LD2]] to i64
@@ -312,22 +308,22 @@ define i64 @load64le_nop_shift(i8* %arg) {
; CHECK-NEXT: [[O7:%.*]] = or i64 [[O6]], [[S7]]
; CHECK-NEXT: ret i64 [[O7]]
;
- %g1 = getelementptr inbounds i8, i8* %arg, i64 1
- %g2 = getelementptr inbounds i8, i8* %arg, i64 2
- %g3 = getelementptr inbounds i8, i8* %arg, i64 3
- %g4 = getelementptr inbounds i8, i8* %arg, i64 4
- %g5 = getelementptr inbounds i8, i8* %arg, i64 5
- %g6 = getelementptr inbounds i8, i8* %arg, i64 6
- %g7 = getelementptr inbounds i8, i8* %arg, i64 7
+ %g1 = getelementptr inbounds i8, ptr %arg, i64 1
+ %g2 = getelementptr inbounds i8, ptr %arg, i64 2
+ %g3 = getelementptr inbounds i8, ptr %arg, i64 3
+ %g4 = getelementptr inbounds i8, ptr %arg, i64 4
+ %g5 = getelementptr inbounds i8, ptr %arg, i64 5
+ %g6 = getelementptr inbounds i8, ptr %arg, i64 6
+ %g7 = getelementptr inbounds i8, ptr %arg, i64 7
- %ld0 = load i8, i8* %arg, align 1
- %ld1 = load i8, i8* %g1, align 1
- %ld2 = load i8, i8* %g2, align 1
- %ld3 = load i8, i8* %g3, align 1
- %ld4 = load i8, i8* %g4, align 1
- %ld5 = load i8, i8* %g5, align 1
- %ld6 = load i8, i8* %g6, align 1
- %ld7 = load i8, i8* %g7, align 1
+ %ld0 = load i8, ptr %arg, align 1
+ %ld1 = load i8, ptr %g1, align 1
+ %ld2 = load i8, ptr %g2, align 1
+ %ld3 = load i8, ptr %g3, align 1
+ %ld4 = load i8, ptr %g4, align 1
+ %ld5 = load i8, ptr %g5, align 1
+ %ld6 = load i8, ptr %g6, align 1
+ %ld7 = load i8, ptr %g7, align 1
%z0 = zext i8 %ld0 to i64
%z1 = zext i8 %ld1 to i64
@@ -357,42 +353,42 @@ define i64 @load64le_nop_shift(i8* %arg) {
ret i64 %o7
}
-define void @PR39538(i8* %t0, i32* %t1) {
+define void @PR39538(ptr %t0, ptr %t1) {
; CHECK-LABEL: @PR39538(
-; CHECK-NEXT: [[T6:%.*]] = getelementptr inbounds i8, i8* [[T0:%.*]], i64 1
-; CHECK-NEXT: [[T11:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 2
-; CHECK-NEXT: [[T16:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 3
-; CHECK-NEXT: [[T20:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 4
-; CHECK-NEXT: [[T24:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 5
-; CHECK-NEXT: [[T29:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 6
-; CHECK-NEXT: [[T34:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 7
-; CHECK-NEXT: [[T39:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 8
-; CHECK-NEXT: [[T43:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 9
-; CHECK-NEXT: [[T48:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 10
-; CHECK-NEXT: [[T53:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 11
-; CHECK-NEXT: [[T58:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 12
-; CHECK-NEXT: [[T62:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 13
-; CHECK-NEXT: [[T67:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 14
-; CHECK-NEXT: [[T72:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 15
-; CHECK-NEXT: [[T38:%.*]] = getelementptr inbounds i32, i32* [[T1:%.*]], i64 1
-; CHECK-NEXT: [[T57:%.*]] = getelementptr inbounds i32, i32* [[T1]], i64 2
-; CHECK-NEXT: [[T76:%.*]] = getelementptr inbounds i32, i32* [[T1]], i64 3
-; CHECK-NEXT: [[T3:%.*]] = load i8, i8* [[T0]], align 1
-; CHECK-NEXT: [[T7:%.*]] = load i8, i8* [[T6]], align 1
-; CHECK-NEXT: [[T12:%.*]] = load i8, i8* [[T11]], align 1
-; CHECK-NEXT: [[T17:%.*]] = load i8, i8* [[T16]], align 1
-; CHECK-NEXT: [[T21:%.*]] = load i8, i8* [[T20]], align 1
-; CHECK-NEXT: [[T25:%.*]] = load i8, i8* [[T24]], align 1
-; CHECK-NEXT: [[T30:%.*]] = load i8, i8* [[T29]], align 1
-; CHECK-NEXT: [[T35:%.*]] = load i8, i8* [[T34]], align 1
-; CHECK-NEXT: [[T40:%.*]] = load i8, i8* [[T39]], align 1
-; CHECK-NEXT: [[T44:%.*]] = load i8, i8* [[T43]], align 1
-; CHECK-NEXT: [[T49:%.*]] = load i8, i8* [[T48]], align 1
-; CHECK-NEXT: [[T54:%.*]] = load i8, i8* [[T53]], align 1
-; CHECK-NEXT: [[T59:%.*]] = load i8, i8* [[T58]], align 1
-; CHECK-NEXT: [[T63:%.*]] = load i8, i8* [[T62]], align 1
-; CHECK-NEXT: [[T68:%.*]] = load i8, i8* [[T67]], align 1
-; CHECK-NEXT: [[T73:%.*]] = load i8, i8* [[T72]], align 1
+; CHECK-NEXT: [[T6:%.*]] = getelementptr inbounds i8, ptr [[T0:%.*]], i64 1
+; CHECK-NEXT: [[T11:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 2
+; CHECK-NEXT: [[T16:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 3
+; CHECK-NEXT: [[T20:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 4
+; CHECK-NEXT: [[T24:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 5
+; CHECK-NEXT: [[T29:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 6
+; CHECK-NEXT: [[T34:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 7
+; CHECK-NEXT: [[T39:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 8
+; CHECK-NEXT: [[T43:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 9
+; CHECK-NEXT: [[T48:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 10
+; CHECK-NEXT: [[T53:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 11
+; CHECK-NEXT: [[T58:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 12
+; CHECK-NEXT: [[T62:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 13
+; CHECK-NEXT: [[T67:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 14
+; CHECK-NEXT: [[T72:%.*]] = getelementptr inbounds i8, ptr [[T0]], i64 15
+; CHECK-NEXT: [[T38:%.*]] = getelementptr inbounds i32, ptr [[T1:%.*]], i64 1
+; CHECK-NEXT: [[T57:%.*]] = getelementptr inbounds i32, ptr [[T1]], i64 2
+; CHECK-NEXT: [[T76:%.*]] = getelementptr inbounds i32, ptr [[T1]], i64 3
+; CHECK-NEXT: [[T3:%.*]] = load i8, ptr [[T0]], align 1
+; CHECK-NEXT: [[T7:%.*]] = load i8, ptr [[T6]], align 1
+; CHECK-NEXT: [[T12:%.*]] = load i8, ptr [[T11]], align 1
+; CHECK-NEXT: [[T17:%.*]] = load i8, ptr [[T16]], align 1
+; CHECK-NEXT: [[T21:%.*]] = load i8, ptr [[T20]], align 1
+; CHECK-NEXT: [[T25:%.*]] = load i8, ptr [[T24]], align 1
+; CHECK-NEXT: [[T30:%.*]] = load i8, ptr [[T29]], align 1
+; CHECK-NEXT: [[T35:%.*]] = load i8, ptr [[T34]], align 1
+; CHECK-NEXT: [[T40:%.*]] = load i8, ptr [[T39]], align 1
+; CHECK-NEXT: [[T44:%.*]] = load i8, ptr [[T43]], align 1
+; CHECK-NEXT: [[T49:%.*]] = load i8, ptr [[T48]], align 1
+; CHECK-NEXT: [[T54:%.*]] = load i8, ptr [[T53]], align 1
+; CHECK-NEXT: [[T59:%.*]] = load i8, ptr [[T58]], align 1
+; CHECK-NEXT: [[T63:%.*]] = load i8, ptr [[T62]], align 1
+; CHECK-NEXT: [[T68:%.*]] = load i8, ptr [[T67]], align 1
+; CHECK-NEXT: [[T73:%.*]] = load i8, ptr [[T72]], align 1
; CHECK-NEXT: [[T4:%.*]] = zext i8 [[T3]] to i32
; CHECK-NEXT: [[T8:%.*]] = zext i8 [[T7]] to i32
; CHECK-NEXT: [[T13:%.*]] = zext i8 [[T12]] to i32
@@ -433,46 +429,46 @@ define void @PR39538(i8* %t0, i32* %t1) {
; CHECK-NEXT: [[T66:%.*]] = or i32 [[T65]], [[T61]]
; CHECK-NEXT: [[T71:%.*]] = or i32 [[T66]], [[T70]]
; CHECK-NEXT: [[T75:%.*]] = or i32 [[T71]], [[T74]]
-; CHECK-NEXT: store i32 [[T19]], i32* [[T1]], align 4
-; CHECK-NEXT: store i32 [[T37]], i32* [[T38]], align 4
-; CHECK-NEXT: store i32 [[T56]], i32* [[T57]], align 4
-; CHECK-NEXT: store i32 [[T75]], i32* [[T76]], align 4
+; CHECK-NEXT: store i32 [[T19]], ptr [[T1]], align 4
+; CHECK-NEXT: store i32 [[T37]], ptr [[T38]], align 4
+; CHECK-NEXT: store i32 [[T56]], ptr [[T57]], align 4
+; CHECK-NEXT: store i32 [[T75]], ptr [[T76]], align 4
; CHECK-NEXT: ret void
;
- %t6 = getelementptr inbounds i8, i8* %t0, i64 1
- %t11 = getelementptr inbounds i8, i8* %t0, i64 2
- %t16 = getelementptr inbounds i8, i8* %t0, i64 3
- %t20 = getelementptr inbounds i8, i8* %t0, i64 4
- %t24 = getelementptr inbounds i8, i8* %t0, i64 5
- %t29 = getelementptr inbounds i8, i8* %t0, i64 6
- %t34 = getelementptr inbounds i8, i8* %t0, i64 7
- %t39 = getelementptr inbounds i8, i8* %t0, i64 8
- %t43 = getelementptr inbounds i8, i8* %t0, i64 9
- %t48 = getelementptr inbounds i8, i8* %t0, i64 10
- %t53 = getelementptr inbounds i8, i8* %t0, i64 11
- %t58 = getelementptr inbounds i8, i8* %t0, i64 12
- %t62 = getelementptr inbounds i8, i8* %t0, i64 13
- %t67 = getelementptr inbounds i8, i8* %t0, i64 14
- %t72 = getelementptr inbounds i8, i8* %t0, i64 15
- %t38 = getelementptr inbounds i32, i32* %t1, i64 1
- %t57 = getelementptr inbounds i32, i32* %t1, i64 2
- %t76 = getelementptr inbounds i32, i32* %t1, i64 3
- %t3 = load i8, i8* %t0, align 1
- %t7 = load i8, i8* %t6, align 1
- %t12 = load i8, i8* %t11, align 1
- %t17 = load i8, i8* %t16, align 1
- %t21 = load i8, i8* %t20, align 1
- %t25 = load i8, i8* %t24, align 1
- %t30 = load i8, i8* %t29, align 1
- %t35 = load i8, i8* %t34, align 1
- %t40 = load i8, i8* %t39, align 1
- %t44 = load i8, i8* %t43, align 1
- %t49 = load i8, i8* %t48, align 1
- %t54 = load i8, i8* %t53, align 1
- %t59 = load i8, i8* %t58, align 1
- %t63 = load i8, i8* %t62, align 1
- %t68 = load i8, i8* %t67, align 1
- %t73 = load i8, i8* %t72, align 1
+ %t6 = getelementptr inbounds i8, ptr %t0, i64 1
+ %t11 = getelementptr inbounds i8, ptr %t0, i64 2
+ %t16 = getelementptr inbounds i8, ptr %t0, i64 3
+ %t20 = getelementptr inbounds i8, ptr %t0, i64 4
+ %t24 = getelementptr inbounds i8, ptr %t0, i64 5
+ %t29 = getelementptr inbounds i8, ptr %t0, i64 6
+ %t34 = getelementptr inbounds i8, ptr %t0, i64 7
+ %t39 = getelementptr inbounds i8, ptr %t0, i64 8
+ %t43 = getelementptr inbounds i8, ptr %t0, i64 9
+ %t48 = getelementptr inbounds i8, ptr %t0, i64 10
+ %t53 = getelementptr inbounds i8, ptr %t0, i64 11
+ %t58 = getelementptr inbounds i8, ptr %t0, i64 12
+ %t62 = getelementptr inbounds i8, ptr %t0, i64 13
+ %t67 = getelementptr inbounds i8, ptr %t0, i64 14
+ %t72 = getelementptr inbounds i8, ptr %t0, i64 15
+ %t38 = getelementptr inbounds i32, ptr %t1, i64 1
+ %t57 = getelementptr inbounds i32, ptr %t1, i64 2
+ %t76 = getelementptr inbounds i32, ptr %t1, i64 3
+ %t3 = load i8, ptr %t0, align 1
+ %t7 = load i8, ptr %t6, align 1
+ %t12 = load i8, ptr %t11, align 1
+ %t17 = load i8, ptr %t16, align 1
+ %t21 = load i8, ptr %t20, align 1
+ %t25 = load i8, ptr %t24, align 1
+ %t30 = load i8, ptr %t29, align 1
+ %t35 = load i8, ptr %t34, align 1
+ %t40 = load i8, ptr %t39, align 1
+ %t44 = load i8, ptr %t43, align 1
+ %t49 = load i8, ptr %t48, align 1
+ %t54 = load i8, ptr %t53, align 1
+ %t59 = load i8, ptr %t58, align 1
+ %t63 = load i8, ptr %t62, align 1
+ %t68 = load i8, ptr %t67, align 1
+ %t73 = load i8, ptr %t72, align 1
%t4 = zext i8 %t3 to i32
%t8 = zext i8 %t7 to i32
%t13 = zext i8 %t12 to i32
@@ -513,10 +509,10 @@ define void @PR39538(i8* %t0, i32* %t1) {
%t66 = or i32 %t65, %t61
%t71 = or i32 %t66, %t70
%t75 = or i32 %t71, %t74
- store i32 %t19, i32* %t1, align 4
- store i32 %t37, i32* %t38, align 4
- store i32 %t56, i32* %t57, align 4
- store i32 %t75, i32* %t76, align 4
+ store i32 %t19, ptr %t1, align 4
+ store i32 %t37, ptr %t38, align 4
+ store i32 %t56, ptr %t57, align 4
+ store i32 %t75, ptr %t76, align 4
ret void
}
@@ -525,37 +521,37 @@ define void @PR39538(i8* %t0, i32* %t1) {
@g1 = external dso_local unnamed_addr constant [8 x i8], align 1
@g2 = external dso_local unnamed_addr constant [5 x i8], align 1
-define void @load_combine_constant_expression(i64* %t1) {
+define void @load_combine_constant_expression(ptr %t1) {
; CHECK-LABEL: @load_combine_constant_expression(
-; CHECK-NEXT: store i64 or (i64 shl (i64 zext (i32 ptrtoint ([8 x i8]* @g1 to i32) to i64), i64 32), i64 zext (i32 ptrtoint ([5 x i8]* @g2 to i32) to i64)), i64* [[T1:%.*]], align 4
-; CHECK-NEXT: [[T3:%.*]] = getelementptr i64, i64* [[T1]], i64 1
-; CHECK-NEXT: store i64 or (i64 shl (i64 zext (i32 ptrtoint ([8 x i8]* @g1 to i32) to i64), i64 32), i64 zext (i32 ptrtoint ([5 x i8]* @g2 to i32) to i64)), i64* [[T3]], align 4
+; CHECK-NEXT: store i64 or (i64 shl (i64 zext (i32 ptrtoint (ptr @g1 to i32) to i64), i64 32), i64 zext (i32 ptrtoint (ptr @g2 to i32) to i64)), ptr [[T1:%.*]], align 4
+; CHECK-NEXT: [[T3:%.*]] = getelementptr i64, ptr [[T1]], i64 1
+; CHECK-NEXT: store i64 or (i64 shl (i64 zext (i32 ptrtoint (ptr @g1 to i32) to i64), i64 32), i64 zext (i32 ptrtoint (ptr @g2 to i32) to i64)), ptr [[T3]], align 4
; CHECK-NEXT: ret void
;
- store i64 or (i64 shl (i64 zext (i32 ptrtoint ([8 x i8]* @g1 to i32) to i64), i64 32), i64 zext (i32 ptrtoint ([5 x i8]* @g2 to i32) to i64)), i64* %t1, align 4
- %t3 = getelementptr i64, i64* %t1, i64 1
- store i64 or (i64 shl (i64 zext (i32 ptrtoint ([8 x i8]* @g1 to i32) to i64), i64 32), i64 zext (i32 ptrtoint ([5 x i8]* @g2 to i32) to i64)), i64* %t3, align 4
+ store i64 or (i64 shl (i64 zext (i32 ptrtoint (ptr @g1 to i32) to i64), i64 32), i64 zext (i32 ptrtoint (ptr @g2 to i32) to i64)), ptr %t1, align 4
+ %t3 = getelementptr i64, ptr %t1, i64 1
+ store i64 or (i64 shl (i64 zext (i32 ptrtoint (ptr @g1 to i32) to i64), i64 32), i64 zext (i32 ptrtoint (ptr @g2 to i32) to i64)), ptr %t3, align 4
ret void
}
@output = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
-define void @PR47450(i16* nocapture readonly %p) {
+define void @PR47450(ptr nocapture readonly %p) {
; CHECK-LABEL: @PR47450(
-; CHECK-NEXT: [[X:%.*]] = load i16, i16* [[P:%.*]], align 2
+; CHECK-NEXT: [[X:%.*]] = load i16, ptr [[P:%.*]], align 2
; CHECK-NEXT: [[Z:%.*]] = zext i16 [[X]] to i32
; CHECK-NEXT: [[S:%.*]] = shl nuw nsw i32 [[Z]], 1
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> poison, i32 [[S]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: store <4 x i32> [[SHUFFLE]], <4 x i32>* bitcast ([8 x i32]* @output to <4 x i32>*), align 16
+; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: store <4 x i32> [[TMP2]], ptr @output, align 16
; CHECK-NEXT: ret void
;
- %x = load i16, i16* %p, align 2
+ %x = load i16, ptr %p, align 2
%z = zext i16 %x to i32
%s = shl nuw nsw i32 %z, 1
- store i32 %s, i32* getelementptr inbounds ([8 x i32], [8 x i32]* @output, i64 0, i64 0), align 16
- store i32 %s, i32* getelementptr inbounds ([8 x i32], [8 x i32]* @output, i64 0, i64 1), align 4
- store i32 %s, i32* getelementptr inbounds ([8 x i32], [8 x i32]* @output, i64 0, i64 2), align 8
- store i32 %s, i32* getelementptr inbounds ([8 x i32], [8 x i32]* @output, i64 0, i64 3), align 4
+ store i32 %s, ptr @output, align 16
+ store i32 %s, ptr getelementptr inbounds ([8 x i32], ptr @output, i64 0, i64 1), align 4
+ store i32 %s, ptr getelementptr inbounds ([8 x i32], ptr @output, i64 0, i64 2), align 8
+ store i32 %s, ptr getelementptr inbounds ([8 x i32], ptr @output, i64 0, i64 3), align 4
ret void
}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/combined-stores-chains.ll b/llvm/test/Transforms/SLPVectorizer/X86/combined-stores-chains.ll
index 5d92280dc2996..133e64e5bd00d 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/combined-stores-chains.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/combined-stores-chains.ll
@@ -1,70 +1,56 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-- -mcpu=corei7 | FileCheck %s
-define void @foo(i8* %v0, i8* readonly %v1) {
+define void @foo(ptr %v0, ptr readonly %v1) {
; CHECK-LABEL: @foo(
-; CHECK-NEXT: [[T0:%.*]] = bitcast i8* [[V0:%.*]] to i32*
-; CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[V1:%.*]] to i32*
-; CHECK-NEXT: [[T02:%.*]] = bitcast i8* [[V0]] to i64*
-; CHECK-NEXT: [[T12:%.*]] = bitcast i8* [[V1]] to i64*
-; CHECK-NEXT: [[T14:%.*]] = getelementptr inbounds i32, i32* [[T1]], i64 4
-; CHECK-NEXT: [[T142:%.*]] = getelementptr inbounds i64, i64* [[T12]], i64 8
-; CHECK-NEXT: [[T222:%.*]] = getelementptr inbounds i64, i64* [[T12]], i64 10
-; CHECK-NEXT: [[T21:%.*]] = getelementptr inbounds i32, i32* [[T0]], i64 4
-; CHECK-NEXT: [[T212:%.*]] = getelementptr inbounds i64, i64* [[T02]], i64 8
-; CHECK-NEXT: [[T292:%.*]] = getelementptr inbounds i64, i64* [[T02]], i64 10
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast i64* [[T142]] to <2 x i64>*
-; CHECK-NEXT: [[TMP2:%.*]] = load <2 x i64>, <2 x i64>* [[TMP1]], align 8
-; CHECK-NEXT: [[TMP3:%.*]] = add nsw <2 x i64> [[TMP2]], <i64 4, i64 4>
-; CHECK-NEXT: [[TMP4:%.*]] = bitcast i64* [[T212]] to <2 x i64>*
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast i64* [[T222]] to <2 x i64>*
-; CHECK-NEXT: [[TMP6:%.*]] = load <2 x i64>, <2 x i64>* [[TMP5]], align 8
-; CHECK-NEXT: [[TMP7:%.*]] = add nsw <2 x i64> [[TMP6]], <i64 6, i64 7>
-; CHECK-NEXT: [[TMP8:%.*]] = bitcast i64* [[T292]] to <2 x i64>*
-; CHECK-NEXT: [[TMP9:%.*]] = bitcast i32* [[T14]] to <4 x i32>*
-; CHECK-NEXT: [[TMP10:%.*]] = load <4 x i32>, <4 x i32>* [[TMP9]], align 4
-; CHECK-NEXT: [[TMP11:%.*]] = add nsw <4 x i32> [[TMP10]], <i32 4, i32 4, i32 6, i32 7>
-; CHECK-NEXT: store <2 x i64> [[TMP3]], <2 x i64>* [[TMP4]], align 8
-; CHECK-NEXT: store <2 x i64> [[TMP7]], <2 x i64>* [[TMP8]], align 8
-; CHECK-NEXT: [[TMP12:%.*]] = bitcast i32* [[T21]] to <4 x i32>*
-; CHECK-NEXT: store <4 x i32> [[TMP11]], <4 x i32>* [[TMP12]], align 4
+; CHECK-NEXT: [[T14:%.*]] = getelementptr inbounds i32, ptr [[V1:%.*]], i64 4
+; CHECK-NEXT: [[T142:%.*]] = getelementptr inbounds i64, ptr [[V1]], i64 8
+; CHECK-NEXT: [[T222:%.*]] = getelementptr inbounds i64, ptr [[V1]], i64 10
+; CHECK-NEXT: [[T21:%.*]] = getelementptr inbounds i32, ptr [[V0:%.*]], i64 4
+; CHECK-NEXT: [[T212:%.*]] = getelementptr inbounds i64, ptr [[V0]], i64 8
+; CHECK-NEXT: [[T292:%.*]] = getelementptr inbounds i64, ptr [[V0]], i64 10
+; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, ptr [[T14]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = add nsw <4 x i32> [[TMP1]], <i32 4, i32 4, i32 6, i32 7>
+; CHECK-NEXT: [[TMP3:%.*]] = load <2 x i64>, ptr [[T142]], align 8
+; CHECK-NEXT: [[TMP4:%.*]] = add nsw <2 x i64> [[TMP3]], <i64 4, i64 4>
+; CHECK-NEXT: [[TMP5:%.*]] = load <2 x i64>, ptr [[T222]], align 8
+; CHECK-NEXT: [[TMP6:%.*]] = add nsw <2 x i64> [[TMP5]], <i64 6, i64 7>
+; CHECK-NEXT: store <2 x i64> [[TMP4]], ptr [[T212]], align 8
+; CHECK-NEXT: store <2 x i64> [[TMP6]], ptr [[T292]], align 8
+; CHECK-NEXT: store <4 x i32> [[TMP2]], ptr [[T21]], align 4
; CHECK-NEXT: ret void
;
- %t0 = bitcast i8* %v0 to i32*
- %t1 = bitcast i8* %v1 to i32*
- %t02 = bitcast i8* %v0 to i64*
- %t12 = bitcast i8* %v1 to i64*
- %t14 = getelementptr inbounds i32, i32* %t1, i64 4
- %t18 = getelementptr inbounds i32, i32* %t1, i64 5
- %t22 = getelementptr inbounds i32, i32* %t1, i64 6
- %t26 = getelementptr inbounds i32, i32* %t1, i64 7
+ %t14 = getelementptr inbounds i32, ptr %v1, i64 4
+ %t18 = getelementptr inbounds i32, ptr %v1, i64 5
+ %t22 = getelementptr inbounds i32, ptr %v1, i64 6
+ %t26 = getelementptr inbounds i32, ptr %v1, i64 7
- %t142 = getelementptr inbounds i64, i64* %t12, i64 8
- %t182 = getelementptr inbounds i64, i64* %t12, i64 9
- %t222 = getelementptr inbounds i64, i64* %t12, i64 10
- %t262 = getelementptr inbounds i64, i64* %t12, i64 11
+ %t142 = getelementptr inbounds i64, ptr %v1, i64 8
+ %t182 = getelementptr inbounds i64, ptr %v1, i64 9
+ %t222 = getelementptr inbounds i64, ptr %v1, i64 10
+ %t262 = getelementptr inbounds i64, ptr %v1, i64 11
- %t21 = getelementptr inbounds i32, i32* %t0, i64 4
- %t25 = getelementptr inbounds i32, i32* %t0, i64 5
- %t29 = getelementptr inbounds i32, i32* %t0, i64 6
- %t32 = getelementptr inbounds i32, i32* %t0, i64 7
+ %t21 = getelementptr inbounds i32, ptr %v0, i64 4
+ %t25 = getelementptr inbounds i32, ptr %v0, i64 5
+ %t29 = getelementptr inbounds i32, ptr %v0, i64 6
+ %t32 = getelementptr inbounds i32, ptr %v0, i64 7
- %t212 = getelementptr inbounds i64, i64* %t02, i64 8
- %t252 = getelementptr inbounds i64, i64* %t02, i64 9
- %t292 = getelementptr inbounds i64, i64* %t02, i64 10
- %t322 = getelementptr inbounds i64, i64* %t02, i64 11
+ %t212 = getelementptr inbounds i64, ptr %v0, i64 8
+ %t252 = getelementptr inbounds i64, ptr %v0, i64 9
+ %t292 = getelementptr inbounds i64, ptr %v0, i64 10
+ %t322 = getelementptr inbounds i64, ptr %v0, i64 11
- %t19 = load i32, i32* %t14, align 4
- %t23 = load i32, i32* %t18, align 4
- %t27 = load i32, i32* %t22, align 4
- %t30 = load i32, i32* %t26, align 4
+ %t19 = load i32, ptr %t14, align 4
+ %t23 = load i32, ptr %t18, align 4
+ %t27 = load i32, ptr %t22, align 4
+ %t30 = load i32, ptr %t26, align 4
- %t192 = load i64, i64* %t142, align 8
- %t232 = load i64, i64* %t182, align 8
- %t272 = load i64, i64* %t222, align 8
- %t302 = load i64, i64* %t262, align 8
+ %t192 = load i64, ptr %t142, align 8
+ %t232 = load i64, ptr %t182, align 8
+ %t272 = load i64, ptr %t222, align 8
+ %t302 = load i64, ptr %t262, align 8
%t20 = add nsw i32 %t19, 4
%t24 = add nsw i32 %t23, 4
@@ -76,15 +62,15 @@ define void @foo(i8* %v0, i8* readonly %v1) {
%t282 = add nsw i64 %t272, 6
%t312 = add nsw i64 %t302, 7
- store i64 %t202, i64* %t212, align 8
- store i64 %t242, i64* %t252, align 8
- store i64 %t282, i64* %t292, align 8
- store i64 %t312, i64* %t322, align 8
+ store i64 %t202, ptr %t212, align 8
+ store i64 %t242, ptr %t252, align 8
+ store i64 %t282, ptr %t292, align 8
+ store i64 %t312, ptr %t322, align 8
- store i32 %t20, i32* %t21, align 4
- store i32 %t24, i32* %t25, align 4
- store i32 %t28, i32* %t29, align 4
- store i32 %t31, i32* %t32, align 4
+ store i32 %t20, ptr %t21, align 4
+ store i32 %t24, ptr %t25, align 4
+ store i32 %t28, ptr %t29, align 4
+ store i32 %t31, ptr %t32, align 4
ret void
}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll b/llvm/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll
index e1f30db3e3582..20e1b460af0ee 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll
@@ -90,19 +90,18 @@ for.end48: ; preds = %for.end44
%struct.hoge = type { double, double, double}
-define void @zot(%struct.hoge* %arg) {
+define void @zot(ptr %arg) {
; CHECK-LABEL: @zot(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT_HOGE:%.*]], %struct.hoge* [[ARG:%.*]], i64 0, i32 1
-; CHECK-NEXT: [[TMP:%.*]] = load double, double* undef, align 8
-; CHECK-NEXT: [[TMP2:%.*]] = load double, double* undef, align 8
+; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT_HOGE:%.*]], ptr [[ARG:%.*]], i64 0, i32 1
+; CHECK-NEXT: [[TMP:%.*]] = load double, ptr undef, align 8
+; CHECK-NEXT: [[TMP2:%.*]] = load double, ptr undef, align 8
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> poison, double [[TMP2]], i32 0
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> [[TMP0]], double [[TMP]], i32 1
; CHECK-NEXT: [[TMP2:%.*]] = fsub <2 x double> [[TMP1]], undef
; CHECK-NEXT: [[TMP3:%.*]] = fmul <2 x double> [[TMP2]], undef
; CHECK-NEXT: [[TMP4:%.*]] = fsub <2 x double> [[TMP3]], undef
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast double* [[TMP7]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP4]], <2 x double>* [[TMP5]], align 8
+; CHECK-NEXT: store <2 x double> [[TMP4]], ptr [[TMP7]], align 8
; CHECK-NEXT: br i1 undef, label [[BB11:%.*]], label [[BB12:%.*]]
; CHECK: bb11:
; CHECK-NEXT: br label [[BB14:%.*]]
@@ -112,19 +111,19 @@ define void @zot(%struct.hoge* %arg) {
; CHECK-NEXT: ret void
;
bb:
- %tmp = load double, double* undef, align 8
+ %tmp = load double, ptr undef, align 8
%tmp1 = fsub double %tmp, undef
- %tmp2 = load double, double* undef, align 8
+ %tmp2 = load double, ptr undef, align 8
%tmp3 = fsub double %tmp2, undef
%tmp4 = fmul double %tmp3, undef
%tmp5 = fmul double %tmp3, undef
%tmp6 = fsub double %tmp5, undef
- %tmp7 = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i64 0, i32 1
- store double %tmp6, double* %tmp7, align 8
+ %tmp7 = getelementptr inbounds %struct.hoge, ptr %arg, i64 0, i32 1
+ store double %tmp6, ptr %tmp7, align 8
%tmp8 = fmul double %tmp1, undef
%tmp9 = fsub double %tmp8, undef
- %tmp10 = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i64 0, i32 2
- store double %tmp9, double* %tmp10, align 8
+ %tmp10 = getelementptr inbounds %struct.hoge, ptr %arg, i64 0, i32 2
+ store double %tmp9, ptr %tmp10, align 8
br i1 undef, label %bb11, label %bb12
bb11: ; preds = %bb
@@ -141,11 +140,10 @@ bb14: ; preds = %bb12, %bb11
%struct.rc4_state.0.24 = type { i32, i32, [256 x i32] }
-define void @rc4_crypt(%struct.rc4_state.0.24* nocapture %s) {
+define void @rc4_crypt(ptr nocapture %s) {
; CHECK-LABEL: @rc4_crypt(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[X1:%.*]] = getelementptr inbounds [[STRUCT_RC4_STATE_0_24:%.*]], %struct.rc4_state.0.24* [[S:%.*]], i64 0, i32 0
-; CHECK-NEXT: [[Y2:%.*]] = getelementptr inbounds [[STRUCT_RC4_STATE_0_24]], %struct.rc4_state.0.24* [[S]], i64 0, i32 1
+; CHECK-NEXT: [[Y2:%.*]] = getelementptr inbounds [[STRUCT_RC4_STATE_0_24:%.*]], ptr [[S:%.*]], i64 0, i32 1
; CHECK-NEXT: br i1 undef, label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[CONV4:%.*]] = and i32 undef, 255
@@ -154,13 +152,12 @@ define void @rc4_crypt(%struct.rc4_state.0.24* nocapture %s) {
; CHECK: for.end:
; CHECK-NEXT: [[X_0_LCSSA:%.*]] = phi i32 [ undef, [[ENTRY:%.*]] ], [ [[CONV4]], [[FOR_BODY]] ]
; CHECK-NEXT: [[Y_0_LCSSA:%.*]] = phi i32 [ undef, [[ENTRY]] ], [ [[CONV7]], [[FOR_BODY]] ]
-; CHECK-NEXT: store i32 [[X_0_LCSSA]], i32* [[X1]], align 4
-; CHECK-NEXT: store i32 [[Y_0_LCSSA]], i32* [[Y2]], align 4
+; CHECK-NEXT: store i32 [[X_0_LCSSA]], ptr [[S]], align 4
+; CHECK-NEXT: store i32 [[Y_0_LCSSA]], ptr [[Y2]], align 4
; CHECK-NEXT: ret void
;
entry:
- %x1 = getelementptr inbounds %struct.rc4_state.0.24, %struct.rc4_state.0.24* %s, i64 0, i32 0
- %y2 = getelementptr inbounds %struct.rc4_state.0.24, %struct.rc4_state.0.24* %s, i64 0, i32 1
+ %y2 = getelementptr inbounds %struct.rc4_state.0.24, ptr %s, i64 0, i32 1
br i1 undef, label %for.body, label %for.end
for.body: ; preds = %for.body, %entry
@@ -173,8 +170,8 @@ for.body: ; preds = %for.body, %entry
for.end: ; preds = %for.body, %entry
%x.0.lcssa = phi i32 [ undef, %entry ], [ %conv4, %for.body ]
%y.0.lcssa = phi i32 [ undef, %entry ], [ %conv7, %for.body ]
- store i32 %x.0.lcssa, i32* %x1, align 4
- store i32 %y.0.lcssa, i32* %y2, align 4
+ store i32 %x.0.lcssa, ptr %s, align 4
+ store i32 %y.0.lcssa, ptr %y2, align 4
ret void
}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll b/llvm/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll
index a4e7426bc5f9c..4f601b2431219 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll
@@ -15,15 +15,15 @@ target triple = "x86_64-apple-macosx10.8.0"
define i32 @fn1() {
; CHECK-LABEL: @fn1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_DSTATE:%.*]], %struct.DState* @b, i32 0, i32 0), align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_DSTATE]], %struct.DState* @b, i32 0, i32 1), align 4
-; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* @d, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @b, align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr getelementptr inbounds ([[STRUCT_DSTATE:%.*]], ptr @b, i32 0, i32 1), align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr @d, align 4
; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[TMP2]], 0
; CHECK-NEXT: br i1 [[COND]], label [[SW_BB:%.*]], label [[SAVE_STATE_AND_RETURN:%.*]]
; CHECK: sw.bb:
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* @c, align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr @c, align 4
; CHECK-NEXT: [[AND:%.*]] = and i32 [[TMP3]], 7
-; CHECK-NEXT: store i32 [[AND]], i32* @a, align 4
+; CHECK-NEXT: store i32 [[AND]], ptr @a, align 4
; CHECK-NEXT: switch i32 [[AND]], label [[IF_END:%.*]] [
; CHECK-NEXT: i32 7, label [[SAVE_STATE_AND_RETURN]]
; CHECK-NEXT: i32 0, label [[SAVE_STATE_AND_RETURN]]
@@ -33,21 +33,21 @@ define i32 @fn1() {
; CHECK: save_state_and_return:
; CHECK-NEXT: [[T_0:%.*]] = phi i32 [ 0, [[IF_END]] ], [ [[TMP0]], [[ENTRY:%.*]] ], [ [[TMP0]], [[SW_BB]] ], [ [[TMP0]], [[SW_BB]] ]
; CHECK-NEXT: [[F_0:%.*]] = phi i32 [ 0, [[IF_END]] ], [ [[TMP1]], [[ENTRY]] ], [ 0, [[SW_BB]] ], [ 0, [[SW_BB]] ]
-; CHECK-NEXT: store i32 [[T_0]], i32* getelementptr inbounds ([[STRUCT_DSTATE]], %struct.DState* @b, i32 0, i32 0), align 4
-; CHECK-NEXT: store i32 [[F_0]], i32* getelementptr inbounds ([[STRUCT_DSTATE]], %struct.DState* @b, i32 0, i32 1), align 4
+; CHECK-NEXT: store i32 [[T_0]], ptr @b, align 4
+; CHECK-NEXT: store i32 [[F_0]], ptr getelementptr inbounds ([[STRUCT_DSTATE]], ptr @b, i32 0, i32 1), align 4
; CHECK-NEXT: ret i32 undef
;
entry:
- %0 = load i32, i32* getelementptr inbounds (%struct.DState, %struct.DState* @b, i32 0, i32 0), align 4
- %1 = load i32, i32* getelementptr inbounds (%struct.DState, %struct.DState* @b, i32 0, i32 1), align 4
- %2 = load i32, i32* @d, align 4
+ %0 = load i32, ptr @b, align 4
+ %1 = load i32, ptr getelementptr inbounds (%struct.DState, ptr @b, i32 0, i32 1), align 4
+ %2 = load i32, ptr @d, align 4
%cond = icmp eq i32 %2, 0
br i1 %cond, label %sw.bb, label %save_state_and_return
sw.bb: ; preds = %entry
- %3 = load i32, i32* @c, align 4
+ %3 = load i32, ptr @c, align 4
%and = and i32 %3, 7
- store i32 %and, i32* @a, align 4
+ store i32 %and, ptr @a, align 4
switch i32 %and, label %if.end [
i32 7, label %save_state_and_return
i32 0, label %save_state_and_return
@@ -59,8 +59,8 @@ if.end: ; preds = %sw.bb
save_state_and_return: ; preds = %sw.bb, %sw.bb, %if.end, %entry
%t.0 = phi i32 [ 0, %if.end ], [ %0, %entry ], [ %0, %sw.bb ], [ %0, %sw.bb ]
%f.0 = phi i32 [ 0, %if.end ], [ %1, %entry ], [ 0, %sw.bb ], [ 0, %sw.bb ]
- store i32 %t.0, i32* getelementptr inbounds (%struct.DState, %struct.DState* @b, i32 0, i32 0), align 4
- store i32 %f.0, i32* getelementptr inbounds (%struct.DState, %struct.DState* @b, i32 0, i32 1), align 4
+ store i32 %t.0, ptr @b, align 4
+ store i32 %f.0, ptr getelementptr inbounds (%struct.DState, ptr @b, i32 0, i32 1), align 4
ret i32 undef
}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll b/llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll
index 67b79860275c7..5b7935ba02c32 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll
@@ -19,8 +19,7 @@ define void @main() #0 {
; CHECK: invoke.cont:
; CHECK-NEXT: br i1 undef, label [[ARRAYCTOR_CONT:%.*]], label [[INVOKE_CONT]]
; CHECK: arrayctor.cont:
-; CHECK-NEXT: [[AGG_TMP99208_SROA_0_0_IDX:%.*]] = getelementptr inbounds [[STRUCT_RAY_5_11_53_113_119_137_149_185_329_389_416:%.*]], %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 0, i32 0
-; CHECK-NEXT: [[AGG_TMP101211_SROA_0_0_IDX:%.*]] = getelementptr inbounds [[STRUCT_RAY_5_11_53_113_119_137_149_185_329_389_416]], %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 1, i32 0
+; CHECK-NEXT: [[AGG_TMP101211_SROA_0_0_IDX:%.*]] = getelementptr inbounds [[STRUCT_RAY_5_11_53_113_119_137_149_185_329_389_416:%.*]], ptr undef, i64 0, i32 1, i32 0
; CHECK-NEXT: br label [[FOR_COND36_PREHEADER:%.*]]
; CHECK: for.cond36.preheader:
; CHECK-NEXT: br i1 undef, label [[FOR_BODY42_LR_PH_US:%.*]], label [[_Z5CLAMPD_EXIT_1:%.*]]
@@ -36,13 +35,11 @@ define void @main() #0 {
; CHECK-NEXT: [[TMP3:%.*]] = fadd <2 x double> [[TMP2]], <double 5.000000e+01, double 5.200000e+01>
; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x double> [[TMP1]], i32 0
; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
-; CHECK-NEXT: [[TMP6:%.*]] = bitcast double* [[AGG_TMP99208_SROA_0_0_IDX]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP3]], <2 x double>* [[TMP6]], align 8
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> <double poison, double undef>, double [[TMP4]], i32 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x double> <double undef, double poison>, double [[TMP5]], i32 1
-; CHECK-NEXT: [[TMP9:%.*]] = fmul <2 x double> [[TMP7]], [[TMP8]]
-; CHECK-NEXT: [[TMP10:%.*]] = bitcast double* [[AGG_TMP101211_SROA_0_0_IDX]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP9]], <2 x double>* [[TMP10]], align 8
+; CHECK-NEXT: store <2 x double> [[TMP3]], ptr undef, align 8
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> <double poison, double undef>, double [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> <double undef, double poison>, double [[TMP5]], i32 1
+; CHECK-NEXT: [[TMP8:%.*]] = fmul <2 x double> [[TMP6]], [[TMP7]]
+; CHECK-NEXT: store <2 x double> [[TMP8]], ptr [[AGG_TMP101211_SROA_0_0_IDX]], align 8
; CHECK-NEXT: unreachable
; CHECK: cond.true63.us:
; CHECK-NEXT: unreachable
@@ -64,10 +61,9 @@ invoke.cont: ; preds = %invoke.cont, %cond.
br i1 undef, label %arrayctor.cont, label %invoke.cont
arrayctor.cont: ; preds = %invoke.cont
- %agg.tmp99208.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 0, i32 0
- %agg.tmp99208.sroa.1.8.idx388 = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 0, i32 1
- %agg.tmp101211.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 1, i32 0
- %agg.tmp101211.sroa.1.8.idx390 = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 1, i32 1
+ %agg.tmp99208.sroa.1.8.idx388 = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, ptr undef, i64 0, i32 0, i32 1
+ %agg.tmp101211.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, ptr undef, i64 0, i32 1, i32 0
+ %agg.tmp101211.sroa.1.8.idx390 = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, ptr undef, i64 0, i32 1, i32 1
br label %for.cond36.preheader
for.cond36.preheader: ; preds = %_Z5clampd.exit.1, %arrayctor.cont
@@ -89,10 +85,10 @@ cond.false66.us: ; preds = %cond.true48.us
%add4.i246.us = fadd double %mul2.i256.us, 5.200000e+01
%mul.i.i.us = fmul double undef, %add.i264.us
%mul2.i.i.us = fmul double undef, %add4.i267.us
- store double %add.i243.us, double* %agg.tmp99208.sroa.0.0.idx, align 8
- store double %add4.i246.us, double* %agg.tmp99208.sroa.1.8.idx388, align 8
- store double %mul.i.i.us, double* %agg.tmp101211.sroa.0.0.idx, align 8
- store double %mul2.i.i.us, double* %agg.tmp101211.sroa.1.8.idx390, align 8
+ store double %add.i243.us, ptr undef, align 8
+ store double %add4.i246.us, ptr %agg.tmp99208.sroa.1.8.idx388, align 8
+ store double %mul.i.i.us, ptr %agg.tmp101211.sroa.0.0.idx, align 8
+ store double %mul2.i.i.us, ptr %agg.tmp101211.sroa.1.8.idx390, align 8
unreachable
cond.true63.us: ; preds = %cond.true48.us
@@ -114,7 +110,7 @@ define void @_Z8radianceRK3RayiPt() #0 {
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 undef, label [[IF_THEN78:%.*]], label [[IF_THEN38:%.*]]
; CHECK: if.then38:
-; CHECK-NEXT: [[AGG_TMP74663_SROA_0_0_IDX:%.*]] = getelementptr inbounds [[STRUCT_RAY_5_11_53_95_137_191_197_203_239_257_263_269_275_281_287_293_383_437_443_455_461_599_601:%.*]], %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601* undef, i64 0, i32 1, i32 0
+; CHECK-NEXT: [[AGG_TMP74663_SROA_0_0_IDX:%.*]] = getelementptr inbounds [[STRUCT_RAY_5_11_53_95_137_191_197_203_239_257_263_269_275_281_287_293_383_437_443_455_461_599_601:%.*]], ptr undef, i64 0, i32 1, i32 0
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> <double undef, double poison>, double undef, i32 1
; CHECK-NEXT: [[TMP1:%.*]] = fmul <2 x double> undef, [[TMP0]]
; CHECK-NEXT: [[TMP2:%.*]] = fsub <2 x double> undef, [[TMP1]]
@@ -123,8 +119,7 @@ define void @_Z8radianceRK3RayiPt() #0 {
; CHECK-NEXT: [[TMP5:%.*]] = fadd <2 x double> undef, [[TMP4]]
; CHECK-NEXT: [[TMP6:%.*]] = fadd <2 x double> undef, [[TMP5]]
; CHECK-NEXT: [[TMP7:%.*]] = fmul <2 x double> undef, [[TMP6]]
-; CHECK-NEXT: [[TMP8:%.*]] = bitcast double* [[AGG_TMP74663_SROA_0_0_IDX]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP7]], <2 x double>* [[TMP8]], align 8
+; CHECK-NEXT: store <2 x double> [[TMP7]], ptr [[AGG_TMP74663_SROA_0_0_IDX]], align 8
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.then78:
; CHECK-NEXT: br label [[RETURN]]
@@ -153,10 +148,10 @@ if.then38: ; preds = %entry
%add4.i698 = fadd double undef, %add4.i719
%mul.i.i679 = fmul double undef, %add.i695
%mul2.i.i680 = fmul double undef, %add4.i698
- %agg.tmp74663.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601, %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601* undef, i64 0, i32 1, i32 0
- store double %mul.i.i679, double* %agg.tmp74663.sroa.0.0.idx, align 8
- %agg.tmp74663.sroa.1.8.idx943 = getelementptr inbounds %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601, %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601* undef, i64 0, i32 1, i32 1
- store double %mul2.i.i680, double* %agg.tmp74663.sroa.1.8.idx943, align 8
+ %agg.tmp74663.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601, ptr undef, i64 0, i32 1, i32 0
+ store double %mul.i.i679, ptr %agg.tmp74663.sroa.0.0.idx, align 8
+ %agg.tmp74663.sroa.1.8.idx943 = getelementptr inbounds %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601, ptr undef, i64 0, i32 1, i32 1
+ store double %mul2.i.i680, ptr %agg.tmp74663.sroa.1.8.idx943, align 8
br label %return
if.then78: ; preds = %entry
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/cse.ll b/llvm/test/Transforms/SLPVectorizer/X86/cse.ll
index 3e7896b5b4f4e..16fabea041403 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/cse.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/cse.ll
@@ -4,176 +4,169 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"
target triple = "i386-apple-macosx10.8.0"
-;int test(double *G) {
-; G[0] = 1+G[5]*4;
-; G[1] = 6+G[6]*3;
-; G[2] = 7+G[5]*4;
-; G[3] = 8+G[6]*4;
+;int test(ptr G) {
+; G[0] = 1+Gptr4;
+; G[1] = 6+Gptr3;
+; G[2] = 7+Gptr4;
+; G[3] = 8+Gptr4;
;}
-define i32 @test(double* nocapture %G) {
+define i32 @test(ptr nocapture %G) {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds double, double* [[G:%.*]], i64 5
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast double* [[ARRAYIDX]] to <2 x double>*
-; CHECK-NEXT: [[TMP1:%.*]] = load <2 x double>, <2 x double>* [[TMP0]], align 8
-; CHECK-NEXT: [[TMP2:%.*]] = fmul <2 x double> [[TMP1]], <double 4.000000e+00, double 3.000000e+00>
-; CHECK-NEXT: [[TMP3:%.*]] = fadd <2 x double> [[TMP2]], <double 1.000000e+00, double 6.000000e+00>
-; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* [[G]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP3]], <2 x double>* [[TMP4]], align 8
-; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[TMP2]], i32 0
-; CHECK-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds double, double* [[G]], i64 2
-; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
-; CHECK-NEXT: [[MUL11:%.*]] = fmul double [[TMP6]], 4.000000e+00
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> poison, double [[TMP5]], i32 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x double> [[TMP7]], double [[MUL11]], i32 1
-; CHECK-NEXT: [[TMP9:%.*]] = fadd <2 x double> [[TMP8]], <double 7.000000e+00, double 8.000000e+00>
-; CHECK-NEXT: [[TMP10:%.*]] = bitcast double* [[ARRAYIDX9]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP9]], <2 x double>* [[TMP10]], align 8
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds double, ptr [[G:%.*]], i64 5
+; CHECK-NEXT: [[TMP0:%.*]] = load <2 x double>, ptr [[ARRAYIDX]], align 8
+; CHECK-NEXT: [[TMP1:%.*]] = fmul <2 x double> [[TMP0]], <double 4.000000e+00, double 3.000000e+00>
+; CHECK-NEXT: [[TMP2:%.*]] = fadd <2 x double> [[TMP1]], <double 1.000000e+00, double 6.000000e+00>
+; CHECK-NEXT: store <2 x double> [[TMP2]], ptr [[G]], align 8
+; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x double> [[TMP1]], i32 0
+; CHECK-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds double, ptr [[G]], i64 2
+; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x double> [[TMP0]], i32 1
+; CHECK-NEXT: [[MUL11:%.*]] = fmul double [[TMP4]], 4.000000e+00
+; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x double> poison, double [[TMP3]], i32 0
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> [[TMP5]], double [[MUL11]], i32 1
+; CHECK-NEXT: [[TMP7:%.*]] = fadd <2 x double> [[TMP6]], <double 7.000000e+00, double 8.000000e+00>
+; CHECK-NEXT: store <2 x double> [[TMP7]], ptr [[ARRAYIDX9]], align 8
; CHECK-NEXT: ret i32 undef
;
entry:
- %arrayidx = getelementptr inbounds double, double* %G, i64 5
- %0 = load double, double* %arrayidx, align 8
+ %arrayidx = getelementptr inbounds double, ptr %G, i64 5
+ %0 = load double, ptr %arrayidx, align 8
%mul = fmul double %0, 4.000000e+00
%add = fadd double %mul, 1.000000e+00
- store double %add, double* %G, align 8
- %arrayidx2 = getelementptr inbounds double, double* %G, i64 6
- %1 = load double, double* %arrayidx2, align 8
+ store double %add, ptr %G, align 8
+ %arrayidx2 = getelementptr inbounds double, ptr %G, i64 6
+ %1 = load double, ptr %arrayidx2, align 8
%mul3 = fmul double %1, 3.000000e+00
%add4 = fadd double %mul3, 6.000000e+00
- %arrayidx5 = getelementptr inbounds double, double* %G, i64 1
- store double %add4, double* %arrayidx5, align 8
+ %arrayidx5 = getelementptr inbounds double, ptr %G, i64 1
+ store double %add4, ptr %arrayidx5, align 8
%add8 = fadd double %mul, 7.000000e+00
- %arrayidx9 = getelementptr inbounds double, double* %G, i64 2
- store double %add8, double* %arrayidx9, align 8
+ %arrayidx9 = getelementptr inbounds double, ptr %G, i64 2
+ store double %add8, ptr %arrayidx9, align 8
%mul11 = fmul double %1, 4.000000e+00
%add12 = fadd double %mul11, 8.000000e+00
- %arrayidx13 = getelementptr inbounds double, double* %G, i64 3
- store double %add12, double* %arrayidx13, align 8
+ %arrayidx13 = getelementptr inbounds double, ptr %G, i64 3
+ store double %add12, ptr %arrayidx13, align 8
ret i32 undef
}
-;int foo(double *A, int n) {
-; A[0] = A[0] * 7.9 * n + 6.0;
-; A[1] = A[1] * 7.7 * n + 2.0;
-; A[2] = A[2] * 7.6 * n + 3.0;
-; A[3] = A[3] * 7.4 * n + 4.0;
+;int foo(ptr A, int n) {
+; A[0] = Aptr 7.9 * n + 6.0;
+; A[1] = Aptr 7.7 * n + 2.0;
+; A[2] = Aptr 7.6 * n + 3.0;
+; A[3] = Aptr 7.4 * n + 4.0;
;}
-define i32 @foo(double* nocapture %A, i32 %n) {
+define i32 @foo(ptr nocapture %A, i32 %n) {
; CHECK-LABEL: @foo(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV:%.*]] = sitofp i32 [[N:%.*]] to double
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast double* [[A:%.*]] to <4 x double>*
-; CHECK-NEXT: [[TMP1:%.*]] = load <4 x double>, <4 x double>* [[TMP0]], align 8
-; CHECK-NEXT: [[TMP2:%.*]] = fmul <4 x double> [[TMP1]], <double 7.900000e+00, double 7.700000e+00, double 7.600000e+00, double 7.400000e+00>
-; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x double> poison, double [[CONV]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[TMP3]], <4 x double> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: [[TMP4:%.*]] = fmul <4 x double> [[SHUFFLE]], [[TMP2]]
+; CHECK-NEXT: [[TMP0:%.*]] = load <4 x double>, ptr [[A:%.*]], align 8
+; CHECK-NEXT: [[TMP1:%.*]] = fmul <4 x double> [[TMP0]], <double 7.900000e+00, double 7.700000e+00, double 7.600000e+00, double 7.400000e+00>
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x double> poison, double [[CONV]], i32 0
+; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <4 x double> [[TMP2]], <4 x double> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP4:%.*]] = fmul <4 x double> [[TMP3]], [[TMP1]]
; CHECK-NEXT: [[TMP5:%.*]] = fadd <4 x double> [[TMP4]], <double 6.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00>
-; CHECK-NEXT: [[TMP6:%.*]] = bitcast double* [[A]] to <4 x double>*
-; CHECK-NEXT: store <4 x double> [[TMP5]], <4 x double>* [[TMP6]], align 8
+; CHECK-NEXT: store <4 x double> [[TMP5]], ptr [[A]], align 8
; CHECK-NEXT: ret i32 undef
;
entry:
- %0 = load double, double* %A, align 8
+ %0 = load double, ptr %A, align 8
%mul = fmul double %0, 7.900000e+00
%conv = sitofp i32 %n to double
%mul1 = fmul double %conv, %mul
%add = fadd double %mul1, 6.000000e+00
- store double %add, double* %A, align 8
- %arrayidx3 = getelementptr inbounds double, double* %A, i64 1
- %1 = load double, double* %arrayidx3, align 8
+ store double %add, ptr %A, align 8
+ %arrayidx3 = getelementptr inbounds double, ptr %A, i64 1
+ %1 = load double, ptr %arrayidx3, align 8
%mul4 = fmul double %1, 7.700000e+00
%mul6 = fmul double %conv, %mul4
%add7 = fadd double %mul6, 2.000000e+00
- store double %add7, double* %arrayidx3, align 8
- %arrayidx9 = getelementptr inbounds double, double* %A, i64 2
- %2 = load double, double* %arrayidx9, align 8
+ store double %add7, ptr %arrayidx3, align 8
+ %arrayidx9 = getelementptr inbounds double, ptr %A, i64 2
+ %2 = load double, ptr %arrayidx9, align 8
%mul10 = fmul double %2, 7.600000e+00
%mul12 = fmul double %conv, %mul10
%add13 = fadd double %mul12, 3.000000e+00
- store double %add13, double* %arrayidx9, align 8
- %arrayidx15 = getelementptr inbounds double, double* %A, i64 3
- %3 = load double, double* %arrayidx15, align 8
+ store double %add13, ptr %arrayidx9, align 8
+ %arrayidx15 = getelementptr inbounds double, ptr %A, i64 3
+ %3 = load double, ptr %arrayidx15, align 8
%mul16 = fmul double %3, 7.400000e+00
%mul18 = fmul double %conv, %mul16
%add19 = fadd double %mul18, 4.000000e+00
- store double %add19, double* %arrayidx15, align 8
+ store double %add19, ptr %arrayidx15, align 8
ret i32 undef
}
-; int test2(double *G, int k) {
+; int test2(ptr G, int k) {
; if (k) {
-; G[0] = 1+G[5]*4;
-; G[1] = 6+G[6]*3;
+; G[0] = 1+Gptr4;
+; G[1] = 6+Gptr3;
; } else {
-; G[2] = 7+G[5]*4;
-; G[3] = 8+G[6]*3;
+; G[2] = 7+Gptr4;
+; G[3] = 8+Gptr3;
; }
; }
; We can't merge the gather sequences because one does not dominate the other.
-define i32 @test2(double* nocapture %G, i32 %k) {
+define i32 @test2(ptr nocapture %G, i32 %k) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[K:%.*]], 0
-; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds double, double* [[G:%.*]], i64 5
-; CHECK-NEXT: [[TMP3:%.*]] = load double, double* [[TMP2]], align 8
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds double, ptr [[G:%.*]], i64 5
+; CHECK-NEXT: [[TMP3:%.*]] = load double, ptr [[TMP2]], align 8
; CHECK-NEXT: [[TMP4:%.*]] = fmul double [[TMP3]], 4.000000e+00
-; CHECK-NEXT: br i1 [[TMP1]], label [[TMP13:%.*]], label [[TMP5:%.*]]
+; CHECK-NEXT: br i1 [[TMP1]], label [[TMP12:%.*]], label [[TMP5:%.*]]
; CHECK: 5:
-; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds double, double* [[G]], i64 6
-; CHECK-NEXT: [[TMP7:%.*]] = load double, double* [[TMP6]], align 8
+; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds double, ptr [[G]], i64 6
+; CHECK-NEXT: [[TMP7:%.*]] = load double, ptr [[TMP6]], align 8
; CHECK-NEXT: [[TMP8:%.*]] = fmul double [[TMP7]], 3.000000e+00
; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x double> poison, double [[TMP4]], i32 0
; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x double> [[TMP9]], double [[TMP8]], i32 1
; CHECK-NEXT: [[TMP11:%.*]] = fadd <2 x double> [[TMP10]], <double 1.000000e+00, double 6.000000e+00>
-; CHECK-NEXT: [[TMP12:%.*]] = bitcast double* [[G]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP11]], <2 x double>* [[TMP12]], align 8
-; CHECK-NEXT: br label [[TMP22:%.*]]
-; CHECK: 13:
-; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds double, double* [[G]], i64 2
-; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds double, double* [[G]], i64 6
-; CHECK-NEXT: [[TMP16:%.*]] = load double, double* [[TMP15]], align 8
-; CHECK-NEXT: [[TMP17:%.*]] = fmul double [[TMP16]], 3.000000e+00
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x double> poison, double [[TMP4]], i32 0
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x double> [[TMP18]], double [[TMP17]], i32 1
-; CHECK-NEXT: [[TMP20:%.*]] = fadd <2 x double> [[TMP19]], <double 7.000000e+00, double 8.000000e+00>
-; CHECK-NEXT: [[TMP21:%.*]] = bitcast double* [[TMP14]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP20]], <2 x double>* [[TMP21]], align 8
-; CHECK-NEXT: br label [[TMP22]]
-; CHECK: 22:
+; CHECK-NEXT: store <2 x double> [[TMP11]], ptr [[G]], align 8
+; CHECK-NEXT: br label [[TMP20:%.*]]
+; CHECK: 12:
+; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds double, ptr [[G]], i64 2
+; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds double, ptr [[G]], i64 6
+; CHECK-NEXT: [[TMP15:%.*]] = load double, ptr [[TMP14]], align 8
+; CHECK-NEXT: [[TMP16:%.*]] = fmul double [[TMP15]], 3.000000e+00
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <2 x double> poison, double [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x double> [[TMP17]], double [[TMP16]], i32 1
+; CHECK-NEXT: [[TMP19:%.*]] = fadd <2 x double> [[TMP18]], <double 7.000000e+00, double 8.000000e+00>
+; CHECK-NEXT: store <2 x double> [[TMP19]], ptr [[TMP13]], align 8
+; CHECK-NEXT: br label [[TMP20]]
+; CHECK: 20:
; CHECK-NEXT: ret i32 undef
;
%1 = icmp eq i32 %k, 0
- %2 = getelementptr inbounds double, double* %G, i64 5
- %3 = load double, double* %2, align 8
+ %2 = getelementptr inbounds double, ptr %G, i64 5
+ %3 = load double, ptr %2, align 8
%4 = fmul double %3, 4.000000e+00
br i1 %1, label %12, label %5
; <label>:5 ; preds = %0
%6 = fadd double %4, 1.000000e+00
- store double %6, double* %G, align 8
- %7 = getelementptr inbounds double, double* %G, i64 6
- %8 = load double, double* %7, align 8
+ store double %6, ptr %G, align 8
+ %7 = getelementptr inbounds double, ptr %G, i64 6
+ %8 = load double, ptr %7, align 8
%9 = fmul double %8, 3.000000e+00
%10 = fadd double %9, 6.000000e+00
- %11 = getelementptr inbounds double, double* %G, i64 1
- store double %10, double* %11, align 8
+ %11 = getelementptr inbounds double, ptr %G, i64 1
+ store double %10, ptr %11, align 8
br label %20
; <label>:12 ; preds = %0
%13 = fadd double %4, 7.000000e+00
- %14 = getelementptr inbounds double, double* %G, i64 2
- store double %13, double* %14, align 8
- %15 = getelementptr inbounds double, double* %G, i64 6
- %16 = load double, double* %15, align 8
+ %14 = getelementptr inbounds double, ptr %G, i64 2
+ store double %13, ptr %14, align 8
+ %15 = getelementptr inbounds double, ptr %G, i64 6
+ %16 = load double, ptr %15, align 8
%17 = fmul double %16, 3.000000e+00
%18 = fadd double %17, 8.000000e+00
- %19 = getelementptr inbounds double, double* %G, i64 3
- store double %18, double* %19, align 8
+ %19 = getelementptr inbounds double, ptr %G, i64 3
+ store double %18, ptr %19, align 8
br label %20
; <label>:20 ; preds = %12, %5
@@ -181,114 +174,108 @@ define i32 @test2(double* nocapture %G, i32 %k) {
}
-;int foo(double *A, int n) {
-; A[0] = A[0] * 7.9 * n + 6.0;
-; A[1] = A[1] * 7.9 * n + 6.0;
-; A[2] = A[2] * 7.9 * n + 6.0;
-; A[3] = A[3] * 7.9 * n + 6.0;
+;int foo(ptr A, int n) {
+; A[0] = Aptr 7.9 * n + 6.0;
+; A[1] = Aptr 7.9 * n + 6.0;
+; A[2] = Aptr 7.9 * n + 6.0;
+; A[3] = Aptr 7.9 * n + 6.0;
;}
-define i32 @foo4(double* nocapture %A, i32 %n) {
+define i32 @foo4(ptr nocapture %A, i32 %n) {
; CHECK-LABEL: @foo4(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV:%.*]] = sitofp i32 [[N:%.*]] to double
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast double* [[A:%.*]] to <4 x double>*
-; CHECK-NEXT: [[TMP1:%.*]] = load <4 x double>, <4 x double>* [[TMP0]], align 8
-; CHECK-NEXT: [[TMP2:%.*]] = fmul <4 x double> [[TMP1]], <double 7.900000e+00, double 7.900000e+00, double 7.900000e+00, double 7.900000e+00>
-; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x double> poison, double [[CONV]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[TMP3]], <4 x double> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: [[TMP4:%.*]] = fmul <4 x double> [[SHUFFLE]], [[TMP2]]
+; CHECK-NEXT: [[TMP0:%.*]] = load <4 x double>, ptr [[A:%.*]], align 8
+; CHECK-NEXT: [[TMP1:%.*]] = fmul <4 x double> [[TMP0]], <double 7.900000e+00, double 7.900000e+00, double 7.900000e+00, double 7.900000e+00>
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x double> poison, double [[CONV]], i32 0
+; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <4 x double> [[TMP2]], <4 x double> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP4:%.*]] = fmul <4 x double> [[TMP3]], [[TMP1]]
; CHECK-NEXT: [[TMP5:%.*]] = fadd <4 x double> [[TMP4]], <double 6.000000e+00, double 6.000000e+00, double 6.000000e+00, double 6.000000e+00>
-; CHECK-NEXT: [[TMP6:%.*]] = bitcast double* [[A]] to <4 x double>*
-; CHECK-NEXT: store <4 x double> [[TMP5]], <4 x double>* [[TMP6]], align 8
+; CHECK-NEXT: store <4 x double> [[TMP5]], ptr [[A]], align 8
; CHECK-NEXT: ret i32 undef
;
entry:
- %0 = load double, double* %A, align 8
+ %0 = load double, ptr %A, align 8
%mul = fmul double %0, 7.900000e+00
%conv = sitofp i32 %n to double
%mul1 = fmul double %conv, %mul
%add = fadd double %mul1, 6.000000e+00
- store double %add, double* %A, align 8
- %arrayidx3 = getelementptr inbounds double, double* %A, i64 1
- %1 = load double, double* %arrayidx3, align 8
+ store double %add, ptr %A, align 8
+ %arrayidx3 = getelementptr inbounds double, ptr %A, i64 1
+ %1 = load double, ptr %arrayidx3, align 8
%mul4 = fmul double %1, 7.900000e+00
%mul6 = fmul double %conv, %mul4
%add7 = fadd double %mul6, 6.000000e+00
- store double %add7, double* %arrayidx3, align 8
- %arrayidx9 = getelementptr inbounds double, double* %A, i64 2
- %2 = load double, double* %arrayidx9, align 8
+ store double %add7, ptr %arrayidx3, align 8
+ %arrayidx9 = getelementptr inbounds double, ptr %A, i64 2
+ %2 = load double, ptr %arrayidx9, align 8
%mul10 = fmul double %2, 7.900000e+00
%mul12 = fmul double %conv, %mul10
%add13 = fadd double %mul12, 6.000000e+00
- store double %add13, double* %arrayidx9, align 8
- %arrayidx15 = getelementptr inbounds double, double* %A, i64 3
- %3 = load double, double* %arrayidx15, align 8
+ store double %add13, ptr %arrayidx9, align 8
+ %arrayidx15 = getelementptr inbounds double, ptr %A, i64 3
+ %3 = load double, ptr %arrayidx15, align 8
%mul16 = fmul double %3, 7.900000e+00
%mul18 = fmul double %conv, %mul16
%add19 = fadd double %mul18, 6.000000e+00
- store double %add19, double* %arrayidx15, align 8
+ store double %add19, ptr %arrayidx15, align 8
ret i32 undef
}
-;int partial_mrg(double *A, int n) {
-; A[0] = A[0] * n;
-; A[1] = A[1] * n;
+;int partial_mrg(ptr A, int n) {
+; A[0] = Aptr n;
+; A[1] = Aptr n;
; if (n < 4) return 0;
-; A[2] = A[2] * n;
-; A[3] = A[3] * (n+4);
+; A[2] = Aptr n;
+; A[3] = Aptr (n+4);
;}
-define i32 @partial_mrg(double* nocapture %A, i32 %n) {
+define i32 @partial_mrg(ptr nocapture %A, i32 %n) {
; CHECK-LABEL: @partial_mrg(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV:%.*]] = sitofp i32 [[N:%.*]] to double
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast double* [[A:%.*]] to <2 x double>*
-; CHECK-NEXT: [[TMP1:%.*]] = load <2 x double>, <2 x double>* [[TMP0]], align 8
-; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x double> poison, double [[CONV]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[TMP2]], <2 x double> poison, <2 x i32> zeroinitializer
-; CHECK-NEXT: [[TMP3:%.*]] = fmul <2 x double> [[SHUFFLE]], [[TMP1]]
-; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* [[A]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP3]], <2 x double>* [[TMP4]], align 8
+; CHECK-NEXT: [[TMP0:%.*]] = load <2 x double>, ptr [[A:%.*]], align 8
+; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> poison, double [[CONV]], i32 0
+; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x double> [[TMP1]], <2 x double> poison, <2 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP3:%.*]] = fmul <2 x double> [[TMP2]], [[TMP0]]
+; CHECK-NEXT: store <2 x double> [[TMP3]], ptr [[A]], align 8
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[N]], 4
; CHECK-NEXT: br i1 [[CMP]], label [[RETURN:%.*]], label [[IF_END:%.*]]
; CHECK: if.end:
-; CHECK-NEXT: [[ARRAYIDX7:%.*]] = getelementptr inbounds double, double* [[A]], i64 2
+; CHECK-NEXT: [[ARRAYIDX7:%.*]] = getelementptr inbounds double, ptr [[A]], i64 2
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[N]], 4
; CHECK-NEXT: [[CONV12:%.*]] = sitofp i32 [[ADD]] to double
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast double* [[ARRAYIDX7]] to <2 x double>*
-; CHECK-NEXT: [[TMP6:%.*]] = load <2 x double>, <2 x double>* [[TMP5]], align 8
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> [[TMP2]], double [[CONV12]], i32 1
-; CHECK-NEXT: [[TMP8:%.*]] = fmul <2 x double> [[TMP7]], [[TMP6]]
-; CHECK-NEXT: [[TMP9:%.*]] = bitcast double* [[ARRAYIDX7]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP8]], <2 x double>* [[TMP9]], align 8
+; CHECK-NEXT: [[TMP4:%.*]] = load <2 x double>, ptr [[ARRAYIDX7]], align 8
+; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x double> [[TMP1]], double [[CONV12]], i32 1
+; CHECK-NEXT: [[TMP6:%.*]] = fmul <2 x double> [[TMP5]], [[TMP4]]
+; CHECK-NEXT: store <2 x double> [[TMP6]], ptr [[ARRAYIDX7]], align 8
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
; CHECK-NEXT: ret i32 0
;
entry:
- %0 = load double, double* %A, align 8
+ %0 = load double, ptr %A, align 8
%conv = sitofp i32 %n to double
%mul = fmul double %conv, %0
- store double %mul, double* %A, align 8
- %arrayidx2 = getelementptr inbounds double, double* %A, i64 1
- %1 = load double, double* %arrayidx2, align 8
+ store double %mul, ptr %A, align 8
+ %arrayidx2 = getelementptr inbounds double, ptr %A, i64 1
+ %1 = load double, ptr %arrayidx2, align 8
%mul4 = fmul double %conv, %1
- store double %mul4, double* %arrayidx2, align 8
+ store double %mul4, ptr %arrayidx2, align 8
%cmp = icmp slt i32 %n, 4
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
- %arrayidx7 = getelementptr inbounds double, double* %A, i64 2
- %2 = load double, double* %arrayidx7, align 8
+ %arrayidx7 = getelementptr inbounds double, ptr %A, i64 2
+ %2 = load double, ptr %arrayidx7, align 8
%mul9 = fmul double %conv, %2
- store double %mul9, double* %arrayidx7, align 8
- %arrayidx11 = getelementptr inbounds double, double* %A, i64 3
- %3 = load double, double* %arrayidx11, align 8
+ store double %mul9, ptr %arrayidx7, align 8
+ %arrayidx11 = getelementptr inbounds double, ptr %A, i64 3
+ %3 = load double, ptr %arrayidx11, align 8
%add = add nsw i32 %n, 4
%conv12 = sitofp i32 %add to double
%mul13 = fmul double %conv12, %3
- store double %mul13, double* %arrayidx11, align 8
+ store double %mul13, ptr %arrayidx11, align 8
br label %return
return: ; preds = %entry, %if.end
@@ -300,23 +287,23 @@ return: ; preds = %entry, %if.end
@a = external global double, align 8
-define void @PR19646(%class.B.53.55* %this) {
+define void @PR19646(ptr %this) {
; CHECK-LABEL: @PR19646(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 undef, label [[IF_END13:%.*]], label [[IF_END13]]
; CHECK: sw.epilog7:
-; CHECK-NEXT: [[DOTIN:%.*]] = getelementptr inbounds [[CLASS_B_53_55:%.*]], %class.B.53.55* [[THIS:%.*]], i64 0, i32 0, i32 1
-; CHECK-NEXT: [[TMP0:%.*]] = load double, double* [[DOTIN]], align 8
+; CHECK-NEXT: [[DOTIN:%.*]] = getelementptr inbounds [[CLASS_B_53_55:%.*]], ptr [[THIS:%.*]], i64 0, i32 0, i32 1
+; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[DOTIN]], align 8
; CHECK-NEXT: [[ADD:%.*]] = fadd double undef, 0.000000e+00
; CHECK-NEXT: [[ADD6:%.*]] = fadd double [[ADD]], [[TMP0]]
-; CHECK-NEXT: [[TMP1:%.*]] = load double, double* @a, align 8
+; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr @a, align 8
; CHECK-NEXT: [[ADD8:%.*]] = fadd double [[TMP1]], 0.000000e+00
-; CHECK-NEXT: [[_DY:%.*]] = getelementptr inbounds [[CLASS_B_53_55]], %class.B.53.55* [[THIS]], i64 0, i32 0, i32 2
-; CHECK-NEXT: [[TMP2:%.*]] = load double, double* [[_DY]], align 8
+; CHECK-NEXT: [[_DY:%.*]] = getelementptr inbounds [[CLASS_B_53_55]], ptr [[THIS]], i64 0, i32 0, i32 2
+; CHECK-NEXT: [[TMP2:%.*]] = load double, ptr [[_DY]], align 8
; CHECK-NEXT: [[ADD10:%.*]] = fadd double [[ADD8]], [[TMP2]]
; CHECK-NEXT: br i1 undef, label [[IF_THEN12:%.*]], label [[IF_END13]]
; CHECK: if.then12:
-; CHECK-NEXT: [[TMP3:%.*]] = load double, double* undef, align 8
+; CHECK-NEXT: [[TMP3:%.*]] = load double, ptr undef, align 8
; CHECK-NEXT: br label [[IF_END13]]
; CHECK: if.end13:
; CHECK-NEXT: [[X_1:%.*]] = phi double [ 0.000000e+00, [[IF_THEN12]] ], [ [[ADD6]], [[SW_EPILOG7:%.*]] ], [ undef, [[ENTRY:%.*]] ], [ undef, [[ENTRY]] ]
@@ -327,19 +314,19 @@ entry:
br i1 undef, label %if.end13, label %if.end13
sw.epilog7: ; No predecessors!
- %.in = getelementptr inbounds %class.B.53.55, %class.B.53.55* %this, i64 0, i32 0, i32 1
- %0 = load double, double* %.in, align 8
+ %.in = getelementptr inbounds %class.B.53.55, ptr %this, i64 0, i32 0, i32 1
+ %0 = load double, ptr %.in, align 8
%add = fadd double undef, 0.000000e+00
%add6 = fadd double %add, %0
- %1 = load double, double* @a, align 8
+ %1 = load double, ptr @a, align 8
%add8 = fadd double %1, 0.000000e+00
- %_dy = getelementptr inbounds %class.B.53.55, %class.B.53.55* %this, i64 0, i32 0, i32 2
- %2 = load double, double* %_dy, align 8
+ %_dy = getelementptr inbounds %class.B.53.55, ptr %this, i64 0, i32 0, i32 2
+ %2 = load double, ptr %_dy, align 8
%add10 = fadd double %add8, %2
br i1 undef, label %if.then12, label %if.end13
if.then12: ; preds = %sw.epilog7
- %3 = load double, double* undef, align 8
+ %3 = load double, ptr undef, align 8
br label %if.end13
if.end13: ; preds = %if.then12, %sw.epilog7, %entry
@@ -348,22 +335,19 @@ if.end13: ; preds = %if.then12, %sw.epil
unreachable
}
-define void @cse_for_hoisted_instructions_in_preheader(i32* %dst, i32 %a, i1 %c) {
+define void @cse_for_hoisted_instructions_in_preheader(ptr %dst, i32 %a, i1 %c) {
; CHECK-LABEL: @cse_for_hoisted_instructions_in_preheader(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> poison, i32 [[A:%.*]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x i32> [[TMP0]], <2 x i32> poison, <2 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x i32> [[TMP0]], <2 x i32> poison, <2 x i32> zeroinitializer
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: [[TMP1:%.*]] = or <2 x i32> <i32 22, i32 22>, [[SHUFFLE]]
-; CHECK-NEXT: [[GEP_0:%.*]] = getelementptr inbounds i32, i32* [[DST:%.*]], i64 0
-; CHECK-NEXT: [[TMP2:%.*]] = or <2 x i32> [[TMP1]], <i32 3, i32 3>
-; CHECK-NEXT: [[TMP3:%.*]] = bitcast i32* [[GEP_0]] to <2 x i32>*
-; CHECK-NEXT: store <2 x i32> [[TMP2]], <2 x i32>* [[TMP3]], align 4
-; CHECK-NEXT: [[TMP4:%.*]] = or <2 x i32> [[SHUFFLE]], <i32 3, i32 3>
-; CHECK-NEXT: [[GEP_2:%.*]] = getelementptr inbounds i32, i32* [[DST]], i64 10
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast i32* [[GEP_2]] to <2 x i32>*
-; CHECK-NEXT: store <2 x i32> [[TMP4]], <2 x i32>* [[TMP5]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = or <2 x i32> <i32 22, i32 22>, [[TMP1]]
+; CHECK-NEXT: [[TMP3:%.*]] = or <2 x i32> [[TMP2]], <i32 3, i32 3>
+; CHECK-NEXT: store <2 x i32> [[TMP3]], ptr [[DST:%.*]], align 4
+; CHECK-NEXT: [[TMP4:%.*]] = or <2 x i32> [[TMP1]], <i32 3, i32 3>
+; CHECK-NEXT: [[GEP_2:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 10
+; CHECK-NEXT: store <2 x i32> [[TMP4]], ptr [[GEP_2]], align 4
; CHECK-NEXT: br i1 [[C:%.*]], label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: ret void
@@ -374,18 +358,17 @@ entry:
loop:
%or.a = or i32 22, %a
%or.0 = or i32 %or.a, 3
- %gep.0 = getelementptr inbounds i32, i32* %dst, i64 0
- store i32 %or.0, i32* %gep.0
+ store i32 %or.0, ptr %dst
%or.a.2 = or i32 22, %a
%or.1 = or i32 %or.a.2, 3
- %gep.1 = getelementptr inbounds i32, i32* %dst, i64 1
- store i32 %or.1, i32* %gep.1
+ %gep.1 = getelementptr inbounds i32, ptr %dst, i64 1
+ store i32 %or.1, ptr %gep.1
%or.2 = or i32 %a, 3
- %gep.2 = getelementptr inbounds i32, i32* %dst, i64 10
- store i32 %or.2, i32* %gep.2
+ %gep.2 = getelementptr inbounds i32, ptr %dst, i64 10
+ store i32 %or.2, ptr %gep.2
%or.3 = or i32 %a, 3
- %gep.3 = getelementptr inbounds i32, i32* %dst, i64 11
- store i32 %or.3, i32* %gep.3
+ %gep.3 = getelementptr inbounds i32, ptr %dst, i64 11
+ store i32 %or.3, ptr %gep.3
br i1 %c, label %loop, label %exit
exit:
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/multi_block.ll b/llvm/test/Transforms/SLPVectorizer/X86/multi_block.ll
index 2b145fe64b8a3..7a929d6dc4b4c 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/multi_block.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/multi_block.ll
@@ -4,7 +4,7 @@
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-apple-macosx10.7.0"
-; int bar(double *A, int d) {
+; int bar(ptr A, int d) {
; double A0 = A[0];
; double A1 = A[1];
; float F0 = A0;
@@ -17,28 +17,26 @@ target triple = "x86_64-apple-macosx10.7.0"
; }
-define i32 @bar(double* nocapture %A, i32 %d) {
+define i32 @bar(ptr nocapture %A, i32 %d) {
; CHECK-LABEL: @bar(
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast double* [[A:%.*]] to <2 x double>*
-; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, <2 x double>* [[TMP1]], align 8
-; CHECK-NEXT: [[TMP3:%.*]] = fptrunc <2 x double> [[TMP2]] to <2 x float>
-; CHECK-NEXT: [[TMP4:%.*]] = icmp eq i32 [[D:%.*]], 0
-; CHECK-NEXT: br i1 [[TMP4]], label [[TMP7:%.*]], label [[TMP5:%.*]]
-; CHECK: 5:
-; CHECK-NEXT: [[TMP6:%.*]] = tail call i32 (...) @foo()
-; CHECK-NEXT: br label [[TMP7]]
-; CHECK: 7:
-; CHECK-NEXT: [[TMP8:%.*]] = fadd <2 x float> [[TMP3]], <float 4.000000e+00, float 5.000000e+00>
-; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds double, double* [[A]], i64 8
-; CHECK-NEXT: [[TMP10:%.*]] = fpext <2 x float> [[TMP8]] to <2 x double>
-; CHECK-NEXT: [[TMP11:%.*]] = fadd <2 x double> [[TMP10]], <double 9.000000e+00, double 5.000000e+00>
-; CHECK-NEXT: [[TMP12:%.*]] = bitcast double* [[TMP9]] to <2 x double>*
-; CHECK-NEXT: store <2 x double> [[TMP11]], <2 x double>* [[TMP12]], align 8
+; CHECK-NEXT: [[TMP1:%.*]] = load <2 x double>, ptr [[A:%.*]], align 8
+; CHECK-NEXT: [[TMP2:%.*]] = fptrunc <2 x double> [[TMP1]] to <2 x float>
+; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[D:%.*]], 0
+; CHECK-NEXT: br i1 [[TMP3]], label [[TMP6:%.*]], label [[TMP4:%.*]]
+; CHECK: 4:
+; CHECK-NEXT: [[TMP5:%.*]] = tail call i32 (...) @foo()
+; CHECK-NEXT: br label [[TMP6]]
+; CHECK: 6:
+; CHECK-NEXT: [[TMP7:%.*]] = fadd <2 x float> [[TMP2]], <float 4.000000e+00, float 5.000000e+00>
+; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds double, ptr [[A]], i64 8
+; CHECK-NEXT: [[TMP9:%.*]] = fpext <2 x float> [[TMP7]] to <2 x double>
+; CHECK-NEXT: [[TMP10:%.*]] = fadd <2 x double> [[TMP9]], <double 9.000000e+00, double 5.000000e+00>
+; CHECK-NEXT: store <2 x double> [[TMP10]], ptr [[TMP8]], align 8
; CHECK-NEXT: ret i32 undef
;
- %1 = load double, double* %A, align 8
- %2 = getelementptr inbounds double, double* %A, i64 1
- %3 = load double, double* %2, align 8
+ %1 = load double, ptr %A, align 8
+ %2 = getelementptr inbounds double, ptr %A, i64 1
+ %3 = load double, ptr %2, align 8
%4 = fptrunc double %1 to float
%5 = fptrunc double %3 to float
%6 = icmp eq i32 %d, 0
@@ -53,12 +51,12 @@ define i32 @bar(double* nocapture %A, i32 %d) {
%11 = fadd float %5, 5.000000e+00
%12 = fpext float %10 to double
%13 = fadd double %12, 9.000000e+00
- %14 = getelementptr inbounds double, double* %A, i64 8
- store double %13, double* %14, align 8
+ %14 = getelementptr inbounds double, ptr %A, i64 8
+ store double %13, ptr %14, align 8
%15 = fpext float %11 to double
%16 = fadd double %15, 5.000000e+00
- %17 = getelementptr inbounds double, double* %A, i64 9
- store double %16, double* %17, align 8
+ %17 = getelementptr inbounds double, ptr %A, i64 9
+ store double %16, ptr %17, align 8
ret i32 undef
}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/pr35497.ll b/llvm/test/Transforms/SLPVectorizer/X86/pr35497.ll
index 9459b9376468e..56c0cf771b736 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/pr35497.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/pr35497.ll
@@ -15,50 +15,42 @@ define void @_ZN1C10SwitchModeEv() local_unnamed_addr #0 comdat align 2 {
; SSE-LABEL: @_ZN1C10SwitchModeEv(
; SSE-NEXT: for.body.lr.ph.i:
; SSE-NEXT: [[OR_1:%.*]] = or i64 undef, 1
-; SSE-NEXT: store i64 [[OR_1]], i64* undef, align 8
-; SSE-NEXT: [[FOO_1:%.*]] = getelementptr inbounds [[CLASS_1:%.*]], %class.1* undef, i64 0, i32 0, i32 0, i32 0, i32 0, i64 0
-; SSE-NEXT: [[FOO_3:%.*]] = load i64, i64* [[FOO_1]], align 8
-; SSE-NEXT: [[FOO_2:%.*]] = getelementptr inbounds [[CLASS_1]], %class.1* undef, i64 0, i32 0, i32 0, i32 0, i32 0, i64 1
-; SSE-NEXT: [[FOO_4:%.*]] = load i64, i64* [[FOO_2]], align 8
-; SSE-NEXT: [[BAR5:%.*]] = load i64, i64* undef, align 8
+; SSE-NEXT: store i64 [[OR_1]], ptr undef, align 8
+; SSE-NEXT: [[FOO_3:%.*]] = load i64, ptr undef, align 8
+; SSE-NEXT: [[FOO_2:%.*]] = getelementptr inbounds [[CLASS_1:%.*]], ptr undef, i64 0, i32 0, i32 0, i32 0, i32 0, i64 1
+; SSE-NEXT: [[FOO_4:%.*]] = load i64, ptr [[FOO_2]], align 8
+; SSE-NEXT: [[BAR5:%.*]] = load i64, ptr undef, align 8
; SSE-NEXT: [[AND_2:%.*]] = and i64 [[OR_1]], [[FOO_3]]
; SSE-NEXT: [[AND_1:%.*]] = and i64 [[BAR5]], [[FOO_4]]
-; SSE-NEXT: [[BAR3:%.*]] = getelementptr inbounds [[CLASS_2:%.*]], %class.2* undef, i64 0, i32 0, i32 0, i32 0, i64 0
-; SSE-NEXT: store i64 [[AND_2]], i64* [[BAR3]], align 8
-; SSE-NEXT: [[BAR4:%.*]] = getelementptr inbounds [[CLASS_2]], %class.2* undef, i64 0, i32 0, i32 0, i32 0, i64 1
-; SSE-NEXT: store i64 [[AND_1]], i64* [[BAR4]], align 8
+; SSE-NEXT: store i64 [[AND_2]], ptr undef, align 8
+; SSE-NEXT: [[BAR4:%.*]] = getelementptr inbounds [[CLASS_2:%.*]], ptr undef, i64 0, i32 0, i32 0, i32 0, i64 1
+; SSE-NEXT: store i64 [[AND_1]], ptr [[BAR4]], align 8
; SSE-NEXT: ret void
;
; AVX-LABEL: @_ZN1C10SwitchModeEv(
; AVX-NEXT: for.body.lr.ph.i:
; AVX-NEXT: [[OR_1:%.*]] = or i64 undef, 1
-; AVX-NEXT: store i64 [[OR_1]], i64* undef, align 8
-; AVX-NEXT: [[FOO_1:%.*]] = getelementptr inbounds [[CLASS_1:%.*]], %class.1* undef, i64 0, i32 0, i32 0, i32 0, i32 0, i64 0
-; AVX-NEXT: [[BAR5:%.*]] = load i64, i64* undef, align 8
-; AVX-NEXT: [[BAR3:%.*]] = getelementptr inbounds [[CLASS_2:%.*]], %class.2* undef, i64 0, i32 0, i32 0, i32 0, i64 0
-; AVX-NEXT: [[TMP0:%.*]] = bitcast i64* [[FOO_1]] to <2 x i64>*
-; AVX-NEXT: [[TMP1:%.*]] = load <2 x i64>, <2 x i64>* [[TMP0]], align 8
-; AVX-NEXT: [[TMP2:%.*]] = insertelement <2 x i64> poison, i64 [[OR_1]], i32 0
-; AVX-NEXT: [[TMP3:%.*]] = insertelement <2 x i64> [[TMP2]], i64 [[BAR5]], i32 1
-; AVX-NEXT: [[TMP4:%.*]] = and <2 x i64> [[TMP3]], [[TMP1]]
-; AVX-NEXT: [[TMP5:%.*]] = bitcast i64* [[BAR3]] to <2 x i64>*
-; AVX-NEXT: store <2 x i64> [[TMP4]], <2 x i64>* [[TMP5]], align 8
+; AVX-NEXT: store i64 [[OR_1]], ptr undef, align 8
+; AVX-NEXT: [[BAR5:%.*]] = load i64, ptr undef, align 8
+; AVX-NEXT: [[TMP0:%.*]] = load <2 x i64>, ptr undef, align 8
+; AVX-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> poison, i64 [[OR_1]], i32 0
+; AVX-NEXT: [[TMP2:%.*]] = insertelement <2 x i64> [[TMP1]], i64 [[BAR5]], i32 1
+; AVX-NEXT: [[TMP3:%.*]] = and <2 x i64> [[TMP2]], [[TMP0]]
+; AVX-NEXT: store <2 x i64> [[TMP3]], ptr undef, align 8
; AVX-NEXT: ret void
;
for.body.lr.ph.i:
%or.1 = or i64 undef, 1
- store i64 %or.1, i64* undef, align 8
- %foo.1 = getelementptr inbounds %class.1, %class.1* undef, i64 0, i32 0, i32 0, i32 0, i32 0, i64 0
- %foo.3 = load i64, i64* %foo.1, align 8
- %foo.2 = getelementptr inbounds %class.1, %class.1* undef, i64 0, i32 0, i32 0, i32 0, i32 0, i64 1
- %foo.4 = load i64, i64* %foo.2, align 8
- %bar5 = load i64, i64* undef, align 8
+ store i64 %or.1, ptr undef, align 8
+ %foo.3 = load i64, ptr undef, align 8
+ %foo.2 = getelementptr inbounds %class.1, ptr undef, i64 0, i32 0, i32 0, i32 0, i32 0, i64 1
+ %foo.4 = load i64, ptr %foo.2, align 8
+ %bar5 = load i64, ptr undef, align 8
%and.2 = and i64 %or.1, %foo.3
%and.1 = and i64 %bar5, %foo.4
- %bar3 = getelementptr inbounds %class.2, %class.2* undef, i64 0, i32 0, i32 0, i32 0, i64 0
- store i64 %and.2, i64* %bar3, align 8
- %bar4 = getelementptr inbounds %class.2, %class.2* undef, i64 0, i32 0, i32 0, i32 0, i64 1
- store i64 %and.1, i64* %bar4, align 8
+ store i64 %and.2, ptr undef, align 8
+ %bar4 = getelementptr inbounds %class.2, ptr undef, i64 0, i32 0, i32 0, i32 0, i64 1
+ store i64 %and.1, ptr %bar4, align 8
ret void
}
@@ -66,79 +58,72 @@ for.body.lr.ph.i:
define void @pr35497() local_unnamed_addr #0 {
; SSE-LABEL: @pr35497(
; SSE-NEXT: entry:
-; SSE-NEXT: [[TMP0:%.*]] = load i64, i64* undef, align 1
+; SSE-NEXT: [[TMP0:%.*]] = load i64, ptr undef, align 1
; SSE-NEXT: [[ADD:%.*]] = add i64 undef, undef
-; SSE-NEXT: store i64 [[ADD]], i64* undef, align 1
-; SSE-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds [0 x i64], [0 x i64]* undef, i64 0, i64 4
-; SSE-NEXT: [[ARRAYIDX2_6:%.*]] = getelementptr inbounds [0 x i64], [0 x i64]* undef, i64 0, i64 0
+; SSE-NEXT: store i64 [[ADD]], ptr undef, align 1
+; SSE-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds [0 x i64], ptr undef, i64 0, i64 4
; SSE-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> <i64 undef, i64 poison>, i64 [[TMP0]], i32 1
; SSE-NEXT: [[TMP2:%.*]] = shl <2 x i64> [[TMP1]], <i64 2, i64 2>
; SSE-NEXT: [[TMP3:%.*]] = and <2 x i64> [[TMP2]], <i64 20, i64 20>
; SSE-NEXT: [[TMP4:%.*]] = add nuw nsw <2 x i64> [[TMP3]], zeroinitializer
-; SSE-NEXT: [[TMP5:%.*]] = bitcast i64* [[ARRAYIDX2_6]] to <2 x i64>*
-; SSE-NEXT: store <2 x i64> [[TMP4]], <2 x i64>* [[TMP5]], align 1
-; SSE-NEXT: [[TMP6:%.*]] = insertelement <2 x i64> poison, i64 [[ADD]], i32 0
-; SSE-NEXT: [[TMP7:%.*]] = shufflevector <2 x i64> [[TMP6]], <2 x i64> [[TMP4]], <2 x i32> <i32 0, i32 3>
-; SSE-NEXT: [[TMP8:%.*]] = shl <2 x i64> [[TMP7]], <i64 2, i64 2>
-; SSE-NEXT: [[TMP9:%.*]] = and <2 x i64> [[TMP8]], <i64 20, i64 20>
-; SSE-NEXT: [[TMP10:%.*]] = shufflevector <2 x i64> [[TMP9]], <2 x i64> poison, <2 x i32> <i32 1, i32 0>
-; SSE-NEXT: [[TMP11:%.*]] = lshr <2 x i64> [[TMP4]], <i64 6, i64 6>
-; SSE-NEXT: [[TMP12:%.*]] = add nuw nsw <2 x i64> [[TMP10]], [[TMP11]]
-; SSE-NEXT: [[TMP13:%.*]] = bitcast i64* [[ARRAYIDX2_2]] to <2 x i64>*
-; SSE-NEXT: store <2 x i64> [[TMP12]], <2 x i64>* [[TMP13]], align 1
+; SSE-NEXT: store <2 x i64> [[TMP4]], ptr undef, align 1
+; SSE-NEXT: [[TMP5:%.*]] = insertelement <2 x i64> poison, i64 [[ADD]], i32 0
+; SSE-NEXT: [[TMP6:%.*]] = shufflevector <2 x i64> [[TMP5]], <2 x i64> [[TMP4]], <2 x i32> <i32 0, i32 3>
+; SSE-NEXT: [[TMP7:%.*]] = shl <2 x i64> [[TMP6]], <i64 2, i64 2>
+; SSE-NEXT: [[TMP8:%.*]] = and <2 x i64> [[TMP7]], <i64 20, i64 20>
+; SSE-NEXT: [[TMP9:%.*]] = shufflevector <2 x i64> [[TMP8]], <2 x i64> poison, <2 x i32> <i32 1, i32 0>
+; SSE-NEXT: [[TMP10:%.*]] = lshr <2 x i64> [[TMP4]], <i64 6, i64 6>
+; SSE-NEXT: [[TMP11:%.*]] = add nuw nsw <2 x i64> [[TMP9]], [[TMP10]]
+; SSE-NEXT: store <2 x i64> [[TMP11]], ptr [[ARRAYIDX2_2]], align 1
; SSE-NEXT: ret void
;
; AVX-LABEL: @pr35497(
; AVX-NEXT: entry:
-; AVX-NEXT: [[TMP0:%.*]] = load i64, i64* undef, align 1
+; AVX-NEXT: [[TMP0:%.*]] = load i64, ptr undef, align 1
; AVX-NEXT: [[ADD:%.*]] = add i64 undef, undef
-; AVX-NEXT: store i64 [[ADD]], i64* undef, align 1
-; AVX-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds [0 x i64], [0 x i64]* undef, i64 0, i64 4
-; AVX-NEXT: [[ARRAYIDX2_6:%.*]] = getelementptr inbounds [0 x i64], [0 x i64]* undef, i64 0, i64 0
+; AVX-NEXT: store i64 [[ADD]], ptr undef, align 1
+; AVX-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds [0 x i64], ptr undef, i64 0, i64 4
; AVX-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> <i64 undef, i64 poison>, i64 [[TMP0]], i32 1
; AVX-NEXT: [[TMP2:%.*]] = shl <2 x i64> [[TMP1]], <i64 2, i64 2>
; AVX-NEXT: [[TMP3:%.*]] = and <2 x i64> [[TMP2]], <i64 20, i64 20>
; AVX-NEXT: [[TMP4:%.*]] = add nuw nsw <2 x i64> [[TMP3]], zeroinitializer
-; AVX-NEXT: [[TMP5:%.*]] = bitcast i64* [[ARRAYIDX2_6]] to <2 x i64>*
-; AVX-NEXT: store <2 x i64> [[TMP4]], <2 x i64>* [[TMP5]], align 1
-; AVX-NEXT: [[TMP6:%.*]] = insertelement <2 x i64> poison, i64 [[ADD]], i32 0
-; AVX-NEXT: [[TMP7:%.*]] = shufflevector <2 x i64> [[TMP6]], <2 x i64> [[TMP4]], <2 x i32> <i32 0, i32 3>
-; AVX-NEXT: [[TMP8:%.*]] = shl <2 x i64> [[TMP7]], <i64 2, i64 2>
-; AVX-NEXT: [[TMP9:%.*]] = and <2 x i64> [[TMP8]], <i64 20, i64 20>
-; AVX-NEXT: [[TMP10:%.*]] = shufflevector <2 x i64> [[TMP9]], <2 x i64> poison, <2 x i32> <i32 1, i32 0>
-; AVX-NEXT: [[TMP11:%.*]] = lshr <2 x i64> [[TMP4]], <i64 6, i64 6>
-; AVX-NEXT: [[TMP12:%.*]] = add nuw nsw <2 x i64> [[TMP10]], [[TMP11]]
-; AVX-NEXT: [[TMP13:%.*]] = bitcast i64* [[ARRAYIDX2_2]] to <2 x i64>*
-; AVX-NEXT: store <2 x i64> [[TMP12]], <2 x i64>* [[TMP13]], align 1
+; AVX-NEXT: store <2 x i64> [[TMP4]], ptr undef, align 1
+; AVX-NEXT: [[TMP5:%.*]] = insertelement <2 x i64> poison, i64 [[ADD]], i32 0
+; AVX-NEXT: [[TMP6:%.*]] = shufflevector <2 x i64> [[TMP5]], <2 x i64> [[TMP4]], <2 x i32> <i32 0, i32 3>
+; AVX-NEXT: [[TMP7:%.*]] = shl <2 x i64> [[TMP6]], <i64 2, i64 2>
+; AVX-NEXT: [[TMP8:%.*]] = and <2 x i64> [[TMP7]], <i64 20, i64 20>
+; AVX-NEXT: [[TMP9:%.*]] = shufflevector <2 x i64> [[TMP8]], <2 x i64> poison, <2 x i32> <i32 1, i32 0>
+; AVX-NEXT: [[TMP10:%.*]] = lshr <2 x i64> [[TMP4]], <i64 6, i64 6>
+; AVX-NEXT: [[TMP11:%.*]] = add nuw nsw <2 x i64> [[TMP9]], [[TMP10]]
+; AVX-NEXT: store <2 x i64> [[TMP11]], ptr [[ARRAYIDX2_2]], align 1
; AVX-NEXT: ret void
;
entry:
- %0 = load i64, i64* undef, align 1
+ %0 = load i64, ptr undef, align 1
%and = shl i64 %0, 2
%shl = and i64 %and, 20
%add = add i64 undef, undef
- store i64 %add, i64* undef, align 1
- %arrayidx2.1 = getelementptr inbounds [0 x i64], [0 x i64]* undef, i64 0, i64 5
+ store i64 %add, ptr undef, align 1
+ %arrayidx2.1 = getelementptr inbounds [0 x i64], ptr undef, i64 0, i64 5
%and.1 = shl i64 undef, 2
%shl.1 = and i64 %and.1, 20
%shr.1 = lshr i64 undef, 6
%add.1 = add nuw nsw i64 %shl, %shr.1
- %arrayidx2.2 = getelementptr inbounds [0 x i64], [0 x i64]* undef, i64 0, i64 4
+ %arrayidx2.2 = getelementptr inbounds [0 x i64], ptr undef, i64 0, i64 4
%shr.2 = lshr i64 undef, 6
%add.2 = add nuw nsw i64 %shl.1, %shr.2
%and.4 = shl i64 %add, 2
%shl.4 = and i64 %and.4, 20
- %arrayidx2.5 = getelementptr inbounds [0 x i64], [0 x i64]* undef, i64 0, i64 1
- store i64 %add.1, i64* %arrayidx2.5, align 1
+ %arrayidx2.5 = getelementptr inbounds [0 x i64], ptr undef, i64 0, i64 1
+ store i64 %add.1, ptr %arrayidx2.5, align 1
%and.5 = shl nuw nsw i64 %add.1, 2
%shl.5 = and i64 %and.5, 20
%shr.5 = lshr i64 %add.1, 6
%add.5 = add nuw nsw i64 %shl.4, %shr.5
- store i64 %add.5, i64* %arrayidx2.1, align 1
- %arrayidx2.6 = getelementptr inbounds [0 x i64], [0 x i64]* undef, i64 0, i64 0
- store i64 %add.2, i64* %arrayidx2.6, align 1
+ store i64 %add.5, ptr %arrayidx2.1, align 1
+ store i64 %add.2, ptr undef, align 1
%shr.6 = lshr i64 %add.2, 6
%add.6 = add nuw nsw i64 %shl.5, %shr.6
- store i64 %add.6, i64* %arrayidx2.2, align 1
+ store i64 %add.6, ptr %arrayidx2.2, align 1
ret void
}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll b/llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll
index 0e6d426f55588..ffa052f7cfddd 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/reduction2.ll
@@ -4,27 +4,26 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"
target triple = "i386-apple-macosx10.8.0"
-define double @foo(double* nocapture %D) {
+define double @foo(ptr nocapture %D) {
; CHECK-LABEL: @foo(
; CHECK-NEXT: br label [[TMP1:%.*]]
; CHECK: 1:
-; CHECK-NEXT: [[I_02:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP12:%.*]], [[TMP1]] ]
-; CHECK-NEXT: [[SUM_01:%.*]] = phi double [ 0.000000e+00, [[TMP0]] ], [ [[TMP11:%.*]], [[TMP1]] ]
+; CHECK-NEXT: [[I_02:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP11:%.*]], [[TMP1]] ]
+; CHECK-NEXT: [[SUM_01:%.*]] = phi double [ 0.000000e+00, [[TMP0]] ], [ [[TMP10:%.*]], [[TMP1]] ]
; CHECK-NEXT: [[TMP2:%.*]] = shl nsw i32 [[I_02]], 1
-; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds double, double* [[D:%.*]], i32 [[TMP2]]
-; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* [[TMP3]] to <2 x double>*
-; CHECK-NEXT: [[TMP5:%.*]] = load <2 x double>, <2 x double>* [[TMP4]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds double, ptr [[D:%.*]], i32 [[TMP2]]
+; CHECK-NEXT: [[TMP4:%.*]] = load <2 x double>, ptr [[TMP3]], align 4
+; CHECK-NEXT: [[TMP5:%.*]] = fmul <2 x double> [[TMP4]], [[TMP4]]
; CHECK-NEXT: [[TMP6:%.*]] = fmul <2 x double> [[TMP5]], [[TMP5]]
-; CHECK-NEXT: [[TMP7:%.*]] = fmul <2 x double> [[TMP6]], [[TMP6]]
-; CHECK-NEXT: [[TMP8:%.*]] = extractelement <2 x double> [[TMP7]], i32 0
-; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x double> [[TMP7]], i32 1
-; CHECK-NEXT: [[TMP10:%.*]] = fadd double [[TMP8]], [[TMP9]]
-; CHECK-NEXT: [[TMP11]] = fadd double [[SUM_01]], [[TMP10]]
-; CHECK-NEXT: [[TMP12]] = add nsw i32 [[I_02]], 1
-; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP12]], 100
-; CHECK-NEXT: br i1 [[EXITCOND]], label [[TMP13:%.*]], label [[TMP1]]
-; CHECK: 13:
-; CHECK-NEXT: ret double [[TMP11]]
+; CHECK-NEXT: [[TMP7:%.*]] = extractelement <2 x double> [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP8:%.*]] = extractelement <2 x double> [[TMP6]], i32 1
+; CHECK-NEXT: [[TMP9:%.*]] = fadd double [[TMP7]], [[TMP8]]
+; CHECK-NEXT: [[TMP10]] = fadd double [[SUM_01]], [[TMP9]]
+; CHECK-NEXT: [[TMP11]] = add nsw i32 [[I_02]], 1
+; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP11]], 100
+; CHECK-NEXT: br i1 [[EXITCOND]], label [[TMP12:%.*]], label [[TMP1]]
+; CHECK: 12:
+; CHECK-NEXT: ret double [[TMP10]]
;
br label %1
@@ -32,13 +31,13 @@ define double @foo(double* nocapture %D) {
%i.02 = phi i32 [ 0, %0 ], [ %10, %1 ]
%sum.01 = phi double [ 0.000000e+00, %0 ], [ %9, %1 ]
%2 = shl nsw i32 %i.02, 1
- %3 = getelementptr inbounds double, double* %D, i32 %2
- %4 = load double, double* %3, align 4
+ %3 = getelementptr inbounds double, ptr %D, i32 %2
+ %4 = load double, ptr %3, align 4
%A4 = fmul double %4, %4
%A42 = fmul double %A4, %A4
%5 = or i32 %2, 1
- %6 = getelementptr inbounds double, double* %D, i32 %5
- %7 = load double, double* %6, align 4
+ %6 = getelementptr inbounds double, ptr %D, i32 %5
+ %7 = load double, ptr %6, align 4
%A7 = fmul double %7, %7
%A72 = fmul double %A7, %A7
%8 = fadd double %A42, %A72
@@ -94,19 +93,19 @@ define i1 @fcmp_lt_gt(double %a, double %b, double %c) {
; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x double> [[TMP2]], double [[B]], i32 1
; CHECK-NEXT: [[TMP4:%.*]] = fsub <2 x double> [[TMP1]], [[TMP3]]
; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x double> poison, double [[MUL]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[TMP5]], <2 x double> poison, <2 x i32> zeroinitializer
-; CHECK-NEXT: [[TMP6:%.*]] = fdiv <2 x double> [[TMP4]], [[SHUFFLE]]
-; CHECK-NEXT: [[TMP7:%.*]] = extractelement <2 x double> [[TMP6]], i32 1
-; CHECK-NEXT: [[CMP:%.*]] = fcmp olt double [[TMP7]], 0x3EB0C6F7A0B5ED8D
-; CHECK-NEXT: [[TMP8:%.*]] = extractelement <2 x double> [[TMP6]], i32 0
-; CHECK-NEXT: [[CMP4:%.*]] = fcmp olt double [[TMP8]], 0x3EB0C6F7A0B5ED8D
+; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <2 x double> [[TMP5]], <2 x double> poison, <2 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP7:%.*]] = fdiv <2 x double> [[TMP4]], [[TMP6]]
+; CHECK-NEXT: [[TMP8:%.*]] = extractelement <2 x double> [[TMP7]], i32 1
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt double [[TMP8]], 0x3EB0C6F7A0B5ED8D
+; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x double> [[TMP7]], i32 0
+; CHECK-NEXT: [[CMP4:%.*]] = fcmp olt double [[TMP9]], 0x3EB0C6F7A0B5ED8D
; CHECK-NEXT: [[OR_COND:%.*]] = and i1 [[CMP]], [[CMP4]]
; CHECK-NEXT: br i1 [[OR_COND]], label [[CLEANUP:%.*]], label [[LOR_LHS_FALSE:%.*]]
; CHECK: lor.lhs.false:
-; CHECK-NEXT: [[TMP9:%.*]] = fcmp ule <2 x double> [[TMP6]], <double 1.000000e+00, double 1.000000e+00>
-; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x i1> [[TMP9]], i32 0
-; CHECK-NEXT: [[TMP11:%.*]] = extractelement <2 x i1> [[TMP9]], i32 1
-; CHECK-NEXT: [[NOT_OR_COND9:%.*]] = or i1 [[TMP10]], [[TMP11]]
+; CHECK-NEXT: [[TMP10:%.*]] = fcmp ule <2 x double> [[TMP7]], <double 1.000000e+00, double 1.000000e+00>
+; CHECK-NEXT: [[TMP11:%.*]] = extractelement <2 x i1> [[TMP10]], i32 0
+; CHECK-NEXT: [[TMP12:%.*]] = extractelement <2 x i1> [[TMP10]], i32 1
+; CHECK-NEXT: [[NOT_OR_COND9:%.*]] = or i1 [[TMP11]], [[TMP12]]
; CHECK-NEXT: ret i1 [[NOT_OR_COND9]]
; CHECK: cleanup:
; CHECK-NEXT: ret i1 false
@@ -143,12 +142,12 @@ define i1 @fcmp_lt(double %a, double %b, double %c) {
; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x double> [[TMP3]], double [[B]], i32 1
; CHECK-NEXT: [[TMP5:%.*]] = fsub <2 x double> [[TMP2]], [[TMP4]]
; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> poison, double [[MUL]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[TMP6]], <2 x double> poison, <2 x i32> zeroinitializer
-; CHECK-NEXT: [[TMP7:%.*]] = fdiv <2 x double> [[TMP5]], [[SHUFFLE]]
-; CHECK-NEXT: [[TMP8:%.*]] = fcmp uge <2 x double> [[TMP7]], <double 0x3EB0C6F7A0B5ED8D, double 0x3EB0C6F7A0B5ED8D>
-; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x i1> [[TMP8]], i32 0
-; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x i1> [[TMP8]], i32 1
-; CHECK-NEXT: [[NOT_OR_COND:%.*]] = or i1 [[TMP9]], [[TMP10]]
+; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <2 x double> [[TMP6]], <2 x double> poison, <2 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP8:%.*]] = fdiv <2 x double> [[TMP5]], [[TMP7]]
+; CHECK-NEXT: [[TMP9:%.*]] = fcmp uge <2 x double> [[TMP8]], <double 0x3EB0C6F7A0B5ED8D, double 0x3EB0C6F7A0B5ED8D>
+; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x i1> [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = extractelement <2 x i1> [[TMP9]], i32 1
+; CHECK-NEXT: [[NOT_OR_COND:%.*]] = or i1 [[TMP10]], [[TMP11]]
; CHECK-NEXT: ret i1 [[NOT_OR_COND]]
;
%fneg = fneg double %b
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reorder-reused-masked-gather2.ll b/llvm/test/Transforms/SLPVectorizer/X86/reorder-reused-masked-gather2.ll
index 714ff8a516a6b..75431c13a7703 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/reorder-reused-masked-gather2.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/reorder-reused-masked-gather2.ll
@@ -4,94 +4,74 @@
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
target triple = "x86_64-unknown-linux-gnu"
-define void @"foo"(i8 addrspace(1)* %0, i8 addrspace(1)* %1) #0 {
+define void @"foo"(ptr addrspace(1) %0, ptr addrspace(1) %1) #0 {
; CHECK-LABEL: @foo(
-; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x i8 addrspace(1)*> poison, i8 addrspace(1)* [[TMP0:%.*]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x i8 addrspace(1)*> [[TMP3]], <4 x i8 addrspace(1)*> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: [[TMP4:%.*]] = getelementptr i8, <4 x i8 addrspace(1)*> [[SHUFFLE]], <4 x i64> <i64 8, i64 12, i64 28, i64 24>
-; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i8, i8 addrspace(1)* [[TMP1:%.*]], i64 8
-; CHECK-NEXT: [[TMP6:%.*]] = bitcast i8 addrspace(1)* [[TMP5]] to float addrspace(1)*
-; CHECK-NEXT: [[TMP7:%.*]] = bitcast <4 x i8 addrspace(1)*> [[TMP4]] to <4 x float addrspace(1)*>
-; CHECK-NEXT: [[TMP8:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p1f32(<4 x float addrspace(1)*> [[TMP7]], i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x float> poison)
-; CHECK-NEXT: [[SHUFFLE1:%.*]] = shufflevector <4 x float> [[TMP8]], <4 x float> poison, <8 x i32> <i32 0, i32 3, i32 0, i32 3, i32 2, i32 1, i32 2, i32 1>
-; CHECK-NEXT: [[TMP9:%.*]] = bitcast float addrspace(1)* [[TMP6]] to <8 x float> addrspace(1)*
-; CHECK-NEXT: [[TMP10:%.*]] = load <8 x float>, <8 x float> addrspace(1)* [[TMP9]], align 4
-; CHECK-NEXT: [[TMP11:%.*]] = fmul <8 x float> [[SHUFFLE1]], [[TMP10]]
-; CHECK-NEXT: [[TMP12:%.*]] = fadd <8 x float> [[TMP11]], zeroinitializer
-; CHECK-NEXT: [[SHUFFLE2:%.*]] = shufflevector <8 x float> [[TMP12]], <8 x float> poison, <8 x i32> <i32 0, i32 5, i32 2, i32 7, i32 4, i32 1, i32 6, i32 3>
-; CHECK-NEXT: [[TMP13:%.*]] = extractelement <4 x float addrspace(1)*> [[TMP7]], i32 0
-; CHECK-NEXT: [[TMP14:%.*]] = bitcast float addrspace(1)* [[TMP13]] to <8 x float> addrspace(1)*
-; CHECK-NEXT: store <8 x float> [[SHUFFLE2]], <8 x float> addrspace(1)* [[TMP14]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x ptr addrspace(1)> poison, ptr addrspace(1) [[TMP0:%.*]], i32 0
+; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x ptr addrspace(1)> [[TMP3]], <4 x ptr addrspace(1)> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[TMP5:%.*]] = getelementptr i8, <4 x ptr addrspace(1)> [[TMP4]], <4 x i64> <i64 8, i64 12, i64 28, i64 24>
+; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP1:%.*]], i64 8
+; CHECK-NEXT: [[TMP7:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p1(<4 x ptr addrspace(1)> [[TMP5]], i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x float> poison)
+; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <4 x float> [[TMP7]], <4 x float> poison, <8 x i32> <i32 0, i32 3, i32 0, i32 3, i32 2, i32 1, i32 2, i32 1>
+; CHECK-NEXT: [[TMP9:%.*]] = load <8 x float>, ptr addrspace(1) [[TMP6]], align 4
+; CHECK-NEXT: [[TMP10:%.*]] = fmul <8 x float> [[TMP8]], [[TMP9]]
+; CHECK-NEXT: [[TMP11:%.*]] = fadd <8 x float> [[TMP10]], zeroinitializer
+; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <8 x float> [[TMP11]], <8 x float> poison, <8 x i32> <i32 0, i32 5, i32 2, i32 7, i32 4, i32 1, i32 6, i32 3>
+; CHECK-NEXT: [[TMP13:%.*]] = extractelement <4 x ptr addrspace(1)> [[TMP5]], i32 0
+; CHECK-NEXT: store <8 x float> [[TMP12]], ptr addrspace(1) [[TMP13]], align 4
; CHECK-NEXT: ret void
;
- %3 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 8
- %4 = bitcast i8 addrspace(1)* %3 to float addrspace(1)*
- %5 = load float, float addrspace(1)* %4 , align 4
- %6 = getelementptr inbounds i8, i8 addrspace(1)* %1, i64 8
- %7 = bitcast i8 addrspace(1)* %6 to float addrspace(1)*
- %8 = load float, float addrspace(1)* %7 , align 4
- %9 = fmul float %5, %8
- %10 = fadd float %9, 0.000000e+00
- %11 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 12
- %12 = bitcast i8 addrspace(1)* %11 to float addrspace(1)*
- %13 = load float, float addrspace(1)* %12 , align 4
- %14 = getelementptr inbounds i8, i8 addrspace(1)* %1, i64 28
- %15 = bitcast i8 addrspace(1)* %14 to float addrspace(1)*
- %16 = load float, float addrspace(1)* %15 , align 4
- %17 = fmul float %13, %16
+ %3 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 8
+ %4 = load float, ptr addrspace(1) %3 , align 4
+ %5 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 8
+ %6 = load float, ptr addrspace(1) %5 , align 4
+ %7 = fmul float %4, %6
+ %8 = fadd float %7, 0.000000e+00
+ %9 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 12
+ %10 = load float, ptr addrspace(1) %9 , align 4
+ %11 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 28
+ %12 = load float, ptr addrspace(1) %11 , align 4
+ %13 = fmul float %10, %12
+ %14 = fadd float %13, 0.000000e+00
+ %15 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 16
+ %16 = load float, ptr addrspace(1) %15 , align 4
+ %17 = fmul float %4, %16
%18 = fadd float %17, 0.000000e+00
- %19 = getelementptr inbounds i8, i8 addrspace(1)* %1, i64 16
- %20 = bitcast i8 addrspace(1)* %19 to float addrspace(1)*
- %21 = load float, float addrspace(1)* %20 , align 4
- %22 = fmul float %5, %21
- %23 = fadd float %22, 0.000000e+00
- %24 = getelementptr inbounds i8, i8 addrspace(1)* %1, i64 36
- %25 = bitcast i8 addrspace(1)* %24 to float addrspace(1)*
- %26 = load float, float addrspace(1)* %25 , align 4
- %27 = fmul float %13, %26
+ %19 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 36
+ %20 = load float, ptr addrspace(1) %19 , align 4
+ %21 = fmul float %10, %20
+ %22 = fadd float %21, 0.000000e+00
+ %23 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 28
+ %24 = load float, ptr addrspace(1) %23 , align 4
+ %25 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 24
+ %26 = load float, ptr addrspace(1) %25 , align 4
+ %27 = fmul float %24, %26
%28 = fadd float %27, 0.000000e+00
- %29 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 28
- %30 = bitcast i8 addrspace(1)* %29 to float addrspace(1)*
- %31 = load float, float addrspace(1)* %30 , align 4
- %32 = getelementptr inbounds i8, i8 addrspace(1)* %1, i64 24
- %33 = bitcast i8 addrspace(1)* %32 to float addrspace(1)*
- %34 = load float, float addrspace(1)* %33 , align 4
- %35 = fmul float %31, %34
- %36 = fadd float %35, 0.000000e+00
- %37 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 24
- %38 = bitcast i8 addrspace(1)* %37 to float addrspace(1)*
- %39 = load float, float addrspace(1)* %38 , align 4
- %40 = getelementptr inbounds i8, i8 addrspace(1)* %1, i64 12
- %41 = bitcast i8 addrspace(1)* %40 to float addrspace(1)*
- %42 = load float, float addrspace(1)* %41 , align 4
- %43 = fmul float %39, %42
- %44 = fadd float %43, 0.000000e+00
- %45 = getelementptr inbounds i8, i8 addrspace(1)* %1, i64 32
- %46 = bitcast i8 addrspace(1)* %45 to float addrspace(1)*
- %47 = load float, float addrspace(1)* %46 , align 4
- %48 = fmul float %31, %47
- %49 = fadd float %48, 0.000000e+00
- %50 = getelementptr inbounds i8, i8 addrspace(1)* %1, i64 20
- %51 = bitcast i8 addrspace(1)* %50 to float addrspace(1)*
- %52 = load float, float addrspace(1)* %51 , align 4
- %53 = fmul float %39, %52
- %54 = fadd float %53, 0.000000e+00
- store float %10, float addrspace(1)* %4 , align 4
- store float %18, float addrspace(1)* %12 , align 4
- %55 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 16
- %56 = bitcast i8 addrspace(1)* %55 to float addrspace(1)*
- store float %23, float addrspace(1)* %56 , align 4
- %57 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 20
- %58 = bitcast i8 addrspace(1)* %57 to float addrspace(1)*
- store float %28, float addrspace(1)* %58 , align 4
- store float %36, float addrspace(1)* %38 , align 4
- store float %44, float addrspace(1)* %30 , align 4
- %59 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 32
- %60 = bitcast i8 addrspace(1)* %59 to float addrspace(1)*
- store float %49, float addrspace(1)* %60 , align 4
- %61 = getelementptr inbounds i8, i8 addrspace(1)* %0, i64 36
- %62 = bitcast i8 addrspace(1)* %61 to float addrspace(1)*
- store float %54, float addrspace(1)* %62 , align 4
+ %29 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 24
+ %30 = load float, ptr addrspace(1) %29 , align 4
+ %31 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 12
+ %32 = load float, ptr addrspace(1) %31 , align 4
+ %33 = fmul float %30, %32
+ %34 = fadd float %33, 0.000000e+00
+ %35 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 32
+ %36 = load float, ptr addrspace(1) %35 , align 4
+ %37 = fmul float %24, %36
+ %38 = fadd float %37, 0.000000e+00
+ %39 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 20
+ %40 = load float, ptr addrspace(1) %39 , align 4
+ %41 = fmul float %30, %40
+ %42 = fadd float %41, 0.000000e+00
+ store float %8, ptr addrspace(1) %3 , align 4
+ store float %14, ptr addrspace(1) %9 , align 4
+ %43 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 16
+ store float %18, ptr addrspace(1) %43 , align 4
+ %44 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 20
+ store float %22, ptr addrspace(1) %44 , align 4
+ store float %28, ptr addrspace(1) %29 , align 4
+ store float %34, ptr addrspace(1) %23 , align 4
+ %45 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 32
+ store float %38, ptr addrspace(1) %45 , align 4
+ %46 = getelementptr inbounds i8, ptr addrspace(1) %0, i64 36
+ store float %42, ptr addrspace(1) %46 , align 4
ret void
}
More information about the llvm-commits
mailing list