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,5 @@
.section __FOO,__bitcode
.asciz "Wrong Section"
.section __LLVM,__bitcode
.incbin "bcsection.bc"

View File

@@ -0,0 +1,2 @@
.section .llvmbc
.incbin "bcsection.bc"

Binary file not shown.

View File

@@ -0,0 +1,4 @@
@glob = global i32 0
define void @bar() {
ret void
}

View File

@@ -0,0 +1,8 @@
%struct.rtx_def = type { i16, i16 }
define void @bar(%struct.rtx_def* %a, i8 %b, i32 %c) {
call void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* %a, i8 %b, i32 %c, i32 4, i1 true)
ret void
}
declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i32, i1)

View File

@@ -0,0 +1,8 @@
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
%some_named_struct = type { i8, i8 }
define void @bar(%some_named_struct*) {
ret void
}

View File

@@ -0,0 +1,15 @@
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12"
define void @bar() !dbg !3 {
ret void
}
!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!1}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2)
!2 = !DIFile(filename: "broken", directory: "")
!3 = distinct !DISubprogram(line: 1000, isDefinition: true)

View File

@@ -0,0 +1,21 @@
source_filename = "test/LTO/X86/Inputs/type-mapping-src.ll"
target triple = "x86_64-pc-windows-msvc18.0.0"
%SrcType = type { i8 }
%CommonStruct = type opaque
@x = external global %SrcType
@bar = internal global %CommonStruct* null, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!8}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "bar", linkageName: "bar", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "b", directory: "/")
!4 = !{}
!5 = !{!0}
!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64)
!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !3, line: 1, flags: DIFlagFwdDecl, identifier: ".?AUS@@")
!8 = !{i32 2, !"Debug Info Version", i32 3}

View File

@@ -0,0 +1,15 @@
; RUN: llvm-as < %s >%t1
; RUN: llvm-lto -exported-symbol=test_x86_aesni_aeskeygenassist -mattr=+aes -o %t2 %t1
; RUN: llvm-objdump -d %t2 | FileCheck -check-prefix=WITH_AES %s
; RUN: not llvm-lto -exported-symbol=test_x86_aesni_aeskeygenassist -mattr=-aes -o %t3 %t1 2>&1 | FileCheck -check-prefix=WITHOUT_AES %s
target triple = "x86_64-unknown-linux-gnu"
declare <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64>, i8)
define <2 x i64> @test_x86_aesni_aeskeygenassist(<2 x i64> %a0) {
; WITH_AES: test_x86_aesni_aeskeygenassist
; WITH_AES: aeskeygenassist
%res = call <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64> %a0, i8 7)
ret <2 x i64> %res
}
; WITHOUT_AES: LLVM ERROR: Cannot select: intrinsic %llvm.x86.aesni.aeskeygenassist

View File

@@ -0,0 +1,24 @@
; RUN: rm -rf %t && mkdir -p %t
; RUN: llvm-as -o %t/bcsection.bc %s
; RUN: llvm-mc -I=%t -filetype=obj -triple=x86_64-pc-win32 -o %t/bcsection.coff.bco %p/Inputs/bcsection.s
; RUN: llvm-nm %t/bcsection.coff.bco | FileCheck %s
; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %t/bcsection.coff.o %t/bcsection.coff.bco
; RUN: llvm-nm %t/bcsection.coff.o | FileCheck %s
; RUN: llvm-mc -I=%t -filetype=obj -triple=x86_64-unknown-linux-gnu -o %t/bcsection.elf.bco %p/Inputs/bcsection.s
; RUN: llvm-nm %t/bcsection.elf.bco | FileCheck %s
; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %t/bcsection.elf.o %t/bcsection.elf.bco
; RUN: llvm-nm %t/bcsection.elf.o | FileCheck %s
; RUN: llvm-mc -I=%t -filetype=obj -triple=x86_64-apple-darwin11 -o %t/bcsection.macho.bco %p/Inputs/bcsection.macho.s
; RUN: llvm-nm %t/bcsection.macho.bco | FileCheck %s
; RUN: llvm-lto -exported-symbol=main -exported-symbol=_main -o %t/bcsection.macho.o %t/bcsection.macho.bco
; RUN: llvm-nm %t/bcsection.macho.o | FileCheck %s
; REQUIRES: default_triple
; CHECK: main
define i32 @main() {
ret i32 0
}

View File

