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: llvm-split -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; CHECK0-DAG: @afoo = alias [2 x i8*], [2 x i8*]* @foo
; CHECK1-DAG: @afoo = external global [2 x i8*]
@afoo = alias [2 x i8*], [2 x i8*]* @foo
; CHECK0-DAG: declare void @abar()
; CHECK1-DAG: @abar = alias void (), void ()* @bar
@abar = alias void (), void ()* @bar
@foo = global [2 x i8*] [i8* bitcast (void ()* @bar to i8*), i8* bitcast (void ()* @abar to i8*)]
define void @bar() {
store [2 x i8*] zeroinitializer, [2 x i8*]* @foo
store [2 x i8*] zeroinitializer, [2 x i8*]* @afoo
ret void
}

View File

@ -0,0 +1,37 @@
; Test that blockaddress target is in the same partition.
; RUN: llvm-split -j5 -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1234 %s
; RUN: llvm-dis -o - %t2 | FileCheck --check-prefix=CHECK1234 %s
; RUN: llvm-dis -o - %t3 | FileCheck --check-prefix=CHECK1234 %s
; RUN: llvm-dis -o - %t4 | FileCheck --check-prefix=CHECK1234 %s
; CHECK0: @xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)]
; CHECK1234: @xxx = external global [2 x i8*]
; CHECK1234-NOT: blockaddress
@xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)]
; CHECK0: define i32 @f()
; CHECK1234: declare i32 @f()
define i32 @f(){
entry:
br label %exit
exit:
ret i32 0
}
; CHECK0: define i32 @g()
; CHECK1234: declare i32 @g()
define i32 @g(){
entry:
br label %exit
exit:
ret i32 0
}
; CHECK0: define i8* @h()
; CHECK1234: declare i8* @h()
define i8* @h(){
entry:
ret i8* blockaddress(@f, %exit)
}

View File

@ -0,0 +1,19 @@
; RUN: llvm-split -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
$foo = comdat any
; CHECK0: define void @foo()
; CHECK1: declare void @foo()
define void @foo() comdat {
call void @bar()
ret void
}
; CHECK0: define void @bar()
; CHECK1: declare void @bar()
define void @bar() comdat($foo) {
call void @foo()
ret void
}

View File

@ -0,0 +1,12 @@
; Test that extern_weak linkage is preserved.
; RUN: llvm-split -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck %s
; RUN: llvm-dis -o - %t1 | FileCheck %s
; Both declarations are extern_weak in all partitions.
; CHECK: @x = extern_weak global i32, align 4
@x = extern_weak global i32, align 4
; CHECK: declare extern_weak void @f(...)
declare extern_weak void @f(...)

View File

@ -0,0 +1,17 @@
; RUN: llvm-split -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; CHECK0: define void @foo()
; CHECK1: declare void @foo()
define void @foo() {
call void @bar()
ret void
}
; CHECK0: declare void @bar()
; CHECK1: define void @bar()
define void @bar() {
call void @foo()
ret void
}

View File

@ -0,0 +1,11 @@
; RUN: llvm-split -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; CHECK0: @foo = global i8* bitcast
; CHECK1: @foo = external global i8*
@foo = global i8* bitcast (i8** @bar to i8*)
; CHECK0: @bar = external global i8*
; CHECK1: @bar = global i8* bitcast
@bar = global i8* bitcast (i8** @foo to i8*)

View File

@ -0,0 +1,17 @@
; RUN: llvm-split -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; CHECK0: define hidden void @foo()
; CHECK1: declare hidden void @foo()
define internal void @foo() {
call void @bar()
ret void
}
; CHECK0: declare void @bar()
; CHECK1: define void @bar()
define void @bar() {
call void @foo()
ret void
}

View File

@ -0,0 +1,18 @@
; Test that "personality" attributes are correctly updated when cloning modules.
; RUN: llvm-split -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; CHECK0: define void @foo()
; CHECK1: declare void @foo()
define void @foo() {
ret void
}
; CHECK0: declare void @bar()
; CHECK0-NOT: personality
; CHECK1: define void @bar() personality i8* bitcast (void ()* @foo to i8*)
define void @bar() personality i8* bitcast (void ()* @foo to i8*)
{
ret void
}

