Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,19 @@
; RUN: opt -basicaa -print-alias-sets -S -o - < %s 2>&1 | FileCheck %s
; CHECK: Alias sets for function 'test1':
; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1)
; CHECK-NOT: 1 Unknown instruction
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
define void @test1(i32 %c) {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
store i8 1, i8* %a, align 1
%cond1 = icmp ne i32 %c, 0
call void @llvm.assume(i1 %cond1)
store i8 1, i8* %b, align 1
ret void
}
declare void @llvm.assume(i1)

View File

@ -0,0 +1,114 @@
; RUN: opt -basicaa -print-alias-sets -S -o - < %s 2>&1 | FileCheck %s
@s = global i8 1, align 1
@d = global i8 2, align 1
; CHECK: Alias sets for function 'test1':
; CHECK: Alias Set Tracker: 3 alias sets for 4 pointer values.
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1)
; CHECK-NOT: 1 Unknown instructions
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref Pointers: (i8* %s, 1), (i8* %d, 1)
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
define void @test1(i8* %s, i8* %d) {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
store i8 1, i8* %a, align 1
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %d, i8* %s, i64 1, i32 1, i1 false)
store i8 1, i8* %b, align 1
ret void
}
; CHECK: Alias sets for function 'test2':
; CHECK: Alias Set Tracker: 3 alias sets for 4 pointer values.
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1)
; CHECK-NOT: 1 Unknown instructions
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref [volatile] Pointers: (i8* %s, 1), (i8* %d, 1)
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
define void @test2(i8* %s, i8* %d) {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
store i8 1, i8* %a, align 1
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %d, i8* %s, i64 1, i32 1, i1 true)
store i8 1, i8* %b, align 1
ret void
}
; CHECK: Alias sets for function 'test3':
; CHECK: Alias Set Tracker: 3 alias sets for 4 pointer values.
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1)
; CHECK-NOT: 1 Unknown instructions
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref Pointers: (i8* %s, 1), (i8* %d, 1)
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
define void @test3(i8* %s, i8* %d) {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
store i8 1, i8* %a, align 1
call void @llvm.memmove.p0i8.p0i8.i64(i8* %d, i8* %s, i64 1, i32 1, i1 false)
store i8 1, i8* %b, align 1
ret void
}
; CHECK: Alias sets for function 'test4':
; CHECK: Alias Set Tracker: 3 alias sets for 4 pointer values.
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1)
; CHECK-NOT: 1 Unknown instructions
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref [volatile] Pointers: (i8* %s, 1), (i8* %d, 1)
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
define void @test4(i8* %s, i8* %d) {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
store i8 1, i8* %a, align 1
call void @llvm.memmove.p0i8.p0i8.i64(i8* %d, i8* %s, i64 1, i32 1, i1 true)
store i8 1, i8* %b, align 1
ret void
}
; CHECK: Alias sets for function 'test5':
; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod/Ref Pointers: (i8* %a, 1)
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
define void @test5() {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
store i8 1, i8* %a, align 1
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 1, i32 1, i1 false)
store i8 1, i8* %b, align 1
ret void
}
; CHECK: Alias sets for function 'test6':
; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod/Ref Pointers: (i8* %a, 1)
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
define void @test6() {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
store i8 1, i8* %a, align 1
call void @llvm.memmove.p0i8.p0i8.i64(i8* %b, i8* %a, i64 1, i32 1, i1 false)
store i8 1, i8* %b, align 1
ret void
}
; CHECK: Alias sets for function 'test7':
; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod/Ref Pointers: (i8* %a, 1)
; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod/Ref Pointers: (i8* %b, 1)
define void @test7() {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
store i8 1, i8* %a, align 1
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 1, i32 1, i1 false)
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 1, i32 1, i1 false)
store i8 1, i8* %b, align 1
ret void
}
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1)
declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)

View File