@@ -0,0 +1,42 @@
; RUN: llvm-as < %s >%t1
; RUN: llvm-lto -o %t2 %t1
; RUN: llvm-nm %t2 | FileCheck %s -check-prefix=NOEXPORT
; RUN: llvm-lto -o %t3 -exported-symbol=main %t1
; RUN: llvm-nm %t3 | FileCheck %s -check-prefix=EXPORT
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
module asm ".text"
module asm ".align 16, 0x90"
module asm ".type PR14512, @function"
module asm "PR14512:.cfi_startproc"
module asm "ret"
module asm ".cfi_endproc"
declare void @PR14512()
; Without -exported-symbol, main should be eliminated by LTO.
; With -exported-symbol=main, main should be preserved by LTO.
define i32 @main(i32 %argc, i8** %argv) {
; NOEXPORT-NOT: main
; EXPORT: main
call void @PR14512()
ret i32 0
}
; RUN: llvm-lto -o %t -dso-symbol=zed1 -dso-symbol=zed2 %t1 -O0
; RUN: llvm-nm %t | FileCheck %s -check-prefix=ZED1_AND_ZED2
; ZED1_AND_ZED2: V zed1
@zed1 = linkonce_odr global i32 42
define i32* @get_zed1() {
ret i32* @zed1
}
; ZED1_AND_ZED2: r zed2
@zed2 = linkonce_odr unnamed_addr constant i32 42
define i32 @useZed2() {
%x = load i32, i32* @zed2
ret i32 %x
}

View File

@@ -0,0 +1,8 @@
; RUN: llvm-as < %s >%t1
; RUN: llvm-lto -o %t2 %t1
; REQUIRES: default_triple
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
module asm ".align 4"

View File

@@ -0,0 +1,13 @@
; LTO default diagnostic handler should be non-exiting.
; This test verifies that after addModule() encounters an error, the diagnostic
; handler does not call exit(1) and instead returns to the caller of addModule.
; RUN: llvm-as <%s >%t1
; RUN: llvm-as <%s >%t2
; RUN: not llvm-lto -use-diagnostic-handler -o /dev/null %t1 %t2 2>&1 | FileCheck %s
target triple = "x86_64-unknown-linux-gnu"
; CHECK: llvm-lto: error: Linking globals named 'goodboy': symbol multiply defined!
; CHECK: llvm-lto{{.*}}: error adding file
@goodboy = global i32 3203383023, align 4 ; 0xbeefbeef

View File

@@ -0,0 +1,42 @@
; Check that the hotness attribute is included in the optimization record file
; with -lto-pass-remarks-with-hotness.
; RUN: llvm-as < %s >%t.bc
; RUN: rm -f %t.yaml
; RUN: llvm-lto -lto-pass-remarks-output=%t.yaml \
; RUN: -lto-pass-remarks-with-hotness \
; RUN: -exported-symbol _main -o %t.o %t.bc
; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s
; YAML: --- !Passed
; YAML-NEXT: Pass: inline
; YAML-NEXT: Name: Inlined
; YAML-NEXT: Function: main
; YAML-NEXT: Hotness: 300
; YAML-NEXT: Args:
; YAML-NEXT: - Callee: foo
; YAML-NEXT: - String: ' inlined into '
; YAML-NEXT: - Caller: main
; YAML-NEXT: - String: ' with cost='
; YAML-NEXT: - Cost: '-15000'
; YAML-NEXT: - String: ' (threshold='
; YAML-NEXT: - Threshold: '337'
; YAML-NEXT: - String: ')'
; YAML-NEXT: ...
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"
declare i32 @bar()
define i32 @foo() {
%a = call i32 @bar()
ret i32 %a
}
define i32 @main() !prof !0 {
%i = call i32 @foo()
ret i32 %i
}
!0 = !{!"function_entry_count", i64 300}

View File