View File

@ -0,0 +1,65 @@
; RUN: llvm-split -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; The local_var and local_func must not be separated.
; CHECK0: @local_var
; CHECK0: define internal fastcc void @local_func
; The main and a must not be separated.
; The main and local_func must not be together.
; CHECK1: @a
; CHECK1: define i32 @main
; CHECK1: declare fastcc void @local_func
@a = internal global i32 0, align 4
@global_storage = common global i32 0, align 4
@local_var = internal global i32 0, align 4
; Function Attrs: nounwind
define i32 @main(i32 %x) {
entry:
%call = call fastcc i32 @foo(i32 %x, i32* nonnull @a)
%call1 = call fastcc i32 @baz(i32 %x)
%add = add nsw i32 %call, %call1
ret i32 %add
}
; Function Attrs: nounwind
define fastcc i32 @bar(i32 %b) {
entry:
%call = call fastcc i32 @baz(i32 %b)
ret i32 %call
}
; Function Attrs: nounwind
define fastcc i32 @baz(i32 %x) {
entry:
store i32 %x, i32* @global_storage, align 4
%shl = shl i32 %x, %x
ret i32 %shl
}
; Function Attrs: noinline nounwind
define fastcc i32 @foo(i32 %a, i32* nocapture %b) {
entry:
call fastcc void @local_func()
%call = call fastcc i32 @bar(i32 %a)
%0 = load i32, i32* @global_storage, align 4
%call1 = call fastcc i32 @baz(i32 %0)
%add = add nsw i32 %call, %call1
store i32 %add, i32* %b, align 4
%call.i = call fastcc i32 @baz(i32 %add) #2
%add.i = add nsw i32 %call.i, 2
%1 = load volatile i32, i32* @local_var, align 4
%add3 = add nsw i32 %add.i, %1
ret i32 %add3
}
; Function Attrs: noinline nounwind
define internal fastcc void @local_func() section ".text" {
entry:
%0 = load i32, i32* @global_storage, align 4
%call = call fastcc i32 @foo(i32 %0, i32* null)
store volatile i32 %call, i32* @local_var, align 4
ret void
}

View File

@ -0,0 +1,48 @@
; All of the functions in this module must end up
; in the same partition without change of scope.
; RUN: llvm-split -j=2 -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
; CHECK0: declare i32 @funInternal
; CHECK0: declare i32 @funExternal
; CHECK0: declare i32 @funInternal2
; CHECK0: declare i32 @funExternal2
; All functions are in the same file.
; Local functions are still local.
; CHECK1: define internal i32 @funInternal
; CHECK1: define i32 @funExternal
; CHECK1: define internal i32 @funInternal2
; CHECK1: define i32 @funExternal2
@funInternalAlias = internal alias i32 (), i32 ()* @funInternal
define internal i32 @funInternal() {
entry:
ret i32 0
}
; Direct call to local alias
define i32 @funExternal() {
entry:
%x = call i32 @funInternalAlias()
ret i32 %x
}
; Call to local function that calls local alias
define internal i32 @funInternal2() {
entry:
%x = call i32 @funInternalAlias()
ret i32 %x
}
define i32 @funExternal2() {
entry:
%x = call i32 @funInternal2()
ret i32 %x
}

View File

