summaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstSimplify
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstSimplify')
-rw-r--r--test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll2
-rw-r--r--test/Transforms/InstSimplify/call-callconv.ll4
-rw-r--r--test/Transforms/InstSimplify/call.ll6
-rw-r--r--test/Transforms/InstSimplify/compare.ll100
-rw-r--r--test/Transforms/InstSimplify/gep.ll14
-rw-r--r--test/Transforms/InstSimplify/load.ll4
-rw-r--r--test/Transforms/InstSimplify/noalias-ptr.ll18
-rw-r--r--test/Transforms/InstSimplify/past-the-end.ll14
-rw-r--r--test/Transforms/InstSimplify/ptr_diff.ll32
-rw-r--r--test/Transforms/InstSimplify/vector_gep.ll14
-rw-r--r--test/Transforms/InstSimplify/vector_ptr_bitcast.ll4
11 files changed, 106 insertions, 106 deletions
diff --git a/test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll b/test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll
index a10081a..5380a7b 100644
--- a/test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll
+++ b/test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll
@@ -6,7 +6,7 @@
@_ZN11xercesc_2_5L15gCombiningCharsE = external constant [163 x i16], align 2
define i32 @_ZN11xercesc_2_515XMLRangeFactory11buildRangesEv(i32 %x) {
- %a = add i32 %x, add (i32 add (i32 ashr (i32 add (i32 mul (i32 ptrtoint ([32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE, i32 0, i32 30) to i32)), i32 1), i32 ashr (i32 add (i32 mul (i32 ptrtoint ([7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE, i32 0, i32 4) to i32)), i32 1)), i32 8)
+ %a = add i32 %x, add (i32 add (i32 ashr (i32 add (i32 mul (i32 ptrtoint ([32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([32 x i16], [32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE, i32 0, i32 30) to i32)), i32 1), i32 ashr (i32 add (i32 mul (i32 ptrtoint ([7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([7 x i16], [7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE, i32 0, i32 4) to i32)), i32 1)), i32 8)
%b = add i32 %a, %x
ret i32 %b
}
diff --git a/test/Transforms/InstSimplify/call-callconv.ll b/test/Transforms/InstSimplify/call-callconv.ll
index e475be7..56a8e44 100644
--- a/test/Transforms/InstSimplify/call-callconv.ll
+++ b/test/Transforms/InstSimplify/call-callconv.ll
@@ -29,7 +29,7 @@ declare arm_aapcscc i32 @labs(i32) nounwind readnone
define arm_aapcscc i32 @_strlen1() {
; CHECK: _strlen1
- %call = tail call arm_aapcscc i32 @strlen(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0))
+ %call = tail call arm_aapcscc i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0))
ret i32 %call
; CHECK: ret i32 3
}
@@ -42,7 +42,7 @@ define arm_aapcscc zeroext i1 @_strlen2(i8* %str) {
%cmp = icmp ne i32 %call, 0
ret i1 %cmp
-; CHECK: %[[STRLENFIRST:.*]] = load i8* %str
+; CHECK: %[[STRLENFIRST:.*]] = load i8, i8* %str
; CHECK: %[[CMP:.*]] = icmp ne i8 %[[STRLENFIRST]], 0
; CHECK: ret i1 %[[CMP]]
}
diff --git a/test/Transforms/InstSimplify/call.ll b/test/Transforms/InstSimplify/call.ll
index fd854c5..ac94e75 100644
--- a/test/Transforms/InstSimplify/call.ll
+++ b/test/Transforms/InstSimplify/call.ll
@@ -109,7 +109,7 @@ entry:
br i1 %cmp, label %cast.end, label %cast.notnull
cast.notnull: ; preds = %entry
- %add.ptr = getelementptr inbounds i8* %call, i64 4
+ %add.ptr = getelementptr inbounds i8, i8* %call, i64 4
br label %cast.end
cast.end: ; preds = %cast.notnull, %entry
@@ -132,7 +132,7 @@ entry:
br i1 %cmp, label %cast.end, label %cast.notnull
cast.notnull: ; preds = %entry
- %add.ptr = getelementptr inbounds i8* %call, i64 4
+ %add.ptr = getelementptr inbounds i8, i8* %call, i64 4
br label %cast.end
cast.end: ; preds = %cast.notnull, %entry
@@ -152,7 +152,7 @@ entry:
br i1 %cmp, label %cast.end, label %cast.notnull
cast.notnull: ; preds = %entry
- %add.ptr = getelementptr inbounds i8* %call, i64 4
+ %add.ptr = getelementptr inbounds i8, i8* %call, i64 4
br label %cast.end
cast.end: ; preds = %cast.notnull, %entry
diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll
index 10c7ca6..07c90d8 100644
--- a/test/Transforms/InstSimplify/compare.ll
+++ b/test/Transforms/InstSimplify/compare.ll
@@ -24,7 +24,7 @@ define i1 @bitcast() {
define i1 @gep() {
; CHECK-LABEL: @gep(
%a = alloca [3 x i8], align 8
- %x = getelementptr inbounds [3 x i8]* %a, i32 0, i32 0
+ %x = getelementptr inbounds [3 x i8], [3 x i8]* %a, i32 0, i32 0
%cmp = icmp eq i8* %x, null
ret i1 %cmp
; CHECK-NEXT: ret i1 false
@@ -33,8 +33,8 @@ define i1 @gep() {
define i1 @gep2() {
; CHECK-LABEL: @gep2(
%a = alloca [3 x i8], align 8
- %x = getelementptr inbounds [3 x i8]* %a, i32 0, i32 0
- %y = getelementptr inbounds [3 x i8]* %a, i32 0, i32 0
+ %x = getelementptr inbounds [3 x i8], [3 x i8]* %a, i32 0, i32 0
+ %y = getelementptr inbounds [3 x i8], [3 x i8]* %a, i32 0, i32 0
%cmp = icmp eq i8* %x, %y
ret i1 %cmp
; CHECK-NEXT: ret i1 true
@@ -48,8 +48,8 @@ define i1 @gep2() {
define i1 @gep3() {
; CHECK-LABEL: @gep3(
%x = alloca %gept, align 8
- %a = getelementptr %gept* %x, i64 0, i32 0
- %b = getelementptr %gept* %x, i64 0, i32 1
+ %a = getelementptr %gept, %gept* %x, i64 0, i32 0
+ %b = getelementptr %gept, %gept* %x, i64 0, i32 1
%equal = icmp eq i32* %a, %b
ret i1 %equal
; CHECK-NEXT: ret i1 false
@@ -58,8 +58,8 @@ define i1 @gep3() {
define i1 @gep4() {
; CHECK-LABEL: @gep4(
%x = alloca %gept, align 8
- %a = getelementptr %gept* @gepy, i64 0, i32 0
- %b = getelementptr %gept* @gepy, i64 0, i32 1
+ %a = getelementptr %gept, %gept* @gepy, i64 0, i32 0
+ %b = getelementptr %gept, %gept* @gepy, i64 0, i32 1
%equal = icmp eq i32* %a, %b
ret i1 %equal
; CHECK-NEXT: ret i1 false
@@ -68,8 +68,8 @@ define i1 @gep4() {
define i1 @gep5() {
; CHECK-LABEL: @gep5(
%x = alloca %gept, align 8
- %a = getelementptr inbounds %gept* %x, i64 0, i32 1
- %b = getelementptr %gept* @gepy, i64 0, i32 0
+ %a = getelementptr inbounds %gept, %gept* %x, i64 0, i32 1
+ %b = getelementptr %gept, %gept* @gepy, i64 0, i32 0
%equal = icmp eq i32* %a, %b
ret i1 %equal
; CHECK-NEXT: ret i1 false
@@ -78,8 +78,8 @@ define i1 @gep5() {
define i1 @gep6(%gept* %x) {
; Same as @gep3 but potentially null.
; CHECK-LABEL: @gep6(
- %a = getelementptr %gept* %x, i64 0, i32 0
- %b = getelementptr %gept* %x, i64 0, i32 1
+ %a = getelementptr %gept, %gept* %x, i64 0, i32 0
+ %b = getelementptr %gept, %gept* %x, i64 0, i32 1
%equal = icmp eq i32* %a, %b
ret i1 %equal
; CHECK-NEXT: ret i1 false
@@ -87,8 +87,8 @@ define i1 @gep6(%gept* %x) {
define i1 @gep7(%gept* %x) {
; CHECK-LABEL: @gep7(
- %a = getelementptr %gept* %x, i64 0, i32 0
- %b = getelementptr %gept* @gepz, i64 0, i32 0
+ %a = getelementptr %gept, %gept* %x, i64 0, i32 0
+ %b = getelementptr %gept, %gept* @gepz, i64 0, i32 0
%equal = icmp eq i32* %a, %b
ret i1 %equal
; CHECK: ret i1 %equal
@@ -96,8 +96,8 @@ define i1 @gep7(%gept* %x) {
define i1 @gep8(%gept* %x) {
; CHECK-LABEL: @gep8(
- %a = getelementptr %gept* %x, i32 1
- %b = getelementptr %gept* %x, i32 -1
+ %a = getelementptr %gept, %gept* %x, i32 1
+ %b = getelementptr %gept, %gept* %x, i32 -1
%equal = icmp ugt %gept* %a, %b
ret i1 %equal
; CHECK: ret i1 %equal
@@ -109,14 +109,14 @@ define i1 @gep9(i8* %ptr) {
; CHECK: ret i1 true
entry:
- %first1 = getelementptr inbounds i8* %ptr, i32 0
- %first2 = getelementptr inbounds i8* %first1, i32 1
- %first3 = getelementptr inbounds i8* %first2, i32 2
- %first4 = getelementptr inbounds i8* %first3, i32 4
- %last1 = getelementptr inbounds i8* %first2, i32 48
- %last2 = getelementptr inbounds i8* %last1, i32 8
- %last3 = getelementptr inbounds i8* %last2, i32 -4
- %last4 = getelementptr inbounds i8* %last3, i32 -4
+ %first1 = getelementptr inbounds i8, i8* %ptr, i32 0
+ %first2 = getelementptr inbounds i8, i8* %first1, i32 1
+ %first3 = getelementptr inbounds i8, i8* %first2, i32 2
+ %first4 = getelementptr inbounds i8, i8* %first3, i32 4
+ %last1 = getelementptr inbounds i8, i8* %first2, i32 48
+ %last2 = getelementptr inbounds i8, i8* %last1, i32 8
+ %last3 = getelementptr inbounds i8, i8* %last2, i32 -4
+ %last4 = getelementptr inbounds i8, i8* %last3, i32 -4
%first.int = ptrtoint i8* %first4 to i32
%last.int = ptrtoint i8* %last4 to i32
%cmp = icmp ne i32 %last.int, %first.int
@@ -129,10 +129,10 @@ define i1 @gep10(i8* %ptr) {
; CHECK: ret i1 true
entry:
- %first1 = getelementptr inbounds i8* %ptr, i32 -2
- %first2 = getelementptr inbounds i8* %first1, i32 44
- %last1 = getelementptr inbounds i8* %ptr, i32 48
- %last2 = getelementptr inbounds i8* %last1, i32 -6
+ %first1 = getelementptr inbounds i8, i8* %ptr, i32 -2
+ %first2 = getelementptr inbounds i8, i8* %first1, i32 44
+ %last1 = getelementptr inbounds i8, i8* %ptr, i32 48
+ %last2 = getelementptr inbounds i8, i8* %last1, i32 -6
%first.int = ptrtoint i8* %first2 to i32
%last.int = ptrtoint i8* %last2 to i32
%cmp = icmp eq i32 %last.int, %first.int
@@ -145,9 +145,9 @@ define i1 @gep11(i8* %ptr) {
; CHECK: ret i1 true
entry:
- %first1 = getelementptr inbounds i8* %ptr, i32 -2
- %last1 = getelementptr inbounds i8* %ptr, i32 48
- %last2 = getelementptr inbounds i8* %last1, i32 -6
+ %first1 = getelementptr inbounds i8, i8* %ptr, i32 -2
+ %last1 = getelementptr inbounds i8, i8* %ptr, i32 48
+ %last2 = getelementptr inbounds i8, i8* %last1, i32 -6
%cmp = icmp ult i8* %first1, %last2
ret i1 %cmp
}
@@ -158,9 +158,9 @@ define i1 @gep12(i8* %ptr) {
; CHECK: ret i1 %cmp
entry:
- %first1 = getelementptr inbounds i8* %ptr, i32 -2
- %last1 = getelementptr inbounds i8* %ptr, i32 48
- %last2 = getelementptr inbounds i8* %last1, i32 -6
+ %first1 = getelementptr inbounds i8, i8* %ptr, i32 -2
+ %last1 = getelementptr inbounds i8, i8* %ptr, i32 48
+ %last2 = getelementptr inbounds i8, i8* %last1, i32 -6
%cmp = icmp slt i8* %first1, %last2
ret i1 %cmp
}
@@ -168,7 +168,7 @@ entry:
define i1 @gep13(i8* %ptr) {
; CHECK-LABEL: @gep13(
; We can prove this GEP is non-null because it is inbounds.
- %x = getelementptr inbounds i8* %ptr, i32 1
+ %x = getelementptr inbounds i8, i8* %ptr, i32 1
%cmp = icmp eq i8* %x, null
ret i1 %cmp
; CHECK-NEXT: ret i1 false
@@ -178,7 +178,7 @@ define i1 @gep14({ {}, i8 }* %ptr) {
; CHECK-LABEL: @gep14(
; We can't simplify this because the offset of one in the GEP actually doesn't
; move the pointer.
- %x = getelementptr inbounds { {}, i8 }* %ptr, i32 0, i32 1
+ %x = getelementptr inbounds { {}, i8 }, { {}, i8 }* %ptr, i32 0, i32 1
%cmp = icmp eq i8* %x, null
ret i1 %cmp
; CHECK-NOT: ret i1 false
@@ -188,7 +188,7 @@ define i1 @gep15({ {}, [4 x {i8, i8}]}* %ptr, i32 %y) {
; CHECK-LABEL: @gep15(
; We can prove this GEP is non-null even though there is a user value, as we
; would necessarily violate inbounds on one side or the other.
- %x = getelementptr inbounds { {}, [4 x {i8, i8}]}* %ptr, i32 0, i32 1, i32 %y, i32 1
+ %x = getelementptr inbounds { {}, [4 x {i8, i8}]}, { {}, [4 x {i8, i8}]}* %ptr, i32 0, i32 1, i32 %y, i32 1
%cmp = icmp eq i8* %x, null
ret i1 %cmp
; CHECK-NEXT: ret i1 false
@@ -199,7 +199,7 @@ define i1 @gep16(i8* %ptr, i32 %a) {
; We can prove this GEP is non-null because it is inbounds and because we know
; %b is non-zero even though we don't know its value.
%b = or i32 %a, 1
- %x = getelementptr inbounds i8* %ptr, i32 %b
+ %x = getelementptr inbounds i8, i8* %ptr, i32 %b
%cmp = icmp eq i8* %x, null
ret i1 %cmp
; CHECK-NEXT: ret i1 false
@@ -687,7 +687,7 @@ define <2 x i1> @vectorselectcrash(i32 %arg1) {
; PR12013
define i1 @alloca_compare(i64 %idx) {
%sv = alloca { i32, i32, [124 x i32] }
- %1 = getelementptr inbounds { i32, i32, [124 x i32] }* %sv, i32 0, i32 2, i64 %idx
+ %1 = getelementptr inbounds { i32, i32, [124 x i32] }, { i32, i32, [124 x i32] }* %sv, i32 0, i32 2, i64 %idx
%2 = icmp eq i32* %1, null
ret i1 %2
; CHECK: alloca_compare
@@ -699,7 +699,7 @@ define i1 @infinite_gep() {
ret i1 1
unreachableblock:
- %X = getelementptr i32 *%X, i32 1
+ %X = getelementptr i32, i32 *%X, i32 1
%Y = icmp eq i32* %X, null
ret i1 %Y
}
@@ -744,7 +744,7 @@ define i1 @alloca_gep(i64 %a, i64 %b) {
; We can prove this GEP is non-null because it is inbounds and the pointer
; is non-null.
%strs = alloca [1000 x [1001 x i8]], align 16
- %x = getelementptr inbounds [1000 x [1001 x i8]]* %strs, i64 0, i64 %a, i64 %b
+ %x = getelementptr inbounds [1000 x [1001 x i8]], [1000 x [1001 x i8]]* %strs, i64 0, i64 %a, i64 %b
%cmp = icmp eq i8* %x, null
ret i1 %cmp
; CHECK-NEXT: ret i1 false
@@ -753,10 +753,10 @@ define i1 @alloca_gep(i64 %a, i64 %b) {
define i1 @non_inbounds_gep_compare(i64* %a) {
; CHECK-LABEL: @non_inbounds_gep_compare(
; Equality compares with non-inbounds GEPs can be folded.
- %x = getelementptr i64* %a, i64 42
- %y = getelementptr inbounds i64* %x, i64 -42
- %z = getelementptr i64* %a, i64 -42
- %w = getelementptr inbounds i64* %z, i64 42
+ %x = getelementptr i64, i64* %a, i64 42
+ %y = getelementptr inbounds i64, i64* %x, i64 -42
+ %z = getelementptr i64, i64* %a, i64 -42
+ %w = getelementptr inbounds i64, i64* %z, i64 42
%cmp = icmp eq i64* %y, %w
ret i1 %cmp
; CHECK-NEXT: ret i1 true
@@ -765,8 +765,8 @@ define i1 @non_inbounds_gep_compare(i64* %a) {
define i1 @non_inbounds_gep_compare2(i64* %a) {
; CHECK-LABEL: @non_inbounds_gep_compare2(
; Equality compares with non-inbounds GEPs can be folded.
- %x = getelementptr i64* %a, i64 4294967297
- %y = getelementptr i64* %a, i64 1
+ %x = getelementptr i64, i64* %a, i64 4294967297
+ %y = getelementptr i64, i64* %a, i64 1
%cmp = icmp eq i64* %y, %y
ret i1 %cmp
; CHECK-NEXT: ret i1 true
@@ -918,7 +918,7 @@ define i1 @nonnull_deref_as_arg(i32 addrspace(1)* dereferenceable(4) %i) {
ret i1 %cmp
; CHECK-LABEL: @nonnull_deref_as_arg
; CHECK: icmp
-; CHECK ret
+; CHECK: ret
}
declare nonnull i32* @returns_nonnull_helper()
@@ -950,7 +950,7 @@ define i1 @returns_nonnull_as_deref() {
}
define i1 @nonnull_load(i32** %addr) {
- %ptr = load i32** %addr, !nonnull !{}
+ %ptr = load i32*, i32** %addr, !nonnull !{}
%cmp = icmp eq i32* %ptr, null
ret i1 %cmp
; CHECK-LABEL: @nonnull_load
@@ -958,14 +958,14 @@ define i1 @nonnull_load(i32** %addr) {
}
define i1 @nonnull_load_as_outer(i32* addrspace(1)* %addr) {
- %ptr = load i32* addrspace(1)* %addr, !nonnull !{}
+ %ptr = load i32*, i32* addrspace(1)* %addr, !nonnull !{}
%cmp = icmp eq i32* %ptr, null
ret i1 %cmp
; CHECK-LABEL: @nonnull_load_as_outer
; CHECK: ret i1 false
}
define i1 @nonnull_load_as_inner(i32 addrspace(1)** %addr) {
- %ptr = load i32 addrspace(1)** %addr, !nonnull !{}
+ %ptr = load i32 addrspace(1)*, i32 addrspace(1)** %addr, !nonnull !{}
%cmp = icmp eq i32 addrspace(1)* %ptr, null
ret i1 %cmp
; CHECK-LABEL: @nonnull_load_as_inner
diff --git a/test/Transforms/InstSimplify/gep.ll b/test/Transforms/InstSimplify/gep.ll
index 49a97f1..13640e7 100644
--- a/test/Transforms/InstSimplify/gep.ll
+++ b/test/Transforms/InstSimplify/gep.ll
@@ -9,7 +9,7 @@ define %struct.A* @test1(%struct.A* %b, %struct.A* %e) {
%b_ptr = ptrtoint %struct.A* %b to i64
%sub = sub i64 %e_ptr, %b_ptr
%sdiv = sdiv exact i64 %sub, 7
- %gep = getelementptr inbounds %struct.A* %b, i64 %sdiv
+ %gep = getelementptr inbounds %struct.A, %struct.A* %b, i64 %sdiv
ret %struct.A* %gep
; CHECK-LABEL: @test1
; CHECK-NEXT: ret %struct.A* %e
@@ -19,7 +19,7 @@ define i8* @test2(i8* %b, i8* %e) {
%e_ptr = ptrtoint i8* %e to i64
%b_ptr = ptrtoint i8* %b to i64
%sub = sub i64 %e_ptr, %b_ptr
- %gep = getelementptr inbounds i8* %b, i64 %sub
+ %gep = getelementptr inbounds i8, i8* %b, i64 %sub
ret i8* %gep
; CHECK-LABEL: @test2
; CHECK-NEXT: ret i8* %e
@@ -30,7 +30,7 @@ define i64* @test3(i64* %b, i64* %e) {
%b_ptr = ptrtoint i64* %b to i64
%sub = sub i64 %e_ptr, %b_ptr
%ashr = ashr exact i64 %sub, 3
- %gep = getelementptr inbounds i64* %b, i64 %ashr
+ %gep = getelementptr inbounds i64, i64* %b, i64 %ashr
ret i64* %gep
; CHECK-LABEL: @test3
; CHECK-NEXT: ret i64* %e
@@ -40,7 +40,7 @@ define %struct.A* @test4(%struct.A* %b) {
%b_ptr = ptrtoint %struct.A* %b to i64
%sub = sub i64 0, %b_ptr
%sdiv = sdiv exact i64 %sub, 7
- %gep = getelementptr inbounds %struct.A* %b, i64 %sdiv
+ %gep = getelementptr inbounds %struct.A, %struct.A* %b, i64 %sdiv
ret %struct.A* %gep
; CHECK-LABEL: @test4
; CHECK-NEXT: ret %struct.A* null
@@ -49,7 +49,7 @@ define %struct.A* @test4(%struct.A* %b) {
define i8* @test5(i8* %b) {
%b_ptr = ptrtoint i8* %b to i64
%sub = sub i64 0, %b_ptr
- %gep = getelementptr inbounds i8* %b, i64 %sub
+ %gep = getelementptr inbounds i8, i8* %b, i64 %sub
ret i8* %gep
; CHECK-LABEL: @test5
; CHECK-NEXT: ret i8* null
@@ -59,7 +59,7 @@ define i64* @test6(i64* %b) {
%b_ptr = ptrtoint i64* %b to i64
%sub = sub i64 0, %b_ptr
%ashr = ashr exact i64 %sub, 3
- %gep = getelementptr inbounds i64* %b, i64 %ashr
+ %gep = getelementptr inbounds i64, i64* %b, i64 %ashr
ret i64* %gep
; CHECK-LABEL: @test6
; CHECK-NEXT: ret i64* null
@@ -69,7 +69,7 @@ define i8* @test7(i8* %b, i8** %e) {
%e_ptr = ptrtoint i8** %e to i64
%b_ptr = ptrtoint i8* %b to i64
%sub = sub i64 %e_ptr, %b_ptr
- %gep = getelementptr inbounds i8* %b, i64 %sub
+ %gep = getelementptr inbounds i8, i8* %b, i64 %sub
ret i8* %gep
; CHECK-LABEL: @test7
; CHECK-NEXT: ptrtoint
diff --git a/test/Transforms/InstSimplify/load.ll b/test/Transforms/InstSimplify/load.ll
index 92953cd..ab87d4b 100644
--- a/test/Transforms/InstSimplify/load.ll
+++ b/test/Transforms/InstSimplify/load.ll
@@ -6,14 +6,14 @@
define i32 @crash_on_zeroinit() {
; CHECK-LABEL: @crash_on_zeroinit
; CHECK: ret i32 0
- %load = load i32* bitcast ({}* @zeroinit to i32*)
+ %load = load i32, i32* bitcast ({}* @zeroinit to i32*)
ret i32 %load
}
define i32 @crash_on_undef() {
; CHECK-LABEL: @crash_on_undef
; CHECK: ret i32 undef
- %load = load i32* bitcast ({}* @undef to i32*)
+ %load = load i32, i32* bitcast ({}* @undef to i32*)
ret i32 %load
}
diff --git a/test/Transforms/InstSimplify/noalias-ptr.ll b/test/Transforms/InstSimplify/noalias-ptr.ll
index 7693e55..59b1dfa 100644
--- a/test/Transforms/InstSimplify/noalias-ptr.ll
+++ b/test/Transforms/InstSimplify/noalias-ptr.ll
@@ -26,7 +26,7 @@ define void @_Z2p1v() #0 {
%1 = bitcast [10 x i32]* %mStackData to i8*
%2 = tail call noalias i8* @_Znam(i64 48) #4
%3 = bitcast i8* %2 to i32*
- %4 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %4 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%5 = icmp eq i32* %3, %4
br i1 %5, label %7, label %6
@@ -47,7 +47,7 @@ define void @_Z2p1v() #0 {
define void @_Z2p2bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
%mStackData = alloca [10 x i32], align 16
%1 = bitcast [10 x i32]* %mStackData to i8*
- %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%3 = select i1 %b1, i32* %2, i32* @g2
%4 = tail call noalias i8* @_Znam(i64 48) #4
%5 = tail call noalias i8* @_Znam(i64 48) #4
@@ -72,7 +72,7 @@ define void @_Z2p2bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
define void @_Z2p4bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
%mStackData = alloca [10 x i32], align 16
%1 = bitcast [10 x i32]* %mStackData to i8*
- %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%3 = select i1 %b1, i32* %2, i32* @g3
%4 = tail call noalias i8* @_Znam(i64 48) #4
%5 = tail call noalias i8* @_Znam(i64 48) #4
@@ -97,7 +97,7 @@ define void @_Z2p4bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
define void @_Z2p5bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
%mStackData = alloca [10 x i32], align 16
%1 = bitcast [10 x i32]* %mStackData to i8*
- %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%3 = select i1 %b1, i32* %2, i32* @g4
%4 = tail call noalias i8* @_Znam(i64 48) #4
%5 = tail call noalias i8* @_Znam(i64 48) #4
@@ -122,7 +122,7 @@ define void @_Z2p5bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
define void @_Z2p6bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
%mStackData = alloca [10 x i32], align 16
%1 = bitcast [10 x i32]* %mStackData to i8*
- %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%3 = select i1 %b1, i32* %2, i32* @g5
%4 = tail call noalias i8* @_Znam(i64 48) #4
%5 = tail call noalias i8* @_Znam(i64 48) #4
@@ -151,7 +151,7 @@ define void @_Z2p6bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
define void @_Z4nopebbPi(i1 zeroext %b1, i1 zeroext %b2, i32* readnone %q) #0 {
%mStackData = alloca [10 x i32], align 16
%1 = bitcast [10 x i32]* %mStackData to i8*
- %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%3 = select i1 %b1, i32* %2, i32* %q
%4 = tail call noalias i8* @_Znam(i64 48) #4
%5 = tail call noalias i8* @_Znam(i64 48) #4
@@ -176,7 +176,7 @@ define void @_Z4nopebbPi(i1 zeroext %b1, i1 zeroext %b2, i32* readnone %q) #0 {
define void @_Z2p3bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
%mStackData = alloca [10 x i32], align 16
%1 = bitcast [10 x i32]* %mStackData to i8*
- %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%3 = select i1 %b1, i32* %2, i32* @g1
%4 = tail call noalias i8* @_Znam(i64 48) #4
%5 = tail call noalias i8* @_Znam(i64 48) #4
@@ -201,7 +201,7 @@ define void @_Z2p3bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
define void @_Z2p7bb(i1 zeroext %b1, i1 zeroext %b2) #0 {
%mStackData = alloca [10 x i32], align 16
%1 = bitcast [10 x i32]* %mStackData to i8*
- %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%3 = select i1 %b1, i32* %2, i32* @g6
%4 = tail call noalias i8* @_Znam(i64 48) #4
%5 = tail call noalias i8* @_Znam(i64 48) #4
@@ -228,7 +228,7 @@ define void @_Z2p2v(i32 %c) #0 {
%1 = bitcast [10 x i32]* %mStackData to i8*
%2 = tail call noalias i8* @_Znam(i64 48) #4
%3 = bitcast i8* %2 to i32*
- %4 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0
+ %4 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0
%5 = icmp eq i32* %3, %4
br i1 %5, label %7, label %6
diff --git a/test/Transforms/InstSimplify/past-the-end.ll b/test/Transforms/InstSimplify/past-the-end.ll
index 075da4a..b676e9d 100644
--- a/test/Transforms/InstSimplify/past-the-end.ll
+++ b/test/Transforms/InstSimplify/past-the-end.ll
@@ -18,8 +18,8 @@ define zeroext i1 @no_offsets() {
; Comparing past-the-end addresses of two distinct globals. Never equal.
define zeroext i1 @both_past_the_end() {
- %x = getelementptr i32* @opte_a, i32 1
- %y = getelementptr i32* @opte_b, i32 1
+ %x = getelementptr i32, i32* @opte_a, i32 1
+ %y = getelementptr i32, i32* @opte_b, i32 1
%t = icmp eq i32* %x, %y
ret i1 %t
; CHECK: both_past_the_end(
@@ -31,11 +31,11 @@ define zeroext i1 @both_past_the_end() {
; of another. Can't fold this.
define zeroext i1 @just_one_past_the_end() {
- %x = getelementptr i32* @opte_a, i32 1
+ %x = getelementptr i32, i32* @opte_a, i32 1
%t = icmp eq i32* %x, @opte_b
ret i1 %t
; CHECK: just_one_past_the_end(
- ; CHECK: ret i1 icmp eq (i32* getelementptr inbounds (i32* @opte_a, i32 1), i32* @opte_b)
+ ; CHECK: ret i1 icmp eq (i32* getelementptr inbounds (i32, i32* @opte_a, i32 1), i32* @opte_b)
}
; Comparing base addresses of two distinct allocas. Never equal.
@@ -54,8 +54,8 @@ define zeroext i1 @no_alloca_offsets() {
define zeroext i1 @both_past_the_end_alloca() {
%m = alloca i32
%n = alloca i32
- %x = getelementptr i32* %m, i32 1
- %y = getelementptr i32* %n, i32 1
+ %x = getelementptr i32, i32* %m, i32 1
+ %y = getelementptr i32, i32* %n, i32 1
%t = icmp eq i32* %x, %y
ret i1 %t
; CHECK: both_past_the_end_alloca(
@@ -69,7 +69,7 @@ define zeroext i1 @both_past_the_end_alloca() {
define zeroext i1 @just_one_past_the_end_alloca() {
%m = alloca i32
%n = alloca i32
- %x = getelementptr i32* %m, i32 1
+ %x = getelementptr i32, i32* %m, i32 1
%t = icmp eq i32* %x, %n
ret i1 %t
; CHECK: just_one_past_the_end_alloca(
diff --git a/test/Transforms/InstSimplify/ptr_diff.ll b/test/Transforms/InstSimplify/ptr_diff.ll
index 6a3f652..6c27e6f 100644
--- a/test/Transforms/InstSimplify/ptr_diff.ll
+++ b/test/Transforms/InstSimplify/ptr_diff.ll
@@ -6,8 +6,8 @@ define i64 @ptrdiff1(i8* %ptr) {
; CHECK-LABEL: @ptrdiff1(
; CHECK-NEXT: ret i64 42
- %first = getelementptr inbounds i8* %ptr, i32 0
- %last = getelementptr inbounds i8* %ptr, i32 42
+ %first = getelementptr inbounds i8, i8* %ptr, i32 0
+ %last = getelementptr inbounds i8, i8* %ptr, i32 42
%first.int = ptrtoint i8* %first to i64
%last.int = ptrtoint i8* %last to i64
%diff = sub i64 %last.int, %first.int
@@ -18,14 +18,14 @@ define i64 @ptrdiff2(i8* %ptr) {
; CHECK-LABEL: @ptrdiff2(
; CHECK-NEXT: ret i64 42
- %first1 = getelementptr inbounds i8* %ptr, i32 0
- %first2 = getelementptr inbounds i8* %first1, i32 1
- %first3 = getelementptr inbounds i8* %first2, i32 2
- %first4 = getelementptr inbounds i8* %first3, i32 4
- %last1 = getelementptr inbounds i8* %first2, i32 48
- %last2 = getelementptr inbounds i8* %last1, i32 8
- %last3 = getelementptr inbounds i8* %last2, i32 -4
- %last4 = getelementptr inbounds i8* %last3, i32 -4
+ %first1 = getelementptr inbounds i8, i8* %ptr, i32 0
+ %first2 = getelementptr inbounds i8, i8* %first1, i32 1
+ %first3 = getelementptr inbounds i8, i8* %first2, i32 2
+ %first4 = getelementptr inbounds i8, i8* %first3, i32 4
+ %last1 = getelementptr inbounds i8, i8* %first2, i32 48
+ %last2 = getelementptr inbounds i8, i8* %last1, i32 8
+ %last3 = getelementptr inbounds i8, i8* %last2, i32 -4
+ %last4 = getelementptr inbounds i8, i8* %last3, i32 -4
%first.int = ptrtoint i8* %first4 to i64
%last.int = ptrtoint i8* %last4 to i64
%diff = sub i64 %last.int, %first.int
@@ -39,8 +39,8 @@ define i64 @ptrdiff3(i8* %ptr) {
; CHECK: sub
; CHECK: ret
- %first = getelementptr i8* %ptr, i32 0
- %last = getelementptr i8* %ptr, i32 42
+ %first = getelementptr i8, i8* %ptr, i32 0
+ %last = getelementptr i8, i8* %ptr, i32 42
%first.int = ptrtoint i8* %first to i64
%last.int = ptrtoint i8* %last to i64
%diff = sub i64 %last.int, %first.int
@@ -64,12 +64,12 @@ define <4 x i32> @ptrdiff4(<4 x i8*> %arg) nounwind {
define i32 @ptrdiff5() nounwind {
bb:
- %tmp = getelementptr inbounds %struct.ham* @global, i32 0, i32 1
- %tmp1 = getelementptr inbounds [2 x [2 x i32]]* %tmp, i32 0, i32 0
+ %tmp = getelementptr inbounds %struct.ham, %struct.ham* @global, i32 0, i32 1
+ %tmp1 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %tmp, i32 0, i32 0
%tmp2 = bitcast [2 x i32]* %tmp1 to i32*
%tmp3 = ptrtoint i32* %tmp2 to i32
- %tmp4 = getelementptr inbounds %struct.ham* @global, i32 0, i32 1
- %tmp5 = getelementptr inbounds [2 x [2 x i32]]* %tmp4, i32 0, i32 0
+ %tmp4 = getelementptr inbounds %struct.ham, %struct.ham* @global, i32 0, i32 1
+ %tmp5 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %tmp4, i32 0, i32 0
%tmp6 = ptrtoint [2 x i32]* %tmp5 to i32
%tmp7 = sub i32 %tmp3, %tmp6
ret i32 %tmp7
diff --git a/test/Transforms/InstSimplify/vector_gep.ll b/test/Transforms/InstSimplify/vector_gep.ll
index 1781463..5c30620 100644
--- a/test/Transforms/InstSimplify/vector_gep.ll
+++ b/test/Transforms/InstSimplify/vector_gep.ll
@@ -4,13 +4,13 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
declare void @helper(<2 x i8*>)
define void @test(<2 x i8*> %a) {
- %A = getelementptr <2 x i8*> %a, <2 x i32> <i32 0, i32 0>
+ %A = getelementptr i8, <2 x i8*> %a, <2 x i32> <i32 0, i32 0>
call void @helper(<2 x i8*> %A)
ret void
}
define <4 x i8*> @test1(<4 x i8*> %a) {
- %gep = getelementptr <4 x i8*> %a, <4 x i32> zeroinitializer
+ %gep = getelementptr i8, <4 x i8*> %a, <4 x i32> zeroinitializer
ret <4 x i8*> %gep
; CHECK-LABEL: @test1
@@ -18,7 +18,7 @@ define <4 x i8*> @test1(<4 x i8*> %a) {
}
define <4 x i8*> @test2(<4 x i8*> %a) {
- %gep = getelementptr <4 x i8*> %a
+ %gep = getelementptr i8, <4 x i8*> %a
ret <4 x i8*> %gep
; CHECK-LABEL: @test2
@@ -28,7 +28,7 @@ define <4 x i8*> @test2(<4 x i8*> %a) {
%struct = type { double, float }
define <4 x float*> @test3() {
- %gep = getelementptr <4 x %struct*> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
+ %gep = getelementptr %struct, <4 x %struct*> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
ret <4 x float*> %gep
; CHECK-LABEL: @test3
@@ -38,7 +38,7 @@ define <4 x float*> @test3() {
%struct.empty = type { }
define <4 x %struct.empty*> @test4(<4 x %struct.empty*> %a) {
- %gep = getelementptr <4 x %struct.empty*> %a, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
+ %gep = getelementptr %struct.empty, <4 x %struct.empty*> %a, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
ret <4 x %struct.empty*> %gep
; CHECK-LABEL: @test4
@@ -47,9 +47,9 @@ define <4 x %struct.empty*> @test4(<4 x %struct.empty*> %a) {
define <4 x i8*> @test5() {
%c = inttoptr <4 x i64> <i64 1, i64 2, i64 3, i64 4> to <4 x i8*>
- %gep = getelementptr <4 x i8*> %c, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
+ %gep = getelementptr i8, <4 x i8*> %c, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
ret <4 x i8*> %gep
; CHECK-LABEL: @test5
-; CHECK-NEXT: ret <4 x i8*> getelementptr (<4 x i8*> <i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 2 to i8*), i8* inttoptr (i64 3 to i8*), i8* inttoptr (i64 4 to i8*)>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>)
+; CHECK-NEXT: ret <4 x i8*> getelementptr (i8, <4 x i8*> <i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 2 to i8*), i8* inttoptr (i64 3 to i8*), i8* inttoptr (i64 4 to i8*)>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>)
}
diff --git a/test/Transforms/InstSimplify/vector_ptr_bitcast.ll b/test/Transforms/InstSimplify/vector_ptr_bitcast.ll
index 607892a..97c8343 100644
--- a/test/Transforms/InstSimplify/vector_ptr_bitcast.ll
+++ b/test/Transforms/InstSimplify/vector_ptr_bitcast.ll
@@ -14,7 +14,7 @@ target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
align 8
define i64 @fn() {
- %x = load <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8
+ %x = load <2 x i8*>, <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8
%b = extractelement <2 x i8*> %x, i32 0
%c = ptrtoint i8* %b to i64
; CHECK-LABEL: @fn
@@ -23,7 +23,7 @@ define i64 @fn() {
}
define i64 @fn2() {
- %x = load <4 x i32*>* bitcast (%mst2* @b to <4 x i32*>*), align 8
+ %x = load <4 x i32*>, <4 x i32*>* bitcast (%mst2* @b to <4 x i32*>*), align 8
%b = extractelement <4 x i32*> %x, i32 0
%c = extractelement <4 x i32*> %x, i32 3
%d = ptrtoint i32* %b to i64