@@ -0,0 +1,117 @@
; RUN: llvm-as < %s >%t.bc
; PR21108: Diagnostic handlers get pass remarks, even if they're not enabled.
; Confirm that there are -pass-remarks.
; RUN: llvm-lto -pass-remarks=inline \
; RUN: -exported-symbol _func2 -pass-remarks-analysis=loop-vectorize \
; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
; RUN: FileCheck %s -allow-empty -check-prefix=REMARKS
; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
; RUN: llvm-lto -pass-remarks=inline -use-diagnostic-handler \
; RUN: -exported-symbol _func2 -pass-remarks-analysis=loop-vectorize \
; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
; RUN: FileCheck %s -allow-empty -check-prefix=REMARKS_DH
; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
; Confirm that -pass-remarks are not printed by default.
; RUN: llvm-lto \
; RUN: -exported-symbol _func2 \
; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
; RUN: FileCheck %s -allow-empty
; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
; RUN: llvm-lto -use-diagnostic-handler \
; RUN: -exported-symbol _func2 \
; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
; RUN: FileCheck %s -allow-empty
; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
; Optimization records are collected regardless of the diagnostic handler
; RUN: rm -f %t.yaml
; RUN: llvm-lto -lto-pass-remarks-output=%t.yaml \
; RUN: -exported-symbol _func2 \
; RUN: -exported-symbol _main -o %t.o %t.bc 2>&1 | \
; RUN: FileCheck %s -allow-empty
; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
; REMARKS: remark: {{.*}} foo inlined into main
; REMARKS: remark: {{.*}} loop not vectorized: cannot prove it is safe to reorder memory operations
; REMARKS_DH: llvm-lto: remark: {{.*}} foo inlined into main
; REMARKS_DH: llvm-lto: remark: {{.*}} loop not vectorized: cannot prove it is safe to reorder memory operations
; CHECK-NOT: remark:
; CHECK-NOT: llvm-lto:
; NM-NOT: foo
; NM: func2
; NM: main
; YAML: --- !Passed
; YAML-NEXT: Pass: inline
; YAML-NEXT: Name: Inlined
; YAML-NEXT: Function: main
; YAML-NEXT: Args:
; YAML-NEXT: - Callee: foo
; YAML-NEXT: - String: ' inlined into '
; YAML-NEXT: - Caller: main
; YAML-NEXT: - String: ' with cost='
; YAML-NEXT: - Cost: '-15000'
; YAML-NEXT: - String: ' (threshold='
; YAML-NEXT: - Threshold: '337'
; YAML-NEXT: - String: ')'
; YAML-NEXT: ...
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"
declare i32 @bar()
define i32 @foo() {
%a = call i32 @bar()
ret i32 %a
}
define i32 @main() {
%i = call i32 @foo()
ret i32 %i
}
define i32 @func2(i32* %out, i32* %out2, i32* %A, i32* %B, i32* %C, i32* %D, i32* %E, i32* %F) {
entry:
br label %for.body
for.body: ; preds = %for.body, %entry
%i.037 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %i.037
%0 = load i32, i32* %arrayidx, align 4
%arrayidx1 = getelementptr inbounds i32, i32* %B, i64 %i.037
%1 = load i32, i32* %arrayidx1, align 4
%add = add nsw i32 %1, %0
%arrayidx2 = getelementptr inbounds i32, i32* %C, i64 %i.037
%2 = load i32, i32* %arrayidx2, align 4
%add3 = add nsw i32 %add, %2
%arrayidx4 = getelementptr inbounds i32, i32* %E, i64 %i.037
%3 = load i32, i32* %arrayidx4, align 4
%add5 = add nsw i32 %add3, %3
%arrayidx6 = getelementptr inbounds i32, i32* %F, i64 %i.037
%4 = load i32, i32* %arrayidx6, align 4
%add7 = add nsw i32 %add5, %4
%arrayidx8 = getelementptr inbounds i32, i32* %out, i64 %i.037
store i32 %add7, i32* %arrayidx8, align 4
%5 = load i32, i32* %arrayidx, align 4
%6 = load i32, i32* %arrayidx1, align 4
%add11 = add nsw i32 %6, %5
%7 = load i32, i32* %arrayidx2, align 4
%add13 = add nsw i32 %add11, %7
%8 = load i32, i32* %arrayidx4, align 4
%add15 = add nsw i32 %add13, %8
%9 = load i32, i32* %arrayidx6, align 4
%add17 = add nsw i32 %add15, %9
%arrayidx18 = getelementptr inbounds i32, i32* %out2, i64 %i.037
store i32 %add17, i32* %arrayidx18, align 4
%inc = add i64 %i.037, 1
%exitcond = icmp eq i64 %inc, 256
br i1 %exitcond, label %for.end, label %for.body
for.end: ; preds = %for.body
ret i32 undef
}

View File