@ -0,0 +1,48 @@
; All of the functions in this module must end up
; in the same partition.
; RUN: llvm-split -j=2 -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
; CHECK0: declare i32 @funInternal0
; CHECK0: declare i32 @funInternal1
; CHECK0: declare i32 @funInternal2
; CHECK0: declare i32 @funExternal
; All functions are in the same file.
; Local functions are still local.
; CHECK1: define internal i32 @funInternal0
; CHECK1: define internal i32 @funInternal1
; CHECK1: define internal i32 @funInternal2
; CHECK1: define i32 @funExternal
; CHECK1: define i32 @funExternal2
define internal i32 @funInternal0() {
entry:
ret i32 0
}
define internal i32 @funInternal1() {
entry:
%x = call i32 @funInternal0()
ret i32 %x
}
define internal i32 @funInternal2() {
entry:
%x = call i32 @funInternal1()
ret i32 %x
}
define i32 @funExternal() {
entry:
%x = call i32 @funInternal2()
ret i32 %x
}
define i32 @funExternal2() {
entry:
%x = call i32 @funInternal0()
ret i32 %x
}

View File

@ -0,0 +1,32 @@
; All functions in the same comdat group must
; be in the same module
; RUN: llvm-split -j=2 -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
; CHECK0: declare i32 @fun1
; CHECK0: declare i32 @fun2
; CHECK0: declare i32 @fun3
; CHECK1: define internal i32 @fun1
; CHECK1: define internal i32 @fun2
; CHECK1: define i32 @fun3
$fun = comdat any
define internal i32 @fun1() section ".text.funs" comdat($fun) {
entry:
ret i32 0
}
define internal i32 @fun2() section ".text.funs" comdat($fun) {
entry:
ret i32 0
}
define i32 @fun3() section ".text.funs" comdat($fun) {
entry:
ret i32 0
}

View File

@ -0,0 +1,38 @@
; We should never separate alias from aliasee.
; RUN: llvm-split -j=3 -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t2 | FileCheck --check-prefix=CHECK2 %s
; Checks are not critical here - verifier will assert if we fail.
; CHECK0: @g1 = global i32 99
; CHECK0: @c1Alias = external global i8
; CHECK0: @g1Alias = internal alias i8, bitcast (i32* @g1 to i8*)
; CHECK1: @g1 = external global i32
; CHECK1: @c1Alias = internal alias i8, inttoptr (i64 42 to i8*)
; Third file is actually empty.
; CHECK2: @g1 = external global i32
; CHECK2: @g1Alias = external global i8
; CHECK2: @c1Alias = external global i8
@g1 = global i32 99
@g1Alias = internal alias i8, bitcast (i32* @g1 to i8*)
@c1Alias = internal alias i8, inttoptr (i64 42 to i8*)
@funExternalAlias = alias i8 (), i8 ()* @funExternal
define i8 @funExternal() {
entry:
%x = load i8, i8* @g1Alias
ret i8 %x
}
define i8 @funExternal2() {
entry:
%x = load i8, i8* @c1Alias
%y = call i8 @funExternalAlias()
%z = add i8 %x, %y
ret i8 %z
}

View File

@ -0,0 +1,48 @@
; All of the functions in this module must end up
; in the same partition.
; RUN: llvm-split -j=2 -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
; CHECK0: declare i32 @foo
; CHECK0: declare i32 @baz
; CHECK0: declare i32 @bar
; CHECK0: declare i32 @bar2
; CHECK1: @bla
; CHECK1: @bla2
; CHECK1: define internal i32 @foo
; CHECK1: define internal i32 @baz
; CHECK1: define i32 @bar
; CHECK1: define i32 @bar2
%struct.anon = type { i64, i64 }
@bla = internal global %struct.anon { i64 1, i64 2 }, align 8
@bla2 = internal global %struct.anon { i64 1, i64 2 }, align 8
define internal i32 @foo() {
entry:
store i64 5, i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla, i32 0, i32 0), align 8
store i32 -1, i32* bitcast (i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla2, i32 0, i32 1) to i32*), align 8
ret i32 0
}
define internal i32 @baz() {
entry:
store i64 5, i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla, i32 0, i32 0), align 8
store i32 -1, i32* bitcast (i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla2, i32 0, i32 1) to i32*), align 8
ret i32 0
}
define i32 @bar() {
%call = call i32 @foo()
ret i32 0
}
define i32 @bar2() {
%call = call i32 @baz()
ret i32 0
}

View File

