aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/cast.ll
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-04-10 22:08:18 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-10 22:08:18 +0000
commit13a7db5b9c4f5e543d037be68ec3428216bfd550 (patch)
tree1b2c9792582e12f5af0b1512e3094425f0dc0df9 /test/Transforms/InstCombine/cast.ll
parent0eb46f5d1e06a4284663d636a74b06adc3a161d7 (diff)
parent31195f0bdca6ee2a5e72d07edf13e1d81206d949 (diff)
downloadexternal_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.zip
external_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.tar.gz
external_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.tar.bz2
am 31195f0b: Merge "Update aosp/master llvm for rebase to r233350"
* commit '31195f0bdca6ee2a5e72d07edf13e1d81206d949': Update aosp/master llvm for rebase to r233350
Diffstat (limited to 'test/Transforms/InstCombine/cast.ll')
-rw-r--r--test/Transforms/InstCombine/cast.ll160
1 files changed, 80 insertions, 80 deletions
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll
index aac7a53..c577501 100644
--- a/test/Transforms/InstCombine/cast.ll
+++ b/test/Transforms/InstCombine/cast.ll
@@ -120,9 +120,9 @@ lpad: ; preds = %entry
}
define i8* @test13(i64 %A) {
- %c = getelementptr [0 x i8]* bitcast ([32832 x i8]* @inbuf to [0 x i8]*), i64 0, i64 %A ; <i8*> [#uses=1]
+ %c = getelementptr [0 x i8], [0 x i8]* bitcast ([32832 x i8]* @inbuf to [0 x i8]*), i64 0, i64 %A ; <i8*> [#uses=1]
ret i8* %c
-; CHECK: %c = getelementptr [32832 x i8]* @inbuf, i64 0, i64 %A
+; CHECK: %c = getelementptr [32832 x i8], [32832 x i8]* @inbuf, i64 0, i64 %A
; CHECK: ret i8* %c
}
@@ -231,14 +231,14 @@ define i32 @test26(float %F) {
define [4 x float]* @test27([9 x [4 x float]]* %A) {
%c = bitcast [9 x [4 x float]]* %A to [4 x float]* ; <[4 x float]*> [#uses=1]
ret [4 x float]* %c
-; CHECK: %c = getelementptr inbounds [9 x [4 x float]]* %A, i64 0, i64 0
+; CHECK: %c = getelementptr inbounds [9 x [4 x float]], [9 x [4 x float]]* %A, i64 0, i64 0
; CHECK: ret [4 x float]* %c
}
define float* @test28([4 x float]* %A) {
%c = bitcast [4 x float]* %A to float* ; <float*> [#uses=1]
ret float* %c
-; CHECK: %c = getelementptr inbounds [4 x float]* %A, i64 0, i64 0
+; CHECK: %c = getelementptr inbounds [4 x float], [4 x float]* %A, i64 0, i64 0
; CHECK: ret float* %c
}
@@ -359,7 +359,7 @@ define i16 @test40(i16 %a) {
; PR1263
define i32* @test41(i32* %tmp1) {
%tmp64 = bitcast i32* %tmp1 to { i32 }*
- %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0
+ %tmp65 = getelementptr { i32 }, { i32 }* %tmp64, i32 0, i32 0
ret i32* %tmp65
; CHECK-LABEL: @test41(
; CHECK: ret i32* %tmp1
@@ -367,7 +367,7 @@ define i32* @test41(i32* %tmp1) {
define i32 addrspace(1)* @test41_addrspacecast_smaller(i32* %tmp1) {
%tmp64 = addrspacecast i32* %tmp1 to { i32 } addrspace(1)*
- %tmp65 = getelementptr { i32 } addrspace(1)* %tmp64, i32 0, i32 0
+ %tmp65 = getelementptr { i32 }, { i32 } addrspace(1)* %tmp64, i32 0, i32 0
ret i32 addrspace(1)* %tmp65
; CHECK-LABEL: @test41_addrspacecast_smaller(
; CHECK: addrspacecast i32* %tmp1 to i32 addrspace(1)*
@@ -376,7 +376,7 @@ define i32 addrspace(1)* @test41_addrspacecast_smaller(i32* %tmp1) {
define i32* @test41_addrspacecast_larger(i32 addrspace(1)* %tmp1) {
%tmp64 = addrspacecast i32 addrspace(1)* %tmp1 to { i32 }*
- %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0
+ %tmp65 = getelementptr { i32 }, { i32 }* %tmp64, i32 0, i32 0
ret i32* %tmp65
; CHECK-LABEL: @test41_addrspacecast_larger(
; CHECK: addrspacecast i32 addrspace(1)* %tmp1 to i32*
@@ -728,11 +728,11 @@ define %s @test68(%s *%p, i64 %i) {
; CHECK-LABEL: @test68(
%o = mul i64 %i, 12
%q = bitcast %s* %p to i8*
- %pp = getelementptr inbounds i8* %q, i64 %o
-; CHECK-NEXT: getelementptr %s*
+ %pp = getelementptr inbounds i8, i8* %q, i64 %o
+; CHECK-NEXT: getelementptr %s, %s*
%r = bitcast i8* %pp to %s*
- %l = load %s* %r
-; CHECK-NEXT: load %s*
+ %l = load %s, %s* %r
+; CHECK-NEXT: load %s, %s*
ret %s %l
; CHECK-NEXT: ret %s
}
@@ -740,28 +740,28 @@ define %s @test68(%s *%p, i64 %i) {
; addrspacecasts should be eliminated.
define %s @test68_addrspacecast(%s* %p, i64 %i) {
; CHECK-LABEL: @test68_addrspacecast(
-; CHECK-NEXT: getelementptr %s*
-; CHECK-NEXT: load %s*
+; CHECK-NEXT: getelementptr %s, %s*
+; CHECK-NEXT: load %s, %s*
; CHECK-NEXT: ret %s
%o = mul i64 %i, 12
%q = addrspacecast %s* %p to i8 addrspace(2)*
- %pp = getelementptr inbounds i8 addrspace(2)* %q, i64 %o
+ %pp = getelementptr inbounds i8, i8 addrspace(2)* %q, i64 %o
%r = addrspacecast i8 addrspace(2)* %pp to %s*
- %l = load %s* %r
+ %l = load %s, %s* %r
ret %s %l
}
define %s @test68_addrspacecast_2(%s* %p, i64 %i) {
; CHECK-LABEL: @test68_addrspacecast_2(
-; CHECK-NEXT: getelementptr %s* %p
+; CHECK-NEXT: getelementptr %s, %s* %p
; CHECK-NEXT: addrspacecast
-; CHECK-NEXT: load %s addrspace(1)*
+; CHECK-NEXT: load %s, %s addrspace(1)*
; CHECK-NEXT: ret %s
%o = mul i64 %i, 12
%q = addrspacecast %s* %p to i8 addrspace(2)*
- %pp = getelementptr inbounds i8 addrspace(2)* %q, i64 %o
+ %pp = getelementptr inbounds i8, i8 addrspace(2)* %q, i64 %o
%r = addrspacecast i8 addrspace(2)* %pp to %s addrspace(1)*
- %l = load %s addrspace(1)* %r
+ %l = load %s, %s addrspace(1)* %r
ret %s %l
}
@@ -769,11 +769,11 @@ define %s @test68_as1(%s addrspace(1)* %p, i32 %i) {
; CHECK-LABEL: @test68_as1(
%o = mul i32 %i, 12
%q = bitcast %s addrspace(1)* %p to i8 addrspace(1)*
- %pp = getelementptr inbounds i8 addrspace(1)* %q, i32 %o
-; CHECK-NEXT: getelementptr %s addrspace(1)*
+ %pp = getelementptr inbounds i8, i8 addrspace(1)* %q, i32 %o
+; CHECK-NEXT: getelementptr %s, %s addrspace(1)*
%r = bitcast i8 addrspace(1)* %pp to %s addrspace(1)*
- %l = load %s addrspace(1)* %r
-; CHECK-NEXT: load %s addrspace(1)*
+ %l = load %s, %s addrspace(1)* %r
+; CHECK-NEXT: load %s, %s addrspace(1)*
ret %s %l
; CHECK-NEXT: ret %s
}
@@ -782,11 +782,11 @@ define double @test69(double *%p, i64 %i) {
; CHECK-LABEL: @test69(
%o = shl nsw i64 %i, 3
%q = bitcast double* %p to i8*
- %pp = getelementptr inbounds i8* %q, i64 %o
-; CHECK-NEXT: getelementptr inbounds double*
+ %pp = getelementptr inbounds i8, i8* %q, i64 %o
+; CHECK-NEXT: getelementptr inbounds double, double*
%r = bitcast i8* %pp to double*
- %l = load double* %r
-; CHECK-NEXT: load double*
+ %l = load double, double* %r
+; CHECK-NEXT: load double, double*
ret double %l
; CHECK-NEXT: ret double
}
@@ -796,11 +796,11 @@ define %s @test70(%s *%p, i64 %i) {
%o = mul nsw i64 %i, 36
; CHECK-NEXT: mul nsw i64 %i, 3
%q = bitcast %s* %p to i8*
- %pp = getelementptr inbounds i8* %q, i64 %o
-; CHECK-NEXT: getelementptr inbounds %s*
+ %pp = getelementptr inbounds i8, i8* %q, i64 %o
+; CHECK-NEXT: getelementptr inbounds %s, %s*
%r = bitcast i8* %pp to %s*
- %l = load %s* %r
-; CHECK-NEXT: load %s*
+ %l = load %s, %s* %r
+; CHECK-NEXT: load %s, %s*
ret %s %l
; CHECK-NEXT: ret %s
}
@@ -810,11 +810,11 @@ define double @test71(double *%p, i64 %i) {
%o = shl i64 %i, 5
; CHECK-NEXT: shl i64 %i, 2
%q = bitcast double* %p to i8*
- %pp = getelementptr i8* %q, i64 %o
-; CHECK-NEXT: getelementptr double*
+ %pp = getelementptr i8, i8* %q, i64 %o
+; CHECK-NEXT: getelementptr double, double*
%r = bitcast i8* %pp to double*
- %l = load double* %r
-; CHECK-NEXT: load double*
+ %l = load double, double* %r
+; CHECK-NEXT: load double, double*
ret double %l
; CHECK-NEXT: ret double
}
@@ -825,11 +825,11 @@ define double @test72(double *%p, i32 %i) {
%o = sext i32 %so to i64
; CHECK-NEXT: sext i32 %i to i64
%q = bitcast double* %p to i8*
- %pp = getelementptr inbounds i8* %q, i64 %o
-; CHECK-NEXT: getelementptr inbounds double*
+ %pp = getelementptr inbounds i8, i8* %q, i64 %o
+; CHECK-NEXT: getelementptr inbounds double, double*
%r = bitcast i8* %pp to double*
- %l = load double* %r
-; CHECK-NEXT: load double*
+ %l = load double, double* %r
+; CHECK-NEXT: load double, double*
ret double %l
; CHECK-NEXT: ret double
}
@@ -840,11 +840,11 @@ define double @test73(double *%p, i128 %i) {
%o = trunc i128 %lo to i64
; CHECK-NEXT: trunc i128 %i to i64
%q = bitcast double* %p to i8*
- %pp = getelementptr inbounds i8* %q, i64 %o
-; CHECK-NEXT: getelementptr double*
+ %pp = getelementptr inbounds i8, i8* %q, i64 %o
+; CHECK-NEXT: getelementptr double, double*
%r = bitcast i8* %pp to double*
- %l = load double* %r
-; CHECK-NEXT: load double*
+ %l = load double, double* %r
+; CHECK-NEXT: load double, double*
ret double %l
; CHECK-NEXT: ret double
}
@@ -852,11 +852,11 @@ define double @test73(double *%p, i128 %i) {
define double @test74(double *%p, i64 %i) {
; CHECK-LABEL: @test74(
%q = bitcast double* %p to i64*
- %pp = getelementptr inbounds i64* %q, i64 %i
-; CHECK-NEXT: getelementptr inbounds double*
+ %pp = getelementptr inbounds i64, i64* %q, i64 %i
+; CHECK-NEXT: getelementptr inbounds double, double*
%r = bitcast i64* %pp to double*
- %l = load double* %r
-; CHECK-NEXT: load double*
+ %l = load double, double* %r
+; CHECK-NEXT: load double, double*
ret double %l
; CHECK-NEXT: ret double
}
@@ -868,7 +868,7 @@ define i32* @test75(i32* %p, i32 %x) {
%z = sext i32 %y to i64
; CHECK-NEXT: sext i32 %y to i64
%q = bitcast i32* %p to i8*
- %r = getelementptr i8* %q, i64 %z
+ %r = getelementptr i8, i8* %q, i64 %z
%s = bitcast i8* %r to i32*
ret i32* %s
}
@@ -879,11 +879,11 @@ define %s @test76(%s *%p, i64 %i, i64 %j) {
%o2 = mul nsw i64 %o, %j
; CHECK-NEXT: %o2 = mul i64 %i, %j
%q = bitcast %s* %p to i8*
- %pp = getelementptr inbounds i8* %q, i64 %o2
-; CHECK-NEXT: getelementptr %s* %p, i64 %o2
+ %pp = getelementptr inbounds i8, i8* %q, i64 %o2
+; CHECK-NEXT: getelementptr %s, %s* %p, i64 %o2
%r = bitcast i8* %pp to %s*
- %l = load %s* %r
-; CHECK-NEXT: load %s*
+ %l = load %s, %s* %r
+; CHECK-NEXT: load %s, %s*
ret %s %l
; CHECK-NEXT: ret %s
}
@@ -895,11 +895,11 @@ define %s @test77(%s *%p, i64 %i, i64 %j) {
; CHECK-NEXT: %o = mul nsw i64 %i, 3
; CHECK-NEXT: %o2 = mul nsw i64 %o, %j
%q = bitcast %s* %p to i8*
- %pp = getelementptr inbounds i8* %q, i64 %o2
-; CHECK-NEXT: getelementptr inbounds %s* %p, i64 %o2
+ %pp = getelementptr inbounds i8, i8* %q, i64 %o2
+; CHECK-NEXT: getelementptr inbounds %s, %s* %p, i64 %o2
%r = bitcast i8* %pp to %s*
- %l = load %s* %r
-; CHECK-NEXT: load %s*
+ %l = load %s, %s* %r
+; CHECK-NEXT: load %s, %s*
ret %s %l
; CHECK-NEXT: ret %s
}
@@ -923,11 +923,11 @@ define %s @test78(%s *%p, i64 %i, i64 %j, i32 %k, i32 %l, i128 %m, i128 %n) {
%h = mul nsw i64 %g, %j
; CHECK-NEXT: mul i64 %g, %j
%q = bitcast %s* %p to i8*
- %pp = getelementptr inbounds i8* %q, i64 %h
-; CHECK-NEXT: getelementptr %s* %p, i64 %h
+ %pp = getelementptr inbounds i8, i8* %q, i64 %h
+; CHECK-NEXT: getelementptr %s, %s* %p, i64 %h
%r = bitcast i8* %pp to %s*
- %load = load %s* %r
-; CHECK-NEXT: load %s*
+ %load = load %s, %s* %r
+; CHECK-NEXT: load %s, %s*
ret %s %load
; CHECK-NEXT: ret %s
}
@@ -940,9 +940,9 @@ define %s @test79(%s *%p, i64 %i, i32 %j) {
%c = mul i32 %b, %j
%q = bitcast %s* %p to i8*
; CHECK: bitcast
- %pp = getelementptr inbounds i8* %q, i32 %c
+ %pp = getelementptr inbounds i8, i8* %q, i32 %c
%r = bitcast i8* %pp to %s*
- %l = load %s* %r
+ %l = load %s, %s* %r
ret %s %l
}
@@ -951,39 +951,39 @@ define double @test80([100 x double]* %p, i32 %i) {
%tmp = shl nsw i32 %i, 3
; CHECK-NEXT: sext i32 %i to i64
%q = bitcast [100 x double]* %p to i8*
- %pp = getelementptr i8* %q, i32 %tmp
-; CHECK-NEXT: getelementptr [100 x double]*
+ %pp = getelementptr i8, i8* %q, i32 %tmp
+; CHECK-NEXT: getelementptr [100 x double], [100 x double]*
%r = bitcast i8* %pp to double*
- %l = load double* %r
-; CHECK-NEXT: load double*
+ %l = load double, double* %r
+; CHECK-NEXT: load double, double*
ret double %l
; CHECK-NEXT: ret double
}
define double @test80_addrspacecast([100 x double] addrspace(1)* %p, i32 %i) {
; CHECK-LABEL: @test80_addrspacecast(
-; CHECK-NEXT: getelementptr [100 x double] addrspace(1)* %p
-; CHECK-NEXT: load double addrspace(1)*
+; CHECK-NEXT: getelementptr [100 x double], [100 x double] addrspace(1)* %p
+; CHECK-NEXT: load double, double addrspace(1)*
; CHECK-NEXT: ret double
%tmp = shl nsw i32 %i, 3
%q = addrspacecast [100 x double] addrspace(1)* %p to i8 addrspace(2)*
- %pp = getelementptr i8 addrspace(2)* %q, i32 %tmp
+ %pp = getelementptr i8, i8 addrspace(2)* %q, i32 %tmp
%r = addrspacecast i8 addrspace(2)* %pp to double addrspace(1)*
- %l = load double addrspace(1)* %r
+ %l = load double, double addrspace(1)* %r
ret double %l
}
define double @test80_addrspacecast_2([100 x double] addrspace(1)* %p, i32 %i) {
; CHECK-LABEL: @test80_addrspacecast_2(
-; CHECK-NEXT: getelementptr [100 x double] addrspace(1)*
+; CHECK-NEXT: getelementptr [100 x double], [100 x double] addrspace(1)*
; CHECK-NEXT: addrspacecast double addrspace(1)*
-; CHECK-NEXT: load double addrspace(3)*
+; CHECK-NEXT: load double, double addrspace(3)*
; CHECK-NEXT: ret double
%tmp = shl nsw i32 %i, 3
%q = addrspacecast [100 x double] addrspace(1)* %p to i8 addrspace(2)*
- %pp = getelementptr i8 addrspace(2)* %q, i32 %tmp
+ %pp = getelementptr i8, i8 addrspace(2)* %q, i32 %tmp
%r = addrspacecast i8 addrspace(2)* %pp to double addrspace(3)*
- %l = load double addrspace(3)* %r
+ %l = load double, double addrspace(3)* %r
ret double %l
}
@@ -992,11 +992,11 @@ define double @test80_as1([100 x double] addrspace(1)* %p, i16 %i) {
%tmp = shl nsw i16 %i, 3
; CHECK-NEXT: sext i16 %i to i32
%q = bitcast [100 x double] addrspace(1)* %p to i8 addrspace(1)*
- %pp = getelementptr i8 addrspace(1)* %q, i16 %tmp
-; CHECK-NEXT: getelementptr [100 x double] addrspace(1)*
+ %pp = getelementptr i8, i8 addrspace(1)* %q, i16 %tmp
+; CHECK-NEXT: getelementptr [100 x double], [100 x double] addrspace(1)*
%r = bitcast i8 addrspace(1)* %pp to double addrspace(1)*
- %l = load double addrspace(1)* %r
-; CHECK-NEXT: load double addrspace(1)*
+ %l = load double, double addrspace(1)* %r
+; CHECK-NEXT: load double, double addrspace(1)*
ret double %l
; CHECK-NEXT: ret double
}
@@ -1004,9 +1004,9 @@ define double @test80_as1([100 x double] addrspace(1)* %p, i16 %i) {
define double @test81(double *%p, float %f) {
%i = fptosi float %f to i64
%q = bitcast double* %p to i8*
- %pp = getelementptr i8* %q, i64 %i
+ %pp = getelementptr i8, i8* %q, i64 %i
%r = bitcast i8* %pp to double*
- %l = load double* %r
+ %l = load double, double* %r
ret double %l
}