@ -0,0 +1,53 @@
; RUN: opt -basicaa -print-alias-sets -alias-set-saturation-threshold=2 -S -o - < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=NOSAT
; RUN: opt -basicaa -print-alias-sets -alias-set-saturation-threshold=1 -S -o - < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=SAT
; CHECK-LABEL: 'allmust'
; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %a, 4)
; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %b, 4)
; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %c, 4)
; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %d, 4)
define void @allmust() {
%a = alloca i32
%b = alloca i32
%c = alloca i32
%d = alloca i32
store i32 1, i32* %a
store i32 2, i32* %b
store i32 3, i32* %c
store i32 4, i32* %d
ret void
}
; CHECK-LABEL :'mergemay'
; NOSAT: AliasSet[{{.*}}, 2] may alias, Mod Pointers: (i32* %a, 4), (i32* %a1, 4)
; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %b, 4)
; SAT: AliasSet[{{.*}}, 2] may alias, Mod forwarding to 0x[[FWD:[0-9a-f]*]]
; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD]]
; SAT: AliasSet[0x[[FWD]], 2] may alias, Mod/Ref Pointers: (i32* %a, 4), (i32* %a1, 4), (i32* %b, 4)
define void @mergemay(i32 %k) {
%a = alloca i32
%b = alloca i32
store i32 1, i32* %a
store i32 2, i32* %b
%a1 = getelementptr i32, i32 *%a, i32 %k
store i32 2, i32* %a1
ret void
}
; CHECK-LABEL: 'mergemust'
; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %a, 4)
; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %b, 4)
; NOSAT: AliasSet[{{.*}}, 2] may alias, Mod Pointers: (i32* %c, 4), (i32* %d, 4)
; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD:[0-9a-f]*]]
; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD]]
; SAT: AliasSet[{{.*}}, 2] may alias, Mod forwarding to 0x[[FWD]]
; SAT: AliasSet[0x[[FWD]], 3] may alias, Mod/Ref Pointers: (i32* %a, 4), (i32* %b, 4), (i32* %c, 4), (i32* %d, 4)
define void @mergemust(i32* %c, i32* %d) {
%a = alloca i32
%b = alloca i32
store i32 1, i32* %a
store i32 2, i32* %b
store i32 3, i32* %c
store i32 4, i32* %d
ret void
}

View File

@ -0,0 +1,25 @@
; RUN: opt -S -licm -loop-unswitch < %s | FileCheck %s
; This test checks for a crash. See PR32587.
@global = external global i32
declare i32 @f_1(i8, i32 returned)
define i32 @f_0() {
; CHECK-LABEL: @f_0(
bb:
br label %bb1
bb1: ; preds = %bb3, %bb
%tmp = load i32, i32* @global
%tmp2 = select i1 false, i16 1, i16 0
br label %bb3
bb3: ; preds = %bb3, %bb1
%tmp4 = phi i8 [ 0, %bb1 ], [ %tmp6, %bb3 ]
%tmp5 = icmp eq i16 %tmp2, 0
%tmp6 = select i1 %tmp5, i8 %tmp4, i8 1
%tmp7 = tail call i32 @f_1(i8 %tmp6, i32 1)
br i1 false, label %bb1, label %bb3
}

View File

@ -0,0 +1,22 @@
; RUN: opt < %s -disable-output -passes='print<assumptions>' 2>&1 | FileCheck %s
target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
declare void @llvm.assume(i1)
define void @test1(i32 %a) {
; CHECK-LABEL: Cached assumptions for function: test1
; CHECK-NEXT: icmp ne i32 %{{.*}}, 0
; CHECK-NEXT: icmp slt i32 %{{.*}}, 0
; CHECK-NEXT: icmp sgt i32 %{{.*}}, 0
entry:
%cond1 = icmp ne i32 %a, 0
call void @llvm.assume(i1 %cond1)
%cond2 = icmp slt i32 %a, 0
call void @llvm.assume(i1 %cond2)
%cond3 = icmp sgt i32 %a, 0
call void @llvm.assume(i1 %cond3)
ret void
}

View File

@ -0,0 +1,20 @@
; This testcase makes sure that size is taken to account when alias analysis
; is performed. It is not legal to delete the second load instruction because
; the value computed by the first load instruction is changed by the store.
; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
define i32 @test() {
; 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, 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, i32* %A
%Z = sub i32 %X, %Y.DONOTREMOVE
ret i32 %Z
}

View File

@ -0,0 +1,7 @@
; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null
; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
define void @test({[2 x i32],[2 x i32]}* %A, i64 %X, i64 %Y) {
%P1 = getelementptr {[2 x i32],[2 x i32]}, {[2 x i32],[2 x i32]}* %A, i64 0, i32 0, i64 %X
%P2 = getelementptr {[2 x i32],[2 x i32]}, {[2 x i32],[2 x i32]}* %A, i64 0, i32 1, i64 %Y
ret void
}

View File

@ -0,0 +1,14 @@
; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
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, i32* %P1
store i32 5, i32* %P2
%Y = load i32, i32* %P1
%Z = sub i32 %X, %Y
ret i32 %Z
}