@ -0,0 +1,44 @@
; All of the functions in this module must end up
; in the same partition.
; Mutually recursive calls
; RUN: llvm-split -j=2 -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
; CHECK0: declare i32 @funInternal0
; CHECK0: declare i32 @funInternal1
; CHECK0: declare i32 @funExternal0
; CHECK0: declare i32 @funExternal1
; CHECK1: define internal i32 @funInternal0
; CHECK1: define internal i32 @funInternal1
; CHECK1: define i32 @funExternal0
; CHECK1: define i32 @funExternal1
define internal i32 @funInternal0() {
entry:
%x = call i32 @funInternal1()
ret i32 %x
}
define internal i32 @funInternal1() {
entry:
%x = call i32 @funInternal0()
ret i32 %x
}
; Extrnal functions
define i32 @funExternal0() {
entry:
%x = call i32 @funInternal0()
ret i32 %x
}
define i32 @funExternal1() {
entry:
%x = call i32 @funInternal1()
ret i32 %x
}

View File

@ -0,0 +1,47 @@
; We should never separate alias from aliasee.
; RUN: llvm-split -j=3 -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t2 | FileCheck --check-prefix=CHECK2 %s
; Checks are not critical here - verifier will assert if we fail.
; CHECK0: @funInternal2Alias = alias
; CHECK0: @funExternal2Alias = alias
; CHECK0: define internal i32 @funInternal2
; CHECK0: define i32 @funExternal2
; CHECK1: @funInternalAlias = alias
; CHECK1: define internal i32 @funInternal
; CHECK2: @funExternalAlias = alias
; CHECK2: define i32 @funExternal
@funInternalAlias = alias i32 (), i32 ()* @funInternal
@funExternalAlias = alias i32 (), i32 ()* @funExternal
@funInternal2Alias = alias i32 (), i32 ()* @funInternal2
@funExternal2Alias = alias i32 (), i32 ()* @funExternal2
define internal i32 @funInternal() {
entry:
ret i32 0
}
define i32 @funExternal() {
entry:
%x = call i32 @funInternalAlias()
ret i32 %x
}
define internal i32 @funInternal2() {
entry:
%x = call i32 @funInternalAlias()
ret i32 %x
}
define i32 @funExternal2() {
entry:
%x = call i32 @funInternal2()
%y = call i32 @funExternalAlias()
%z = add nsw i32 %x, %y
ret i32 %z
}

View File

@ -0,0 +1,28 @@
; All of the functions and globals in this module must end up
; in the same partition.
; RUN: llvm-split -j=2 -preserve-locals -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
; CHECK0: declare %struct.anon* @local0
; CHECK0: declare i8** @local1
; CHECK1: @bla
; CHECK1: @ptr
; CHECK1: define internal %struct.anon* @local0
; CHECK1: define internal i8** @local1
%struct.anon = type { i64, i64 }
@bla = internal global %struct.anon { i64 1, i64 2 }, align 8
@ptr = internal global i8* bitcast (%struct.anon* @bla to i8*), align 4
define internal %struct.anon* @local0() {
ret %struct.anon* @bla
}
define internal i8** @local1() {
ret i8** @ptr
}

View File

@ -0,0 +1,31 @@
; RUN: llvm-split -o %t %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
; CHECK0: declare hidden void @__llvmsplit_unnamed()
; CHECK1: define hidden void @__llvmsplit_unnamed()
define internal void @0() {
; CHECK1: call void @foo()
call void @foo()
ret void
}
; CHECK0: declare hidden void @__llvmsplit_unnamed.1()
; CHECK1: define hidden void @__llvmsplit_unnamed.1()
define internal void @1() {
; CHECK1: call void @foo()
; CHECK1: call void @foo()
call void @foo()
call void @foo()
ret void
}
; CHECK0: define void @foo()
; CHECK1: declare void @foo()
define void @foo() {
; CHECK0: call void @__llvmsplit_unnamed.1()
; CHECK0: call void @__llvmsplit_unnamed()
call void @1()
call void @0()
ret void
}