mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
[opaque pointer type] Add textual IR support for explicit type parameter to load instruction
Essentially the same as the GEP change in r230786.
A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)
import fileinput
import sys
import re
pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")
for line in sys.stdin:
sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7649
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
|
||||
|
||||
define i32 @test() {
|
||||
; CHECK: %Y.DONOTREMOVE = load i32* %A
|
||||
; CHECK: %Y.DONOTREMOVE = load i32, i32* %A
|
||||
; CHECK: %Z = sub i32 0, %Y.DONOTREMOVE
|
||||
%A = alloca i32
|
||||
store i32 0, i32* %A
|
||||
%X = load i32* %A
|
||||
%X = load i32, i32* %A
|
||||
%B = bitcast i32* %A to i8*
|
||||
%C = getelementptr i8, i8* %B, i64 1
|
||||
store i8 1, i8* %C ; Aliases %A
|
||||
%Y.DONOTREMOVE = load i32* %A
|
||||
%Y.DONOTREMOVE = load i32, i32* %A
|
||||
%Z = sub i32 %X, %Y.DONOTREMOVE
|
||||
ret i32 %Z
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ define i32 @test(i32 *%Ptr, i64 %V) {
|
||||
; CHECK: sub i32 %X, %Y
|
||||
%P2 = getelementptr i32, i32* %Ptr, i64 1
|
||||
%P1 = getelementptr i32, i32* %Ptr, i64 %V
|
||||
%X = load i32* %P1
|
||||
%X = load i32, i32* %P1
|
||||
store i32 5, i32* %P2
|
||||
%Y = load i32* %P1
|
||||
%Y = load i32, i32* %P1
|
||||
%Z = sub i32 %X, %Y
|
||||
ret i32 %Z
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ define void @table_reindex(%struct..apr_table_t* %t.1) { ; No predecessors!
|
||||
|
||||
loopentry: ; preds = %0, %no_exit
|
||||
%tmp.101 = getelementptr %struct..apr_table_t, %struct..apr_table_t* %t.1, i64 0, i32 0, i32 2
|
||||
%tmp.11 = load i32* %tmp.101 ; <i32> [#uses=0]
|
||||
%tmp.11 = load i32, i32* %tmp.101 ; <i32> [#uses=0]
|
||||
br i1 false, label %no_exit, label %UnifiedExitNode
|
||||
|
||||
no_exit: ; preds = %loopentry
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
define i32 @MTConcat([3 x i32]* %a.1) {
|
||||
%tmp.961 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 0, i64 4
|
||||
%tmp.97 = load i32* %tmp.961
|
||||
%tmp.97 = load i32, i32* %tmp.961
|
||||
%tmp.119 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 1, i64 0
|
||||
%tmp.120 = load i32* %tmp.119
|
||||
%tmp.120 = load i32, i32* %tmp.119
|
||||
%tmp.1541 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 0, i64 4
|
||||
%tmp.155 = load i32* %tmp.1541
|
||||
%tmp.155 = load i32, i32* %tmp.1541
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
define i32 @test(i32* %P) {
|
||||
%X = alloca i32
|
||||
%V1 = load i32* %P
|
||||
%V1 = load i32, i32* %P
|
||||
store i32 0, i32* %X
|
||||
%V2 = load i32* %P
|
||||
%V2 = load i32, i32* %P
|
||||
%Diff = sub i32 %V1, %V2
|
||||
ret i32 %Diff
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ no_exit: ; preds = %no_exit, %entry
|
||||
%tmp.6 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0, i32 %i.0.0 ; <i32*> [#uses=1]
|
||||
store i32 1, i32* %tmp.6
|
||||
%tmp.8 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0, i32 0 ; <i32*> [#uses=1]
|
||||
%tmp.9 = load i32* %tmp.8 ; <i32> [#uses=1]
|
||||
%tmp.9 = load i32, i32* %tmp.8 ; <i32> [#uses=1]
|
||||
%tmp.11 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 1, i32 0 ; <i32*> [#uses=1]
|
||||
%tmp.12 = load i32* %tmp.11 ; <i32> [#uses=1]
|
||||
%tmp.12 = load i32, i32* %tmp.11 ; <i32> [#uses=1]
|
||||
%tmp.13 = add i32 %tmp.12, %tmp.9 ; <i32> [#uses=1]
|
||||
%inc = add i32 %i.0.0, 1 ; <i32> [#uses=2]
|
||||
%tmp.2 = icmp slt i32 %inc, %N ; <i1> [#uses=1]
|
||||
|
||||
@@ -23,12 +23,12 @@ target triple = "i686-apple-darwin8"
|
||||
define i32 @test(%struct.closure_type* %tmp18169) {
|
||||
%tmp18174 = getelementptr %struct.closure_type, %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; <i32*> [#uses=2]
|
||||
%tmp18269 = bitcast i32* %tmp18174 to %struct.STYLE* ; <%struct.STYLE*> [#uses=1]
|
||||
%A = load i32* %tmp18174 ; <i32> [#uses=1]
|
||||
%A = load i32, i32* %tmp18174 ; <i32> [#uses=1]
|
||||
|
||||
%tmp18272 = getelementptr %struct.STYLE, %struct.STYLE* %tmp18269, i32 0, i32 0, i32 0, i32 2 ; <i16*> [#uses=1]
|
||||
store i16 123, i16* %tmp18272
|
||||
|
||||
%Q = load i32* %tmp18174 ; <i32> [#uses=1]
|
||||
%Q = load i32, i32* %tmp18174 ; <i32> [#uses=1]
|
||||
%Z = sub i32 %A, %Q ; <i32> [#uses=1]
|
||||
ret i32 %Z
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ declare i16 @llvm.cttz.i16(i16, i1)
|
||||
|
||||
define i32 @test(i32* %P, i16* %Q) {
|
||||
; CHECK: ret i32 0
|
||||
%A = load i16* %Q ; <i16> [#uses=1]
|
||||
%x = load i32* %P ; <i32> [#uses=1]
|
||||
%A = load i16, i16* %Q ; <i16> [#uses=1]
|
||||
%x = load i32, i32* %P ; <i32> [#uses=1]
|
||||
%B = call i16 @llvm.cttz.i16( i16 %A, i1 true ) ; <i16> [#uses=1]
|
||||
%y = load i32* %P ; <i32> [#uses=1]
|
||||
%y = load i32, i32* %P ; <i32> [#uses=1]
|
||||
store i16 %B, i16* %Q
|
||||
%z = sub i32 %x, %y ; <i32> [#uses=1]
|
||||
ret i32 %z
|
||||
|
||||
@@ -11,6 +11,6 @@ entry:
|
||||
store i32 1, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8
|
||||
%tmp4 = getelementptr %struct.A, %struct.A* %b, i32 0, i32 0 ;<i32*> [#uses=1]
|
||||
store i32 0, i32* %tmp4, align 4
|
||||
%tmp7 = load i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8 ; <i32> [#uses=1]
|
||||
%tmp7 = load i32, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8 ; <i32> [#uses=1]
|
||||
ret i32 %tmp7
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ entry:
|
||||
%tmp17 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 2, i64 1
|
||||
; <i64*> [#uses=1]
|
||||
%tmp1718 = bitcast i64* %tmp17 to i32* ; <i32*> [#uses=1]
|
||||
%tmp19 = load i32* %tmp1718, align 4 ; <i32> [#uses=0]
|
||||
%tmp19 = load i32, i32* %tmp1718, align 4 ; <i32> [#uses=0]
|
||||
br i1 false, label %cond_true34, label %done_okay
|
||||
|
||||
cond_true34: ; preds = %entry
|
||||
@@ -25,7 +25,7 @@ cond_true34: ; preds = %entry
|
||||
2305843009213693950 ; <i64*> [#uses=1]
|
||||
%tmp70 = bitcast i64* %tmp631 to %struct.device**
|
||||
|
||||
%tmp71 = load %struct.device** %tmp70, align 8
|
||||
%tmp71 = load %struct.device*, %struct.device** %tmp70, align 8
|
||||
|
||||
ret i32 undef
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ target triple = "x86_64-unknown-linux-gnu"
|
||||
define i32 @ehci_pci_setup(%struct.usb_hcd* %hcd) {
|
||||
entry:
|
||||
%tmp14 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 0, i32 0 ; <%struct.device**> [#uses=1]
|
||||
%tmp15 = load %struct.device** %tmp14, align 8 ; <%struct.device*> [#uses=0]
|
||||
%tmp15 = load %struct.device*, %struct.device** %tmp14, align 8 ; <%struct.device*> [#uses=0]
|
||||
br i1 false, label %bb25, label %return
|
||||
|
||||
bb25: ; preds = %entry
|
||||
@@ -23,7 +23,7 @@ bb25: ; preds = %entry
|
||||
cond_true: ; preds = %bb25
|
||||
%tmp601 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 1, i64 2305843009213693951 ; <i64*> [#uses=1]
|
||||
%tmp67 = bitcast i64* %tmp601 to %struct.device** ; <%struct.device**> [#uses=1]
|
||||
%tmp68 = load %struct.device** %tmp67, align 8 ; <%struct.device*> [#uses=0]
|
||||
%tmp68 = load %struct.device*, %struct.device** %tmp67, align 8 ; <%struct.device*> [#uses=0]
|
||||
ret i32 undef
|
||||
|
||||
return: ; preds = %bb25, %entry
|
||||
|
||||
@@ -10,6 +10,6 @@ target triple = "i686-pc-linux-gnu"
|
||||
define void @test291() nounwind {
|
||||
entry:
|
||||
store i32 1138410269, i32* getelementptr ([5 x %struct.S291]* @a291, i32 0, i32 2, i32 1)
|
||||
%tmp54 = load i32* bitcast (%struct.S291* getelementptr ([5 x %struct.S291]* @a291, i32 0, i32 2) to i32*), align 4 ; <i32> [#uses=0]
|
||||
%tmp54 = load i32, i32* bitcast (%struct.S291* getelementptr ([5 x %struct.S291]* @a291, i32 0, i32 2) to i32*), align 4 ; <i32> [#uses=0]
|
||||
unreachable
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ define i32 @foo() {
|
||||
%B = call i32* @_Znwj(i32 4)
|
||||
store i32 1, i32* %A
|
||||
store i32 2, i32* %B
|
||||
%C = load i32* %A
|
||||
%C = load i32, i32* %A
|
||||
ret i32 %C
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
declare noalias i32* @noalias()
|
||||
|
||||
define i32 @test(i32 %x) {
|
||||
; CHECK: load i32* %a
|
||||
; CHECK: load i32, i32* %a
|
||||
%a = call i32* @noalias()
|
||||
store i32 1, i32* %a
|
||||
%b = getelementptr i32, i32* %a, i32 %x
|
||||
store i32 2, i32* %b
|
||||
|
||||
%c = load i32* %a
|
||||
%c = load i32, i32* %a
|
||||
ret i32 %c
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ define i8 @foo(i8* %ptr) {
|
||||
%P = getelementptr i8, i8* %ptr, i32 0
|
||||
%Q = getelementptr i8, i8* %ptr, i32 1
|
||||
; CHECK: getelementptr
|
||||
%X = load i8* %P
|
||||
%X = load i8, i8* %P
|
||||
%Y = atomicrmw add i8* %Q, i8 1 monotonic
|
||||
%Z = load i8* %P
|
||||
%Z = load i8, i8* %P
|
||||
; CHECK-NOT: = load
|
||||
%A = sub i8 %X, %Z
|
||||
ret i8 %A
|
||||
|
||||
@@ -23,9 +23,9 @@ bb1:
|
||||
|
||||
bb2:
|
||||
%P = phi i32* [ %b, %bb ], [ @Y, %bb1 ]
|
||||
%tmp1 = load i32* @Z, align 4
|
||||
%tmp1 = load i32, i32* @Z, align 4
|
||||
store i32 123, i32* %P, align 4
|
||||
%tmp2 = load i32* @Z, align 4
|
||||
%tmp2 = load i32, i32* @Z, align 4
|
||||
br label %return
|
||||
|
||||
return:
|
||||
|
||||
@@ -9,9 +9,9 @@ define i32 @test(i32* %tab, i32 %indvar) nounwind {
|
||||
%tmp31 = mul i32 %indvar, -2
|
||||
%tmp32 = add i32 %tmp31, 30
|
||||
%t.5 = getelementptr i32, i32* %tab, i32 %tmp32
|
||||
%loada = load i32* %tab
|
||||
%loada = load i32, i32* %tab
|
||||
store i32 0, i32* %t.5
|
||||
%loadb = load i32* %tab
|
||||
%loadb = load i32, i32* %tab
|
||||
%rval = add i32 %loada, %loadb
|
||||
ret i32 %rval
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ define i32 @main() {
|
||||
store i8 0, i8* %10
|
||||
%11 = getelementptr inbounds i8, i8* %10, i32 -1
|
||||
store i8 0, i8* %11
|
||||
%12 = load i32* %1, align 4
|
||||
%12 = load i32, i32* %1, align 4
|
||||
ret i32 %12
|
||||
; CHECK: ret i32 %12
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ target triple = "x86_64-apple-macosx10.8.0"
|
||||
|
||||
define i32 @main() nounwind uwtable ssp {
|
||||
entry:
|
||||
%tmp = load i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4
|
||||
%tmp = load i8, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4
|
||||
%tmp1 = or i8 %tmp, -128
|
||||
store i8 %tmp1, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4
|
||||
%tmp2 = load i64* bitcast ({ i8, i8, i8, i8, i8 }* @a to i64*), align 8
|
||||
%tmp2 = load i64, i64* bitcast ({ i8, i8, i8, i8, i8 }* @a to i64*), align 8
|
||||
store i8 11, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4
|
||||
%tmp3 = trunc i64 %tmp2 to i32
|
||||
ret i32 %tmp3
|
||||
|
||||
@@ -22,8 +22,8 @@ define void @caller_a(double* %arg_a0,
|
||||
%noalias_ret_a0 = call double* @noalias_returner()
|
||||
%noalias_ret_a1 = call double* @noalias_returner()
|
||||
|
||||
%loaded_a0 = load double** %indirect_a0
|
||||
%loaded_a1 = load double** %indirect_a1
|
||||
%loaded_a0 = load double*, double** %indirect_a0
|
||||
%loaded_a1 = load double*, double** %indirect_a1
|
||||
|
||||
call void @callee(double* %escape_alloca_a0)
|
||||
call void @callee(double* %escape_alloca_a1)
|
||||
|
||||
@@ -10,7 +10,7 @@ define i32 @foo(%struct.x* byval %a) nounwind {
|
||||
%tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0 ; <i32*> [#uses=2]
|
||||
store i32 1, i32* %tmp2, align 4
|
||||
store i32 2, i32* @g, align 4
|
||||
%tmp4 = load i32* %tmp2, align 4 ; <i32> [#uses=1]
|
||||
%tmp4 = load i32, i32* %tmp2, align 4 ; <i32> [#uses=1]
|
||||
ret i32 %tmp4
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
; CHECK: ret i32 0
|
||||
|
||||
define i32 @main() {
|
||||
%a = load i32* @flag0
|
||||
%a = load i32, i32* @flag0
|
||||
%b = atomicrmw xchg i32* @turn, i32 1 monotonic
|
||||
%c = load i32* @flag0
|
||||
%c = load i32, i32* @flag0
|
||||
%d = sub i32 %a, %c
|
||||
ret i32 %d
|
||||
}
|
||||
|
||||
@@ -36,6 +36,6 @@ xc:
|
||||
%bigbase = bitcast i8* %base to i16*
|
||||
store i16 -1, i16* %bigbase
|
||||
|
||||
%loaded = load i8* %phi
|
||||
%loaded = load i8, i8* %phi
|
||||
ret i8 %loaded
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ define i32 @different_array_test(i64 %A, i64 %B) {
|
||||
call void @external(i32* %Array2)
|
||||
|
||||
%pointer = getelementptr i32, i32* %Array1, i64 %A
|
||||
%val = load i32* %pointer
|
||||
%val = load i32, i32* %pointer
|
||||
|
||||
%pointer2 = getelementptr i32, i32* %Array2, i64 %B
|
||||
store i32 7, i32* %pointer2
|
||||
|
||||
%REMOVE = load i32* %pointer ; redundant with above load
|
||||
%REMOVE = load i32, i32* %pointer ; redundant with above load
|
||||
%retval = sub i32 %REMOVE, %val
|
||||
ret i32 %retval
|
||||
; CHECK: @different_array_test
|
||||
@@ -41,9 +41,9 @@ define i32 @constant_array_index_test() {
|
||||
%P1 = getelementptr i32, i32* %Array, i64 7
|
||||
%P2 = getelementptr i32, i32* %Array, i64 6
|
||||
|
||||
%A = load i32* %P1
|
||||
%A = load i32, i32* %P1
|
||||
store i32 1, i32* %P2 ; Should not invalidate load
|
||||
%BREMOVE = load i32* %P1
|
||||
%BREMOVE = load i32, i32* %P1
|
||||
%Val = sub i32 %A, %BREMOVE
|
||||
ret i32 %Val
|
||||
; CHECK: @constant_array_index_test
|
||||
@@ -53,10 +53,10 @@ define i32 @constant_array_index_test() {
|
||||
; Test that if two pointers are spaced out by a constant getelementptr, that
|
||||
; they cannot alias.
|
||||
define i32 @gep_distance_test(i32* %A) {
|
||||
%REMOVEu = load i32* %A
|
||||
%REMOVEu = load i32, i32* %A
|
||||
%B = getelementptr i32, i32* %A, i64 2 ; Cannot alias A
|
||||
store i32 7, i32* %B
|
||||
%REMOVEv = load i32* %A
|
||||
%REMOVEv = load i32, i32* %A
|
||||
%r = sub i32 %REMOVEu, %REMOVEv
|
||||
ret i32 %r
|
||||
; CHECK: @gep_distance_test
|
||||
@@ -67,10 +67,10 @@ define i32 @gep_distance_test(i32* %A) {
|
||||
; cannot alias, even if there is a variable offset between them...
|
||||
define i32 @gep_distance_test2({i32,i32}* %A, i64 %distance) {
|
||||
%A1 = getelementptr {i32,i32}, {i32,i32}* %A, i64 0, i32 0
|
||||
%REMOVEu = load i32* %A1
|
||||
%REMOVEu = load i32, i32* %A1
|
||||
%B = getelementptr {i32,i32}, {i32,i32}* %A, i64 %distance, i32 1
|
||||
store i32 7, i32* %B ; B cannot alias A, it's at least 4 bytes away
|
||||
%REMOVEv = load i32* %A1
|
||||
%REMOVEv = load i32, i32* %A1
|
||||
%r = sub i32 %REMOVEu, %REMOVEv
|
||||
ret i32 %r
|
||||
; CHECK: @gep_distance_test2
|
||||
@@ -80,11 +80,11 @@ define i32 @gep_distance_test2({i32,i32}* %A, i64 %distance) {
|
||||
; Test that we can do funny pointer things and that distance calc will still
|
||||
; work.
|
||||
define i32 @gep_distance_test3(i32 * %A) {
|
||||
%X = load i32* %A
|
||||
%X = load i32, i32* %A
|
||||
%B = bitcast i32* %A to i8*
|
||||
%C = getelementptr i8, i8* %B, i64 4
|
||||
store i8 42, i8* %C
|
||||
%Y = load i32* %A
|
||||
%Y = load i32, i32* %A
|
||||
%R = sub i32 %X, %Y
|
||||
ret i32 %R
|
||||
; CHECK: @gep_distance_test3
|
||||
@@ -96,9 +96,9 @@ define i32 @constexpr_test() {
|
||||
%X = alloca i32
|
||||
call void @external(i32* %X)
|
||||
|
||||
%Y = load i32* %X
|
||||
%Y = load i32, i32* %X
|
||||
store i32 5, i32* getelementptr ({ i32 }* @Global, i64 0, i32 0)
|
||||
%REMOVE = load i32* %X
|
||||
%REMOVE = load i32, i32* %X
|
||||
%retval = sub i32 %Y, %REMOVE
|
||||
ret i32 %retval
|
||||
; CHECK: @constexpr_test
|
||||
@@ -113,12 +113,12 @@ define i16 @zext_sext_confusion(i16* %row2col, i5 %j) nounwind{
|
||||
entry:
|
||||
%sum5.cast = zext i5 %j to i64 ; <i64> [#uses=1]
|
||||
%P1 = getelementptr i16, i16* %row2col, i64 %sum5.cast
|
||||
%row2col.load.1.2 = load i16* %P1, align 1 ; <i16> [#uses=1]
|
||||
%row2col.load.1.2 = load i16, i16* %P1, align 1 ; <i16> [#uses=1]
|
||||
|
||||
%sum13.cast31 = sext i5 %j to i6 ; <i6> [#uses=1]
|
||||
%sum13.cast = zext i6 %sum13.cast31 to i64 ; <i64> [#uses=1]
|
||||
%P2 = getelementptr i16, i16* %row2col, i64 %sum13.cast
|
||||
%row2col.load.1.6 = load i16* %P2, align 1 ; <i16> [#uses=1]
|
||||
%row2col.load.1.6 = load i16, i16* %P2, align 1 ; <i16> [#uses=1]
|
||||
|
||||
%.ret = sub i16 %row2col.load.1.6, %row2col.load.1.2 ; <i16> [#uses=1]
|
||||
ret i16 %.ret
|
||||
|
||||
@@ -20,11 +20,11 @@ entry:
|
||||
%u = alloca %union.anon, align 8
|
||||
%tmp9 = getelementptr inbounds %union.anon, %union.anon* %u, i64 0, i32 0
|
||||
store double %x, double* %tmp9, align 8, !tbaa !0
|
||||
%tmp2 = load i32* bitcast (i64* @endianness_test to i32*), align 8, !tbaa !3
|
||||
%tmp2 = load i32, i32* bitcast (i64* @endianness_test to i32*), align 8, !tbaa !3
|
||||
%idxprom = sext i32 %tmp2 to i64
|
||||
%tmp4 = bitcast %union.anon* %u to [2 x i32]*
|
||||
%arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %tmp4, i64 0, i64 %idxprom
|
||||
%tmp5 = load i32* %arrayidx, align 4, !tbaa !3
|
||||
%tmp5 = load i32, i32* %arrayidx, align 4, !tbaa !3
|
||||
%tmp5.lobit = lshr i32 %tmp5, 31
|
||||
ret i32 %tmp5.lobit
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
; CHECK-NEXT: ret i32 0
|
||||
|
||||
define i32 @test() {
|
||||
%A1 = load i32* @A
|
||||
%A1 = load i32, i32* @A
|
||||
|
||||
store i32 123, i32* @B ; Store cannot alias @A
|
||||
|
||||
%A2 = load i32* @A
|
||||
%A2 = load i32, i32* @A
|
||||
%X = sub i32 %A1, %A2
|
||||
ret i32 %X
|
||||
}
|
||||
@@ -30,13 +30,13 @@ define i32 @test() {
|
||||
; CHECK-NEXT: ret i32 0
|
||||
|
||||
define i32 @test2() {
|
||||
%A1 = load i32* @A
|
||||
%A1 = load i32, i32* @A
|
||||
br label %Loop
|
||||
Loop:
|
||||
%AP = phi i32 [0, %0], [%X, %Loop]
|
||||
store i32 %AP, i32* @B ; Store cannot alias @A
|
||||
|
||||
%A2 = load i32* @A
|
||||
%A2 = load i32, i32* @A
|
||||
%X = sub i32 %A1, %A2
|
||||
%c = icmp eq i32 %X, 0
|
||||
br i1 %c, label %out, label %Loop
|
||||
@@ -55,7 +55,7 @@ define i32 @test3() {
|
||||
%X = alloca i32
|
||||
store i32 7, i32* %X
|
||||
call void @external()
|
||||
%V = load i32* %X
|
||||
%V = load i32, i32* %X
|
||||
ret i32 %V
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ define i32 @test1(i8 * %P) {
|
||||
entry:
|
||||
%Q = bitcast i8* %P to {i32, i32}*
|
||||
%R = getelementptr {i32, i32}, {i32, i32}* %Q, i32 0, i32 1
|
||||
%S = load i32* %R
|
||||
%S = load i32, i32* %R
|
||||
|
||||
%q = bitcast i8* %P to {i32, i32}*
|
||||
%r = getelementptr {i32, i32}, {i32, i32}* %q, i32 0, i32 1
|
||||
%s = load i32* %r
|
||||
%s = load i32, i32* %r
|
||||
|
||||
%t = sub i32 %S, %s
|
||||
ret i32 %t
|
||||
@@ -23,12 +23,12 @@ define i32 @test2(i8 * %P) {
|
||||
entry:
|
||||
%Q = bitcast i8* %P to {i32, i32, i32}*
|
||||
%R = getelementptr {i32, i32, i32}, {i32, i32, i32}* %Q, i32 0, i32 1
|
||||
%S = load i32* %R
|
||||
%S = load i32, i32* %R
|
||||
|
||||
%r = getelementptr {i32, i32, i32}, {i32, i32, i32}* %Q, i32 0, i32 2
|
||||
store i32 42, i32* %r
|
||||
|
||||
%s = load i32* %R
|
||||
%s = load i32, i32* %R
|
||||
|
||||
%t = sub i32 %S, %s
|
||||
ret i32 %t
|
||||
@@ -42,12 +42,12 @@ define i32 @test3({float, {i32, i32, i32}}* %P) {
|
||||
entry:
|
||||
%P2 = getelementptr {float, {i32, i32, i32}}, {float, {i32, i32, i32}}* %P, i32 0, i32 1
|
||||
%R = getelementptr {i32, i32, i32}, {i32, i32, i32}* %P2, i32 0, i32 1
|
||||
%S = load i32* %R
|
||||
%S = load i32, i32* %R
|
||||
|
||||
%r = getelementptr {i32, i32, i32}, {i32, i32, i32}* %P2, i32 0, i32 2
|
||||
store i32 42, i32* %r
|
||||
|
||||
%s = load i32* %R
|
||||
%s = load i32, i32* %R
|
||||
|
||||
%t = sub i32 %S, %s
|
||||
ret i32 %t
|
||||
@@ -66,7 +66,7 @@ entry:
|
||||
store i32 64, i32* %tmp2, align 8
|
||||
%tmp3 = getelementptr inbounds %SmallPtrSet64, %SmallPtrSet64* %P, i64 0, i32 0, i32 4, i64 64
|
||||
store i8* null, i8** %tmp3, align 8
|
||||
%tmp4 = load i32* %tmp2, align 8
|
||||
%tmp4 = load i32, i32* %tmp2, align 8
|
||||
ret i32 %tmp4
|
||||
; CHECK-LABEL: @test4(
|
||||
; CHECK: ret i32 64
|
||||
@@ -77,9 +77,9 @@ define i32 @test5(i32* %p, i64 %i) {
|
||||
%pi = getelementptr i32, i32* %p, i64 %i
|
||||
%i.next = add i64 %i, 1
|
||||
%pi.next = getelementptr i32, i32* %p, i64 %i.next
|
||||
%x = load i32* %pi
|
||||
%x = load i32, i32* %pi
|
||||
store i32 42, i32* %pi.next
|
||||
%y = load i32* %pi
|
||||
%y = load i32, i32* %pi
|
||||
%z = sub i32 %x, %y
|
||||
ret i32 %z
|
||||
; CHECK-LABEL: @test5(
|
||||
@@ -90,9 +90,9 @@ define i32 @test5_as1_smaller_size(i32 addrspace(1)* %p, i8 %i) {
|
||||
%pi = getelementptr i32, i32 addrspace(1)* %p, i8 %i
|
||||
%i.next = add i8 %i, 1
|
||||
%pi.next = getelementptr i32, i32 addrspace(1)* %p, i8 %i.next
|
||||
%x = load i32 addrspace(1)* %pi
|
||||
%x = load i32, i32 addrspace(1)* %pi
|
||||
store i32 42, i32 addrspace(1)* %pi.next
|
||||
%y = load i32 addrspace(1)* %pi
|
||||
%y = load i32, i32 addrspace(1)* %pi
|
||||
%z = sub i32 %x, %y
|
||||
ret i32 %z
|
||||
; CHECK-LABEL: @test5_as1_smaller_size(
|
||||
@@ -104,9 +104,9 @@ define i32 @test5_as1_same_size(i32 addrspace(1)* %p, i16 %i) {
|
||||
%pi = getelementptr i32, i32 addrspace(1)* %p, i16 %i
|
||||
%i.next = add i16 %i, 1
|
||||
%pi.next = getelementptr i32, i32 addrspace(1)* %p, i16 %i.next
|
||||
%x = load i32 addrspace(1)* %pi
|
||||
%x = load i32, i32 addrspace(1)* %pi
|
||||
store i32 42, i32 addrspace(1)* %pi.next
|
||||
%y = load i32 addrspace(1)* %pi
|
||||
%y = load i32, i32 addrspace(1)* %pi
|
||||
%z = sub i32 %x, %y
|
||||
ret i32 %z
|
||||
; CHECK-LABEL: @test5_as1_same_size(
|
||||
@@ -119,9 +119,9 @@ define i32 @test6(i32* %p, i64 %i1) {
|
||||
%pi = getelementptr i32, i32* %p, i64 %i
|
||||
%i.next = or i64 %i, 1
|
||||
%pi.next = getelementptr i32, i32* %p, i64 %i.next
|
||||
%x = load i32* %pi
|
||||
%x = load i32, i32* %pi
|
||||
store i32 42, i32* %pi.next
|
||||
%y = load i32* %pi
|
||||
%y = load i32, i32* %pi
|
||||
%z = sub i32 %x, %y
|
||||
ret i32 %z
|
||||
; CHECK-LABEL: @test6(
|
||||
@@ -133,9 +133,9 @@ define i32 @test7(i32* %p, i64 %i) {
|
||||
%pi = getelementptr i32, i32* %p, i64 1
|
||||
%i.next = shl i64 %i, 2
|
||||
%pi.next = getelementptr i32, i32* %p, i64 %i.next
|
||||
%x = load i32* %pi
|
||||
%x = load i32, i32* %pi
|
||||
store i32 42, i32* %pi.next
|
||||
%y = load i32* %pi
|
||||
%y = load i32, i32* %pi
|
||||
%z = sub i32 %x, %y
|
||||
ret i32 %z
|
||||
; CHECK-LABEL: @test7(
|
||||
@@ -150,9 +150,9 @@ define i32 @test8(i32* %p, i16 %i) {
|
||||
%i.next = add i16 %i, 1
|
||||
%i.next2 = zext i16 %i.next to i32
|
||||
%pi.next = getelementptr i32, i32* %p, i32 %i.next2
|
||||
%x = load i32* %pi
|
||||
%x = load i32, i32* %pi
|
||||
store i32 42, i32* %pi.next
|
||||
%y = load i32* %pi
|
||||
%y = load i32, i32* %pi
|
||||
%z = sub i32 %x, %y
|
||||
ret i32 %z
|
||||
; CHECK-LABEL: @test8(
|
||||
@@ -170,9 +170,9 @@ define i8 @test9([4 x i8] *%P, i32 %i, i32 %j) {
|
||||
; P4 = P + 4*j
|
||||
%P4 = getelementptr [4 x i8], [4 x i8]* %P, i32 0, i32 %j2
|
||||
|
||||
%x = load i8* %P2
|
||||
%x = load i8, i8* %P2
|
||||
store i8 42, i8* %P4
|
||||
%y = load i8* %P2
|
||||
%y = load i8, i8* %P2
|
||||
%z = sub i8 %x, %y
|
||||
ret i8 %z
|
||||
; CHECK-LABEL: @test9(
|
||||
@@ -188,9 +188,9 @@ define i8 @test10([4 x i8] *%P, i32 %i) {
|
||||
; P4 = P + 4*i
|
||||
%P4 = getelementptr [4 x i8], [4 x i8]* %P, i32 0, i32 %i2
|
||||
|
||||
%x = load i8* %P2
|
||||
%x = load i8, i8* %P2
|
||||
store i8 42, i8* %P4
|
||||
%y = load i8* %P2
|
||||
%y = load i8, i8* %P2
|
||||
%z = sub i8 %x, %y
|
||||
ret i8 %z
|
||||
; CHECK-LABEL: @test10(
|
||||
@@ -207,7 +207,7 @@ define float @test11(i32 %indvar, [4 x [2 x float]]* %q) nounwind ssp {
|
||||
%y29 = getelementptr inbounds [2 x float], [2 x float]* %arrayidx28, i32 0, i32 1
|
||||
store float 1.0, float* %y29, align 4
|
||||
store i64 0, i64* %scevgep35, align 4
|
||||
%tmp30 = load float* %y29, align 4
|
||||
%tmp30 = load float, float* %y29, align 4
|
||||
ret float %tmp30
|
||||
; CHECK-LABEL: @test11(
|
||||
; CHECK: ret float %tmp30
|
||||
@@ -223,7 +223,7 @@ define i32 @test12(i32 %x, i32 %y, i8* %p) nounwind {
|
||||
%castp = bitcast i8* %p to i32*
|
||||
store i32 1, i32* %castp
|
||||
store i32 0, i32* %castd
|
||||
%r = load i32* %castp
|
||||
%r = load i32, i32* %castp
|
||||
ret i32 %r
|
||||
; CHECK-LABEL: @test12(
|
||||
; CHECK: ret i32 %r
|
||||
|
||||
@@ -8,9 +8,9 @@ target datalayout = "E-p:64:64:64-p1:16:16:16-a0:0:8-f32:32:32-f64:64:64-i1:8:8-
|
||||
|
||||
; CHECK-LABEL: @test1(
|
||||
define i16 @test1(i32* %P) {
|
||||
%X = load i16* @B
|
||||
%X = load i16, i16* @B
|
||||
store i32 7, i32* %P
|
||||
%Y = load i16* @B
|
||||
%Y = load i16, i16* @B
|
||||
%Z = sub i16 %Y, %X
|
||||
ret i16 %Z
|
||||
; CHECK: ret i16 0
|
||||
@@ -21,9 +21,9 @@ define i16 @test1(i32* %P) {
|
||||
define i16 @test1_as1(i32 addrspace(1)* %P) {
|
||||
; CHECK-LABEL: @test1_as1(
|
||||
; CHECK: ret i16 0
|
||||
%X = load i16 addrspace(1)* @B_as1
|
||||
%X = load i16, i16 addrspace(1)* @B_as1
|
||||
store i32 7, i32 addrspace(1)* %P
|
||||
%Y = load i16 addrspace(1)* @B_as1
|
||||
%Y = load i16, i16 addrspace(1)* @B_as1
|
||||
%Z = sub i16 %Y, %X
|
||||
ret i16 %Z
|
||||
}
|
||||
@@ -39,10 +39,10 @@ define i8 @test2(i32 %tmp79, i32 %w.2, i32 %indvar89) nounwind {
|
||||
%tmp93 = add i32 %w.2, %indvar89
|
||||
%arrayidx416 = getelementptr [0 x i8], [0 x i8]* @window, i32 0, i32 %tmp93
|
||||
|
||||
%A = load i8* %arrayidx412, align 1
|
||||
%A = load i8, i8* %arrayidx412, align 1
|
||||
store i8 4, i8* %arrayidx416, align 1
|
||||
|
||||
%B = load i8* %arrayidx412, align 1
|
||||
%B = load i8, i8* %arrayidx412, align 1
|
||||
%C = sub i8 %A, %B
|
||||
ret i8 %C
|
||||
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
|
||||
define i32 @foo(i32* nocapture %p, i8* nocapture %q) {
|
||||
entry:
|
||||
%0 = load i32* %p, align 4, !invariant.load !3
|
||||
%0 = load i32, i32* %p, align 4, !invariant.load !3
|
||||
%conv = trunc i32 %0 to i8
|
||||
store i8 %conv, i8* %q, align 1
|
||||
%1 = load i32* %p, align 4, !invariant.load !3
|
||||
%1 = load i32, i32* %p, align 4, !invariant.load !3
|
||||
%add = add nsw i32 %1, 1
|
||||
ret i32 %add
|
||||
|
||||
; CHECK: foo
|
||||
; CHECK: %0 = load i32* %p
|
||||
; CHECK: %0 = load i32, i32* %p
|
||||
; CHECK: store i8 %conv, i8* %q,
|
||||
; CHECK: %add = add nsw i32 %0, 1
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ entry:
|
||||
store i32 1, i32* @z
|
||||
tail call void @memset_pattern16(i8* bitcast (i32* @y to i8*), i8* bitcast (i32* @x to i8*), i64 4) nounwind
|
||||
; CHECK-NOT: load
|
||||
%l = load i32* @z
|
||||
%l = load i32, i32* @z
|
||||
; CHECK: ret i32 1
|
||||
ret i32 %l
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ define i32 @test0(i8* %P) {
|
||||
|
||||
call void @llvm.memset.p0i8.i32(i8* %P, i8 0, i32 42, i32 1, i1 false)
|
||||
|
||||
%B = load i32* %A
|
||||
%B = load i32, i32* %A
|
||||
ret i32 %B
|
||||
|
||||
; CHECK-LABEL: @test0
|
||||
@@ -29,7 +29,7 @@ define i8 @test1() {
|
||||
|
||||
call void @llvm.memcpy.p0i8.p0i8.i8(i8* %A, i8* %B, i8 -1, i32 0, i1 false)
|
||||
|
||||
%C = load i8* %B
|
||||
%C = load i8, i8* %B
|
||||
ret i8 %C
|
||||
; CHECK: ret i8 2
|
||||
}
|
||||
@@ -39,7 +39,7 @@ define i8 @test2(i8* %P) {
|
||||
%P2 = getelementptr i8, i8* %P, i32 127
|
||||
store i8 1, i8* %P2 ;; Not dead across memset
|
||||
call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false)
|
||||
%A = load i8* %P2
|
||||
%A = load i8, i8* %P2
|
||||
ret i8 %A
|
||||
; CHECK: ret i8 1
|
||||
}
|
||||
@@ -52,7 +52,7 @@ define i8 @test2a(i8* %P) {
|
||||
store i8 1, i8* %P2 ;; Dead, clobbered by memset.
|
||||
|
||||
call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false)
|
||||
%A = load i8* %P2
|
||||
%A = load i8, i8* %P2
|
||||
ret i8 %A
|
||||
; CHECK-NOT: load
|
||||
; CHECK: ret i8 2
|
||||
@@ -90,9 +90,9 @@ define void @test3a(i8* %P, i8 %X) {
|
||||
@G2 = external global [4000 x i32]
|
||||
|
||||
define i32 @test4(i8* %P) {
|
||||
%tmp = load i32* @G1
|
||||
%tmp = load i32, i32* @G1
|
||||
call void @llvm.memset.p0i8.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8 0, i32 4000, i32 1, i1 false)
|
||||
%tmp2 = load i32* @G1
|
||||
%tmp2 = load i32, i32* @G1
|
||||
%sub = sub i32 %tmp2, %tmp
|
||||
ret i32 %sub
|
||||
; CHECK-LABEL: @test4
|
||||
@@ -105,9 +105,9 @@ define i32 @test4(i8* %P) {
|
||||
; Verify that basicaa is handling variable length memcpy, knowing it doesn't
|
||||
; write to G1.
|
||||
define i32 @test5(i8* %P, i32 %Len) {
|
||||
%tmp = load i32* @G1
|
||||
%tmp = load i32, i32* @G1
|
||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8* bitcast (i32* @G1 to i8*), i32 %Len, i32 1, i1 false)
|
||||
%tmp2 = load i32* @G1
|
||||
%tmp2 = load i32, i32* @G1
|
||||
%sub = sub i32 %tmp2, %tmp
|
||||
ret i32 %sub
|
||||
; CHECK: @test5
|
||||
@@ -118,13 +118,13 @@ define i32 @test5(i8* %P, i32 %Len) {
|
||||
}
|
||||
|
||||
define i8 @test6(i8* %p, i8* noalias %a) {
|
||||
%x = load i8* %a
|
||||
%x = load i8, i8* %a
|
||||
%t = va_arg i8* %p, float
|
||||
%y = load i8* %a
|
||||
%y = load i8, i8* %a
|
||||
%z = add i8 %x, %y
|
||||
ret i8 %z
|
||||
; CHECK-LABEL: @test6
|
||||
; CHECK: load i8* %a
|
||||
; CHECK: load i8, i8* %a
|
||||
; CHECK-NOT: load
|
||||
; CHECK: ret
|
||||
}
|
||||
@@ -137,12 +137,12 @@ entry:
|
||||
store i32 0, i32* %x, align 4
|
||||
%add.ptr = getelementptr inbounds i32, i32* %x, i64 1
|
||||
call void @test7decl(i32* %add.ptr)
|
||||
%tmp = load i32* %x, align 4
|
||||
%tmp = load i32, i32* %x, align 4
|
||||
ret i32 %tmp
|
||||
; CHECK-LABEL: @test7(
|
||||
; CHECK: store i32 0
|
||||
; CHECK: call void @test7decl
|
||||
; CHECK: load i32*
|
||||
; CHECK: load i32, i32*
|
||||
}
|
||||
|
||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
||||
|
||||
@@ -20,7 +20,7 @@ green:
|
||||
%bigbase0 = bitcast i8* %base to i16*
|
||||
store i16 -1, i16* %bigbase0
|
||||
|
||||
%loaded = load i8* %phi
|
||||
%loaded = load i8, i8* %phi
|
||||
ret i8 %loaded
|
||||
}
|
||||
|
||||
@@ -34,6 +34,6 @@ entry:
|
||||
%bigbase1 = bitcast i8* %base to i16*
|
||||
store i16 -1, i16* %bigbase1
|
||||
|
||||
%loaded = load i8* %sel
|
||||
%loaded = load i8, i8* %sel
|
||||
ret i8 %loaded
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ entry:
|
||||
store i8* %tmp2, i8** %tmp4, align 4
|
||||
%tmp10 = getelementptr i8, i8* %tmp2, i32 10 ; <i8*> [#uses=1]
|
||||
store i8 42, i8* %tmp10, align 1
|
||||
%tmp14 = load i8** %tmp4, align 4 ; <i8*> [#uses=1]
|
||||
%tmp14 = load i8*, i8** %tmp4, align 4 ; <i8*> [#uses=1]
|
||||
%tmp16 = getelementptr i8, i8* %tmp14, i32 10 ; <i8*> [#uses=1]
|
||||
%tmp17 = load i8* %tmp16, align 1 ; <i8> [#uses=1]
|
||||
%tmp17 = load i8, i8* %tmp16, align 1 ; <i8> [#uses=1]
|
||||
%tmp19 = icmp eq i8 %tmp17, 42 ; <i1> [#uses=1]
|
||||
ret i1 %tmp19
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ define i64 @testcase(%nested * noalias %p1, %nested * noalias %p2,
|
||||
; CHECK; store i64 1
|
||||
|
||||
store i64 2, i64* %ptr.64, align 8
|
||||
%r = load i64* %either_ptr.64, align 8
|
||||
%r = load i64, i64* %either_ptr.64, align 8
|
||||
store i64 1, i64* %ptr.64, align 8
|
||||
ret i64 %r
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ define void @no(i32* noalias %a, i32* %b) nounwind {
|
||||
entry:
|
||||
store i32 1, i32* %a
|
||||
%cap = call i32* @captures(i32* %a) nounwind readonly
|
||||
%l = load i32* %b
|
||||
%l = load i32, i32* %b
|
||||
ret void
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ define void @yes(i32* %c, i32* %d) nounwind {
|
||||
entry:
|
||||
store i32 1, i32* %c
|
||||
%cap = call i32* @captures(i32* %c) nounwind readonly
|
||||
%l = load i32* %d
|
||||
%l = load i32, i32* %d
|
||||
ret void
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ define i32 @test2() {
|
||||
; CHECK: ret i32 0
|
||||
%P = alloca i32
|
||||
%Q = call i32* @test(i32* %P)
|
||||
%a = load i32* %P
|
||||
%a = load i32, i32* %P
|
||||
store i32 4, i32* %Q ;; cannot clobber P since it is nocapture.
|
||||
%b = load i32* %P
|
||||
%b = load i32, i32* %P
|
||||
%c = sub i32 %a, %b
|
||||
ret i32 %c
|
||||
}
|
||||
@@ -19,7 +19,7 @@ define i32 @test4(i32* noalias nocapture %p) nounwind {
|
||||
; CHECK: call void @test3
|
||||
; CHECK: store i32 0, i32* %p
|
||||
; CHECK: store i32 1, i32* %x
|
||||
; CHECK: %y = load i32* %p
|
||||
; CHECK: %y = load i32, i32* %p
|
||||
; CHECK: ret i32 %y
|
||||
entry:
|
||||
%q = alloca i32*
|
||||
@@ -27,10 +27,10 @@ entry:
|
||||
; attribute since the copy doesn't outlive the function.
|
||||
call void @test3(i32** %q, i32* %p) nounwind
|
||||
store i32 0, i32* %p
|
||||
%x = load i32** %q
|
||||
%x = load i32*, i32** %q
|
||||
; This store might write to %p and so we can't eliminate the subsequent
|
||||
; load
|
||||
store i32 1, i32* %x
|
||||
%y = load i32* %p
|
||||
%y = load i32, i32* %p
|
||||
ret i32 %y
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ bb1:
|
||||
|
||||
bb2:
|
||||
%P = phi i32* [ @X, %bb ], [ @Y, %bb1 ]
|
||||
%tmp1 = load i32* @Z, align 4
|
||||
%tmp1 = load i32, i32* @Z, align 4
|
||||
store i32 123, i32* %P, align 4
|
||||
%tmp2 = load i32* @Z, align 4
|
||||
%tmp2 = load i32, i32* @Z, align 4
|
||||
br label %return
|
||||
|
||||
return:
|
||||
@@ -52,14 +52,14 @@ codeRepl:
|
||||
br i1 %targetBlock, label %for.body, label %bye
|
||||
|
||||
for.body:
|
||||
%1 = load i32* %jj7, align 4
|
||||
%1 = load i32, i32* %jj7, align 4
|
||||
%idxprom4 = zext i32 %1 to i64
|
||||
%arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* %oa5, i64 0, i64 %idxprom4
|
||||
%2 = load i32* %arrayidx5, align 4
|
||||
%2 = load i32, i32* %arrayidx5, align 4
|
||||
%sub6 = sub i32 %2, 6
|
||||
store i32 %sub6, i32* %arrayidx5, align 4
|
||||
; %0 and %arrayidx5 can alias! It is not safe to DSE the above store.
|
||||
%3 = load i32* %0, align 4
|
||||
%3 = load i32, i32* %0, align 4
|
||||
store i32 %3, i32* %arrayidx5, align 4
|
||||
%sub11 = add i32 %1, -1
|
||||
%idxprom12 = zext i32 %sub11 to i64
|
||||
@@ -68,7 +68,7 @@ for.body:
|
||||
br label %codeRepl
|
||||
|
||||
bye:
|
||||
%.reload = load i32* %jj7, align 4
|
||||
%.reload = load i32, i32* %jj7, align 4
|
||||
ret i32 %.reload
|
||||
}
|
||||
|
||||
|
||||
@@ -24,20 +24,20 @@ for.body4: ; preds = %for.body4, %for.con
|
||||
%lsr.iv46 = bitcast [16000 x double]* %lsr.iv4 to <4 x double>*
|
||||
%lsr.iv12 = bitcast [16000 x double]* %lsr.iv1 to <4 x double>*
|
||||
%scevgep11 = getelementptr <4 x double>, <4 x double>* %lsr.iv46, i64 -2
|
||||
%i6 = load <4 x double>* %scevgep11, align 32
|
||||
%i6 = load <4 x double>, <4 x double>* %scevgep11, align 32
|
||||
%add = fadd <4 x double> %i6, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
|
||||
store <4 x double> %add, <4 x double>* %lsr.iv12, align 32
|
||||
%scevgep10 = getelementptr <4 x double>, <4 x double>* %lsr.iv46, i64 -1
|
||||
%i7 = load <4 x double>* %scevgep10, align 32
|
||||
%i7 = load <4 x double>, <4 x double>* %scevgep10, align 32
|
||||
%add.4 = fadd <4 x double> %i7, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
|
||||
%scevgep9 = getelementptr <4 x double>, <4 x double>* %lsr.iv12, i64 1
|
||||
store <4 x double> %add.4, <4 x double>* %scevgep9, align 32
|
||||
%i8 = load <4 x double>* %lsr.iv46, align 32
|
||||
%i8 = load <4 x double>, <4 x double>* %lsr.iv46, align 32
|
||||
%add.8 = fadd <4 x double> %i8, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
|
||||
%scevgep8 = getelementptr <4 x double>, <4 x double>* %lsr.iv12, i64 2
|
||||
store <4 x double> %add.8, <4 x double>* %scevgep8, align 32
|
||||
%scevgep7 = getelementptr <4 x double>, <4 x double>* %lsr.iv46, i64 1
|
||||
%i9 = load <4 x double>* %scevgep7, align 32
|
||||
%i9 = load <4 x double>, <4 x double>* %scevgep7, align 32
|
||||
%add.12 = fadd <4 x double> %i9, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
|
||||
%scevgep3 = getelementptr <4 x double>, <4 x double>* %lsr.iv12, i64 3
|
||||
store <4 x double> %add.12, <4 x double>* %scevgep3, align 32
|
||||
|
||||
@@ -17,10 +17,10 @@ while.body:
|
||||
%ptr2_phi = phi i32* [ %ptr2, %entry ], [ %ptr2_inc, %while.body ]
|
||||
%result.09 = phi i32 [ 0 , %entry ], [ %add, %while.body ]
|
||||
%dec = add nsw i32 %num, -1
|
||||
%0 = load i32* %ptr_phi, align 4
|
||||
%0 = load i32, i32* %ptr_phi, align 4
|
||||
store i32 %0, i32* %ptr2_phi, align 4
|
||||
%1 = load i32* %coeff, align 4
|
||||
%2 = load i32* %ptr_phi, align 4
|
||||
%1 = load i32, i32* %coeff, align 4
|
||||
%2 = load i32, i32* %ptr_phi, align 4
|
||||
%mul = mul nsw i32 %1, %2
|
||||
%add = add nsw i32 %mul, %result.09
|
||||
%tobool = icmp eq i32 %dec, 0
|
||||
@@ -52,10 +52,10 @@ while.body:
|
||||
%ptr2_phi = phi i32* [ %ptr_outer_phi2, %outer.while.header ], [ %ptr2_inc, %while.body ]
|
||||
%result.09 = phi i32 [ 0 , %outer.while.header ], [ %add, %while.body ]
|
||||
%dec = add nsw i32 %num, -1
|
||||
%0 = load i32* %ptr_phi, align 4
|
||||
%0 = load i32, i32* %ptr_phi, align 4
|
||||
store i32 %0, i32* %ptr2_phi, align 4
|
||||
%1 = load i32* %coeff, align 4
|
||||
%2 = load i32* %ptr_phi, align 4
|
||||
%1 = load i32, i32* %coeff, align 4
|
||||
%2 = load i32, i32* %ptr_phi, align 4
|
||||
%mul = mul nsw i32 %1, %2
|
||||
%add = add nsw i32 %mul, %result.09
|
||||
%tobool = icmp eq i32 %dec, 0
|
||||
|
||||
@@ -10,7 +10,7 @@ declare <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float>, i8*, <8 x i32>,
|
||||
; Function Attrs: nounwind
|
||||
define <8 x float> @foo1(i8* noalias readonly %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 {
|
||||
allocas:
|
||||
%vix = load <8 x i32>* %vix.ptr, align 4
|
||||
%vix = load <8 x i32>, <8 x i32>* %vix.ptr, align 4
|
||||
%t1.ptr = getelementptr i8, i8* %arr.ptr, i8 4
|
||||
|
||||
%v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
|
||||
@@ -31,7 +31,7 @@ allocas:
|
||||
; Function Attrs: nounwind
|
||||
define <8 x float> @foo2(i8* noalias readonly %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 {
|
||||
allocas:
|
||||
%vix = load <8 x i32>* %vix.ptr, align 4
|
||||
%vix = load <8 x i32>, <8 x i32>* %vix.ptr, align 4
|
||||
%t1.ptr = getelementptr i8, i8* %arr.ptr, i8 4
|
||||
|
||||
%v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2
|
||||
|
||||
@@ -10,11 +10,11 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1
|
||||
@C = global [2 x i32] [ i32 4, i32 8 ] ; <[2 x i32]*> [#uses=2]
|
||||
|
||||
define i32 @test1(i1 %c) {
|
||||
%Atmp = load i32* @A ; <i32> [#uses=2]
|
||||
%Atmp = load i32, i32* @A ; <i32> [#uses=2]
|
||||
br label %Loop
|
||||
|
||||
Loop: ; preds = %Loop, %0
|
||||
%ToRemove = load i32* @A ; <i32> [#uses=1]
|
||||
%ToRemove = load i32, i32* @A ; <i32> [#uses=1]
|
||||
store i32 %Atmp, i32* @B
|
||||
br i1 %c, label %Out, label %Loop
|
||||
|
||||
@@ -24,7 +24,7 @@ Out: ; preds = %Loop
|
||||
|
||||
; The Loop block should be empty after the load/store are promoted.
|
||||
; CHECK: @test1
|
||||
; CHECK: load i32* @A
|
||||
; CHECK: load i32, i32* @A
|
||||
; CHECK: Loop:
|
||||
; CHECK-NEXT: br i1 %c, label %Out, label %Loop
|
||||
; CHECK: Out:
|
||||
@@ -35,10 +35,10 @@ define i32 @test2(i1 %c) {
|
||||
br label %Loop
|
||||
|
||||
Loop: ; preds = %Loop, %0
|
||||
%AVal = load i32* @A ; <i32> [#uses=2]
|
||||
%AVal = load i32, i32* @A ; <i32> [#uses=2]
|
||||
%C0 = getelementptr [2 x i32], [2 x i32]* @C, i64 0, i64 0 ; <i32*> [#uses=1]
|
||||
store i32 %AVal, i32* %C0
|
||||
%BVal = load i32* @B ; <i32> [#uses=2]
|
||||
%BVal = load i32, i32* @B ; <i32> [#uses=2]
|
||||
%C1 = getelementptr [2 x i32], [2 x i32]* @C, i64 0, i64 1 ; <i32*> [#uses=1]
|
||||
store i32 %BVal, i32* %C1
|
||||
br i1 %c, label %Out, label %Loop
|
||||
|
||||
@@ -4,9 +4,9 @@ define i32 @test() {
|
||||
; CHECK: ret i32 0
|
||||
%A = alloca i32 ; <i32*> [#uses=3]
|
||||
call void @foo( i32* %A )
|
||||
%X = load i32* %A ; <i32> [#uses=1]
|
||||
%X = load i32, i32* %A ; <i32> [#uses=1]
|
||||
tail call void @bar( )
|
||||
%Y = load i32* %A ; <i32> [#uses=1]
|
||||
%Y = load i32, i32* %A ; <i32> [#uses=1]
|
||||
%Z = sub i32 %X, %Y ; <i32> [#uses=1]
|
||||
ret i32 %Z
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ for.cond2: ; preds = %for.body5, %for.con
|
||||
|
||||
for.body5: ; preds = %for.cond2
|
||||
%arrayidx = getelementptr inbounds [2 x i64], [2 x i64]* undef, i32 0, i64 0
|
||||
%tmp7 = load i64* %arrayidx, align 8
|
||||
%tmp7 = load i64, i64* %arrayidx, align 8
|
||||
%arrayidx9 = getelementptr inbounds [2 x i64], [2 x i64]* undef, i32 0, i64 undef
|
||||
%tmp10 = load i64* %arrayidx9, align 8
|
||||
%tmp10 = load i64, i64* %arrayidx9, align 8
|
||||
br label %for.cond2
|
||||
|
||||
for.end22: ; preds = %for.cond
|
||||
|
||||
@@ -112,7 +112,7 @@ for.loop.exit:
|
||||
|
||||
define void @test_spec2006() {
|
||||
%h = alloca [1 x [2 x i32*]], align 16
|
||||
%d.val = load i32* @d, align 4
|
||||
%d.val = load i32, i32* @d, align 4
|
||||
%d.promoted = sext i32 %d.val to i64
|
||||
%1 = icmp slt i32 %d.val, 2
|
||||
br i1 %1, label %.lr.ph, label %3
|
||||
@@ -168,7 +168,7 @@ for.loop.exit:
|
||||
|
||||
define void @test_modulo_analysis_with_global() {
|
||||
%h = alloca [1 x [2 x i32*]], align 16
|
||||
%b = load i32* @b, align 4
|
||||
%b = load i32, i32* @b, align 4
|
||||
%b.promoted = sext i32 %b to i64
|
||||
br label %for.loop
|
||||
|
||||
|
||||
Reference in New Issue
Block a user