View File

@ -0,0 +1,7 @@
; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null
; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
define void @test([17 x i16]* %mask_bits) {
%P1 = getelementptr [17 x i16], [17 x i16]* %mask_bits, i64 0, i64 0
%P2 = getelementptr [17 x i16], [17 x i16]* %mask_bits, i64 252645134, i64 0
ret void
}

View File

@ -0,0 +1,21 @@
; RUN: opt < %s -basicaa -licm -disable-output
%struct..apr_array_header_t = type { i32*, i32, i32, i32, i8* }
%struct..apr_table_t = type { %struct..apr_array_header_t, i32, [32 x i32], [32 x i32] }
define void @table_reindex(%struct..apr_table_t* %t.1) { ; No predecessors!
br label %loopentry
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, i32* %tmp.101 ; <i32> [#uses=0]
br i1 false, label %no_exit, label %UnifiedExitNode
no_exit: ; preds = %loopentry
%tmp.25 = sext i32 0 to i64 ; <i64> [#uses=1]
%tmp.261 = getelementptr %struct..apr_table_t, %struct..apr_table_t* %t.1, i64 0, i32 3, i64 %tmp.25 ; <i32*> [#uses=1]
store i32 0, i32* %tmp.261
br label %loopentry
UnifiedExitNode: ; preds = %loopentry
ret void
}

View File

@ -0,0 +1,11 @@
; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null
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, i32* %tmp.961
%tmp.119 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 1, i64 0
%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, i32* %tmp.1541
ret i32 0
}

View File

@ -0,0 +1,10 @@
; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null
%struct..RefPoint = type { i32, { i32, i8, i8 } }
%struct..RefRect = type { %struct..RefPoint, %struct..RefPoint }
define i32 @BMT_CommitPartDrawObj() {
%tmp.19111 = getelementptr %struct..RefRect, %struct..RefRect* null, i64 0, i32 0, i32 1, i32 2
%tmp.20311 = getelementptr %struct..RefRect, %struct..RefRect* null, i64 0, i32 1, i32 1, i32 2
ret i32 0
}

View File

@ -0,0 +1,15 @@
; In this test, a local alloca cannot alias an incoming argument.
; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
; CHECK: define i32 @test
; CHECK-NEXT: ret i32 0
define i32 @test(i32* %P) {
%X = alloca i32
%V1 = load i32, i32* %P
store i32 0, i32* %X
%V2 = load i32, i32* %P
%Diff = sub i32 %V1, %V2
ret i32 %Diff
}

View File

@ -0,0 +1,20 @@
; This testcase consists of alias relations which should be completely
; resolvable by basicaa.
; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
%T = type { i32, [10 x i8] }
; CHECK: Function: test
; CHECK-NOT: MayAlias:
define void @test(%T* %P) {
%A = getelementptr %T, %T* %P, i64 0
%B = getelementptr %T, %T* %P, i64 0, i32 0
%C = getelementptr %T, %T* %P, i64 0, i32 1
%D = getelementptr %T, %T* %P, i64 0, i32 1, i64 0
%E = getelementptr %T, %T* %P, i64 0, i32 1, i64 5
ret void
}

View File

@ -0,0 +1,22 @@
; This testcase consists of alias relations which should be completely
; resolvable by basicaa, but require analysis of getelementptr constant exprs.
; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
%T = type { i32, [10 x i8] }
@G = external global %T
; CHECK: Function: test
; CHECK-NOT: MayAlias:
define void @test() {
%D = getelementptr %T, %T* @G, i64 0, i32 0
%E = getelementptr %T, %T* @G, i64 0, i32 1, i64 5
%F = getelementptr i32, i32* getelementptr (%T, %T* @G, i64 0, i32 0), i64 0
%X = getelementptr [10 x i8], [10 x i8]* getelementptr (%T, %T* @G, i64 0, i32 1), i64 0, i64 5
ret void
}

View File

@ -0,0 +1,11 @@
; RUN: opt < %s -basicaa -dse -S | FileCheck %s
define void @test({i32,i32 }* %P) {
; CHECK: store i32 0, i32* %X
%Q = getelementptr {i32,i32}, {i32,i32}* %P, i32 1
%X = getelementptr {i32,i32}, {i32,i32}* %Q, i32 0, i32 1
%Y = getelementptr {i32,i32}, {i32,i32}* %Q, i32 1, i32 1
store i32 0, i32* %X
store i32 1, i32* %Y
ret void
}

View File

@ -0,0 +1,33 @@
; RUN: opt < %s -basicaa -aa-eval -disable-output 2>&1 | FileCheck %s
; TEST that A[1][0] may alias A[0][i].
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
; CHECK: 2 no alias responses
define void @test(i32 %N) {
entry:
%X = alloca [3 x [3 x i32]] ; <[3 x [3 x i32]]*> [#uses=4]
%tmp.24 = icmp sgt i32 %N, 0 ; <i1> [#uses=1]
br i1 %tmp.24, label %no_exit, label %loopexit
no_exit: ; preds = %no_exit, %entry
%i.0.0 = phi i32 [ 0, %entry ], [ %inc, %no_exit ] ; <i32> [#uses=2]
%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, 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, 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]
br i1 %tmp.2, label %no_exit, label %loopexit
loopexit: ; preds = %no_exit, %entry
%Y.0.1 = phi i32 [ 0, %entry ], [ %tmp.13, %no_exit ] ; <i32> [#uses=1]
%tmp.4 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0 ; <[3 x i32]*> [#uses=1]
%tmp.15 = call i32 (...) @foo( [3 x i32]* %tmp.4, i32 %Y.0.1 ) ; <i32> [#uses=0]
ret void
}
declare i32 @foo(...)

View File

@ -0,0 +1,48 @@
; RUN: opt < %s -basicaa -licm -disable-output
target datalayout = "E-p:32:32"
target triple = "powerpc-apple-darwin8.7.0"
define void @glgRunProcessor() {
entry:
br i1 false, label %bb2037.i, label %cond_true.i18
cond_true.i18: ; preds = %entry
ret void
bb205.i: ; preds = %bb2037.i
switch i32 0, label %bb1013.i [
i32 14, label %bb239.i
i32 15, label %bb917.i
]
bb239.i: ; preds = %bb205.i
br i1 false, label %cond_false277.i, label %cond_true264.i
cond_true264.i: ; preds = %bb239.i
ret void
cond_false277.i: ; preds = %bb239.i
%tmp1062.i = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* null, i32 0, i32 1 ; <<4 x i32>*> [#uses=1]
store <4 x i32> zeroinitializer, <4 x i32>* %tmp1062.i
br i1 false, label %cond_true1032.i, label %cond_false1063.i85
bb917.i: ; preds = %bb205.i
ret void
bb1013.i: ; preds = %bb205.i
ret void
cond_true1032.i: ; preds = %cond_false277.i
%tmp1187.i = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* null, i32 0, i32 0, i32 7 ; <i32*> [#uses=1]
store i32 0, i32* %tmp1187.i
br label %bb2037.i
cond_false1063.i85: ; preds = %cond_false277.i
ret void
bb2037.i: ; preds = %cond_true1032.i, %entry
br i1 false, label %bb205.i, label %cond_next2042.i
cond_next2042.i: ; preds = %bb2037.i
ret void
}

View File

@ -0,0 +1,34 @@
; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
; PR1109
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin8"
%struct.CONSTRAINT = type { i32, i32, i32, i32 }
%struct.FILE_POS = type { i8, i8, i16, i32 }
%struct.FIRST_UNION = type { %struct.FILE_POS }
%struct.FOURTH_UNION = type { %struct.CONSTRAINT }
%struct.GAP = type { i8, i8, i16 }
%struct.LIST = type { %struct.rec*, %struct.rec* }
%struct.SECOND_UNION = type { { i16, i8, i8 } }
%struct.STYLE = type { { %struct.GAP }, { %struct.GAP }, i16, i16, i16, i8, i8 }
%struct.THIRD_UNION = type { { [2 x i32], [2 x i32] } }
%struct.closure_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* } }
%struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
%struct.rec = type { %struct.head_type }
; CHECK: define i32 @test
; CHECK: %Z = sub i32 %A, %Q
; CHECK: ret i32 %Z
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, 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, i32* %tmp18174 ; <i32> [#uses=1]
%Z = sub i32 %A, %Q ; <i32> [#uses=1]
ret i32 %Z
}

View File

@ -0,0 +1,13 @@
; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
; CHECK: Function: foo
; CHECK: MayAlias: i32* %x, i32* %y
define void @foo(i32* noalias %x) {
%y = call i32* @unclear(i32* %x)
store i32 0, i32* %x
store i32 0, i32* %y
ret void
}
declare i32* @unclear(i32* %a)

Some files were not shown because too many files have changed in this diff Show More