@@ -0,0 +1,17 @@
; RUN: llvm-as < %s >%t.bc
; RUN: llvm-lto -debug-pass=Arguments -exported-symbol=_f -o /dev/null %t.bc 2>&1 -disable-verify | FileCheck %s
; RUN: llvm-lto -debug-pass=Arguments -exported-symbol=_f -o /dev/null %t.bc 2>&1 | FileCheck %s -check-prefix=VERIFY
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
; -disable-verify should disable verification from the optimization pipeline.
; CHECK: Pass Arguments:
; CHECK-NOT: -verify
; VERIFY: Pass Arguments: {{.*}} -verify {{.*}} -verify
define void @f() {
entry:
ret void
}

View File

@@ -0,0 +1,4 @@
; RUN: not llvm-lto %S/Inputs/invalid.ll.bc 2>&1 | FileCheck %s
; CHECK: llvm-lto{{.*}}: error loading file '{{.*}}/Inputs/invalid.ll.bc': Unknown attribute kind (63)

View File

@@ -0,0 +1,36 @@
; RUN: opt -S -instcombine <%s | FileCheck %s
; rdar://problem/16165191
; llvm.compiler.used functions should not be renamed
target triple = "x86_64-apple-darwin11"
@llvm.compiler.used = appending global [1 x i8*] [
i8* bitcast (i32(i8*)* @puts to i8*)
], section "llvm.metadata"
@llvm.used = appending global [1 x i8*] [
i8* bitcast (i32(i32)* @uses_printf to i8*)
], section "llvm.metadata"
@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
define i32 @uses_printf(i32 %i) {
entry:
%s = getelementptr [13 x i8], [13 x i8]* @str, i64 0, i64 0
call i32 (i8*, ...) @printf(i8* %s)
ret i32 0
}
define internal i32 @printf(i8* readonly nocapture %fmt, ...) {
entry:
%ret = call i32 @bar(i8* %fmt)
ret i32 %ret
}
; CHECK: define {{.*}} @puts(
define internal i32 @puts(i8* %s) {
entry:
%ret = call i32 @bar(i8* %s)
ret i32 %ret
}
declare i32 @bar(i8*)

View File

@@ -0,0 +1,54 @@
; RUN: llvm-as < %s >%t1
; RUN: llvm-lto -o %t2 -dso-symbol=foo1 -dso-symbol=foo2 -dso-symbol=foo3 \
; RUN: -dso-symbol=v1 -dso-symbol=v2 -dso-symbol=v3 \
; RUN: -dso-symbol=v4 -dso-symbol=v5 -dso-symbol=v6 %t1 -O0
; RUN: llvm-nm %t2 | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; CHECK: W foo1
define linkonce_odr void @foo1() noinline {
ret void
}
; CHECK: t foo2
define linkonce_odr void @foo2() local_unnamed_addr noinline {
ret void
}
; CHECK: t foo3
define linkonce_odr void @foo3() unnamed_addr noinline {
ret void
}
; CHECK: V v1
@v1 = linkonce_odr constant i32 32
; CHECK: r v2
@v2 = linkonce_odr local_unnamed_addr constant i32 32
; CHECK: r v3
@v3 = linkonce_odr unnamed_addr constant i32 32
; CHECK: V v4
@v4 = linkonce_odr global i32 32
; CHECK: V v5
@v5 = linkonce_odr local_unnamed_addr global i32 32
; CHECK: d v6
@v6 = linkonce_odr unnamed_addr global i32 32
define void @use() {
call void @foo1()
call void @foo2()
call void @foo3()
%x1 = load i32, i32* @v1
%x2 = load i32, i32* @v2
%x3 = load i32, i32* @v3
%x4 = load i32, i32* @v4
%x5 = load i32, i32* @v5
%x6 = load i32, i32* @v6
ret void
}

View File

@@ -0,0 +1,17 @@
; RUN: rm -rf %t && mkdir -p %t
; RUN: llvm-as -o %t/1.bc %s
; RUN: llvm-as -o %t/2.bc %S/Inputs/list-symbols.ll
; RUN: llvm-lto -list-symbols-only %t/1.bc %t/2.bc | FileCheck %s
; REQUIRES: default_triple
; CHECK-LABEL: 1.bc:
; CHECK-DAG: foo
; CHECK-DAG: glob
; CHECK-LABEL: 2.bc:
; CHECK-DAG: glob
; CHECK-DAG: bar
@glob = global i32 0
define void @foo() {
ret void
}

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