Imported Upstream version 5.18.0.167

Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-20 08:25:10 +00:00
parent e19d552987
commit b084638f15
28489 changed files with 184 additions and 3866856 deletions

View File

@ -1,21 +0,0 @@
---
GlobalValueMap:
42:
- Live: true
TypeTestAssumeVCalls:
- GUID: 14276520915468743435 # typeid1
Offset: 0
TypeCheckedLoadVCalls:
- GUID: 15427464259790519041 # typeid2
Offset: 0
TypeTestAssumeConstVCalls:
- VFunc:
GUID: 3515965990081467659 # typeid3
Offset: 0
Args: [12, 24]
TypeCheckedLoadConstVCalls:
- VFunc:
GUID: 17525413373118030901 # typeid4
Offset: 0
Args: [24, 12]
...

View File

@ -1,42 +0,0 @@
---
GlobalValueMap:
42:
- Live: true
TypeTestAssumeVCalls:
- GUID: 123
Offset: 0
- GUID: 456
Offset: 4
TypeCheckedLoadVCalls:
- GUID: 789
Offset: 8
- GUID: 1234
Offset: 16
TypeTestAssumeConstVCalls:
- VFunc:
GUID: 123
Offset: 4
Args: [12, 24]
TypeCheckedLoadConstVCalls:
- VFunc:
GUID: 456
Offset: 8
Args: [24, 12]
TypeIdMap:
typeid1:
WPDRes:
0:
Kind: Indir
4:
Kind: Indir
ResByArg:
"":
Kind: UniformRetVal
Info: 12
12:
Kind: UniformRetVal
Info: 24
"12,24":
Kind: UniformRetVal
Info: 48
...

View File

@ -1,13 +0,0 @@
---
TypeIdMap:
typeid1:
WPDRes:
0:
Kind: SingleImpl
SingleImplName: singleimpl1
typeid2:
WPDRes:
8:
Kind: SingleImpl
SingleImplName: singleimpl2
...

View File

@ -1,19 +0,0 @@
---
TypeIdMap:
typeid1:
WPDRes:
0:
Kind: Indir
ResByArg:
1:
Kind: UniformRetVal
Info: 42
typeid2:
WPDRes:
8:
Kind: Indir
ResByArg:
1:
Kind: UniformRetVal
Info: 42
...

View File

@ -1,11 +0,0 @@
---
TypeIdMap:
typeid2:
WPDRes:
8:
Kind: Indir
ResByArg:
3:
Kind: UniqueRetVal
Info: 0
...

View File

@ -1,11 +0,0 @@
---
TypeIdMap:
typeid2:
WPDRes:
8:
Kind: Indir
ResByArg:
3:
Kind: UniqueRetVal
Info: 1
...

View File

@ -1,23 +0,0 @@
---
TypeIdMap:
typeid1:
WPDRes:
0:
Kind: Indir
ResByArg:
1:
Kind: VirtualConstProp
Info: 0
Byte: 42
Bit: 0
typeid2:
WPDRes:
8:
Kind: Indir
ResByArg:
3:
Kind: VirtualConstProp
Info: 0
Byte: 43
Bit: 128
...

View File

@ -1,81 +0,0 @@
; RUN: opt -S -wholeprogramdevirt %s | FileCheck %s
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
@vt1 = constant [2 x i8*] [i8* zeroinitializer, i8* bitcast (void (i8*)* @vf to i8*)], !type !0
@vt2 = constant i8* bitcast (void (i8*)* @vf to i8*), !type !1
define void @vf(i8* %this) {
ret void
}
; CHECK: define void @unaligned1
define void @unaligned1(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr i8, i8* %vtablei8, i32 1
%fptrptr_casted = bitcast i8* %fptrptr to i8**
%fptr = load i8*, i8** %fptrptr_casted
%fptr_casted = bitcast i8* %fptr to void (i8*)*
; CHECK: call void %
call void %fptr_casted(i8* %obj)
ret void
}
; CHECK: define void @unaligned2
define void @unaligned2(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid2")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr i8, i8* %vtablei8, i32 1
%fptrptr_casted = bitcast i8* %fptrptr to i8**
%fptr = load i8*, i8** %fptrptr_casted
%fptr_casted = bitcast i8* %fptr to void (i8*)*
; CHECK: call void %
call void %fptr_casted(i8* %obj)
ret void
}
; CHECK: define void @outofbounds
define void @outofbounds(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr i8, i8* %vtablei8, i32 16
%fptrptr_casted = bitcast i8* %fptrptr to i8**
%fptr = load i8*, i8** %fptrptr_casted
%fptr_casted = bitcast i8* %fptr to void (i8*)*
; CHECK: call void %
call void %fptr_casted(i8* %obj)
ret void
}
; CHECK: define void @nonfunction
define void @nonfunction(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr i8, i8* %vtablei8, i32 0
%fptrptr_casted = bitcast i8* %fptrptr to i8**
%fptr = load i8*, i8** %fptrptr_casted
%fptr_casted = bitcast i8* %fptr to void (i8*)*
; CHECK: call void %
call void %fptr_casted(i8* %obj)
ret void
}
declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
!0 = !{i32 0, !"typeid"}
!1 = !{i32 0, !"typeid2"}

View File

@ -1,77 +0,0 @@
; RUN: opt -S -wholeprogramdevirt %s | FileCheck %s
; RUN: opt -S -passes=wholeprogramdevirt %s | FileCheck %s
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
; CHECK: private constant { [8 x i8], [1 x i8*], [0 x i8] } { [8 x i8] c"\00\00\00\00\00\00\00\01", [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf1 to i8*)], [0 x i8] zeroinitializer }, !type [[T8:![0-9]+]]
; CHECK: private constant { [8 x i8], [1 x i8*], [0 x i8] } { [8 x i8] c"\00\00\00\00\00\00\00\02", [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf2 to i8*)], [0 x i8] zeroinitializer }, !type [[T8]]
; CHECK: private constant { [8 x i8], [1 x i8*], [0 x i8] } { [8 x i8] c"\00\00\00\00\00\00\00\01", [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf4 to i8*)], [0 x i8] zeroinitializer }, !type [[T8]]
; CHECK: private constant { [8 x i8], [1 x i8*], [0 x i8] } { [8 x i8] c"\00\00\00\00\00\00\00\02", [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf8 to i8*)], [0 x i8] zeroinitializer }, !type [[T8]]
@vt1 = constant [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf1 to i8*)], !type !0
@vt2 = constant [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf2 to i8*)], !type !0
@vt4 = constant [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf4 to i8*)], !type !0
@vt8 = constant [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf8 to i8*)], !type !0
define i1 @vf1(i8* %this, i32 %arg) readnone {
%and = and i32 %arg, 1
%cmp = icmp ne i32 %and, 0
ret i1 %cmp
}
define i1 @vf2(i8* %this, i32 %arg) readnone {
%and = and i32 %arg, 2
%cmp = icmp ne i32 %and, 0
ret i1 %cmp
}
define i1 @vf4(i8* %this, i32 %arg) readnone {
%and = and i32 %arg, 4
%cmp = icmp ne i32 %and, 0
ret i1 %cmp
}
define i1 @vf8(i8* %this, i32 %arg) readnone {
%and = and i32 %arg, 8
%cmp = icmp ne i32 %and, 0
ret i1 %cmp
}
; CHECK: define i1 @call1
define i1 @call1(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [1 x i8*], [1 x i8*]* %vtable, i32 0, i32 0
%fptr = load i8*, i8** %fptrptr
%fptr_casted = bitcast i8* %fptr to i1 (i8*, i32)*
; CHECK: getelementptr {{.*}} -1
; CHECK: and {{.*}}, 1
%result = call i1 %fptr_casted(i8* %obj, i32 5)
ret i1 %result
}
; CHECK: define i1 @call2
define i1 @call2(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [1 x i8*], [1 x i8*]* %vtable, i32 0, i32 0
%fptr = load i8*, i8** %fptrptr
%fptr_casted = bitcast i8* %fptr to i1 (i8*, i32)*
; CHECK: getelementptr {{.*}} -1
; CHECK: and {{.*}}, 2
%result = call i1 %fptr_casted(i8* %obj, i32 10)
ret i1 %result
}
declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
; CHECK: [[T8]] = !{i32 8, !"typeid"}
!0 = !{i32 0, !"typeid"}

View File

@ -1,42 +0,0 @@
; RUN: opt -S -wholeprogramdevirt -pass-remarks=wholeprogramdevirt %s 2>&1 | FileCheck %s
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
; CHECK: remark: <unknown>:0:0: single-impl: devirtualized a call to vf
; CHECK: remark: <unknown>:0:0: devirtualized vf
; CHECK-NOT: devirtualized
@vt1 = constant [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)], !type !0
@vt2 = constant [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)], !type !0
define void @vf(i8* %this) {
ret void
}
; CHECK: define void @call
define void @call(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%pair = call {i8*, i1} @llvm.type.checked.load(i8* %vtablei8, i32 0, metadata !"typeid")
%fptr = extractvalue {i8*, i1} %pair, 0
%p = extractvalue {i8*, i1} %pair, 1
; CHECK: br i1 true,
br i1 %p, label %cont, label %trap
cont:
%fptr_casted = bitcast i8* %fptr to void (i8*)*
; CHECK: call void @vf(
call void %fptr_casted(i8* %obj)
ret void
trap:
call void @llvm.trap()
unreachable
}
declare {i8*, i1} @llvm.type.checked.load(i8*, i32, metadata)
declare void @llvm.trap()
!0 = !{i32 0, !"typeid"}

View File

@ -1,47 +0,0 @@
; RUN: opt -S -wholeprogramdevirt -pass-remarks=wholeprogramdevirt %s 2>&1 | FileCheck %s
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
; CHECK: remark: devirt-single.cc:30:32: single-impl: devirtualized a call to vf
; CHECK: remark: devirt-single.cc:13:0: devirtualized vf
; CHECK-NOT: devirtualized
@vt1 = constant [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)], !type !8
@vt2 = constant [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)], !type !8
define void @vf(i8* %this) #0 !dbg !7 {
ret void
}
; CHECK: define void @call
define void @call(i8* %obj) #1 !dbg !5 {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [1 x i8*], [1 x i8*]* %vtable, i32 0, i32 0
%fptr = load i8*, i8** %fptrptr
%fptr_casted = bitcast i8* %fptr to void (i8*)*
; CHECK: call void @vf(
call void %fptr_casted(i8* %obj), !dbg !6
ret void
}
declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!2, !3}
!llvm.ident = !{!4}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 4.0.0 (trunk 278098)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
!1 = !DIFile(filename: "devirt-single.cc", directory: ".")
!2 = !{i32 2, !"Dwarf Version", i32 4}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !{!"clang version 4.0.0 (trunk 278098)"}
!5 = distinct !DISubprogram(name: "call", linkageName: "_Z4callPv", scope: !1, file: !1, line: 29, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!6 = !DILocation(line: 30, column: 32, scope: !5)
!7 = distinct !DISubprogram(name: "vf", linkageName: "_ZN3vt12vfEv", scope: !1, file: !1, line: 13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0)
!8 = !{i32 0, !"typeid"}

View File

@ -1,63 +0,0 @@
; RUN: opt -S -wholeprogramdevirt %s | FileCheck %s
; Test that we correctly expand the llvm.type.checked.load intrinsic in cases
; where we cannot devirtualize.
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
@vt1 = constant [1 x i8*] [i8* bitcast (void (i8*)* @vf1 to i8*)], !type !0
@vt2 = constant [1 x i8*] [i8* bitcast (void (i8*)* @vf2 to i8*)], !type !0
define void @vf1(i8* %this) {
ret void
}
define void @vf2(i8* %this) {
ret void
}
; CHECK: define void @call
define void @call(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%pair = call {i8*, i1} @llvm.type.checked.load(i8* %vtablei8, i32 0, metadata !"typeid")
%p = extractvalue {i8*, i1} %pair, 1
; CHECK: [[TT:%[^ ]*]] = call i1 @llvm.type.test(i8* [[VT:%[^,]*]], metadata !"typeid")
; CHECK: br i1 [[TT]],
br i1 %p, label %cont, label %trap
cont:
; CHECK: [[GEP:%[^ ]*]] = getelementptr i8, i8* [[VT]], i32 0
; CHECK: [[BC:%[^ ]*]] = bitcast i8* [[GEP]] to i8**
; CHECK: [[LOAD:%[^ ]*]] = load i8*, i8** [[BC]]
; CHECK: [[FPC:%[^ ]*]] = bitcast i8* [[LOAD]] to void (i8*)*
; CHECK: call void [[FPC]]
%fptr = extractvalue {i8*, i1} %pair, 0
%fptr_casted = bitcast i8* %fptr to void (i8*)*
call void %fptr_casted(i8* %obj)
ret void
trap:
call void @llvm.trap()
unreachable
}
; CHECK: define { i8*, i1 } @ret
define {i8*, i1} @ret(i8* %vtablei8) {
; CHECK: [[GEP2:%[^ ]*]] = getelementptr i8, i8* [[VT2:%[^,]*]], i32 1
; CHECK: [[BC2:%[^ ]*]] = bitcast i8* [[GEP2]] to i8**
; CHECK: [[LOAD2:%[^ ]*]] = load i8*, i8** [[BC2]]
; CHECK: [[TT2:%[^ ]*]] = call i1 @llvm.type.test(i8* [[VT2]], metadata !"typeid")
; CHECK: [[I1:%[^ ]*]] = insertvalue { i8*, i1 } undef, i8* [[LOAD2]], 0
; CHECK: [[I2:%[^ ]*]] = insertvalue { i8*, i1 } %5, i1 [[TT2]], 1
%pair = call {i8*, i1} @llvm.type.checked.load(i8* %vtablei8, i32 1, metadata !"typeid")
; CHECK: ret { i8*, i1 } [[I2]]
ret {i8*, i1} %pair
}
declare {i8*, i1} @llvm.type.checked.load(i8*, i32, metadata)
declare void @llvm.trap()
!0 = !{i32 0, !"typeid"}

View File

@ -1,8 +0,0 @@
; RUN: opt -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-write-summary=%t -o /dev/null %s
; RUN: FileCheck %s < %t
; CHECK: ---
; CHECK-NEXT: GlobalValueMap:
; CHECK-NEXT: TypeIdMap:
; CHECK-NEXT: WithGlobalValueDeadStripping: false
; CHECK-NEXT: ...

View File

@ -1,101 +0,0 @@
; RUN: opt -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck %s
; RUN: FileCheck --check-prefix=SUMMARY %s < %t
; SUMMARY: TypeIdMap:
; SUMMARY-NEXT: typeid1:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: SingleImpl
; SUMMARY-NEXT: SingleImplName: vf1
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: typeid2:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: SingleImpl
; SUMMARY-NEXT: SingleImplName: vf2
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: typeid3:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: SingleImpl
; SUMMARY-NEXT: SingleImplName: 'vf3$merged'
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: typeid4:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: SingleImpl
; SUMMARY-NEXT: SingleImplName: 'vf4$merged'
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: WithGlobalValueDeadStripping: false
; SUMMARY-NEXT: ...
; CHECK: $"vf4$merged" = comdat largest
$vf4 = comdat largest
; CHECK: @vt1 = constant void (i8*)* @vf1
@vt1 = constant void (i8*)* @vf1, !type !0
; CHECK: @vt2 = constant void (i8*)* @vf2
@vt2 = constant void (i8*)* @vf2, !type !1
@vt3 = constant void (i8*)* @vf3, !type !2
; CHECK: @vt4 = constant void (i8*)* @"vf4$merged", comdat($"vf4$merged")
@vt4 = constant void (i8*)* @vf4, comdat($vf4), !type !3
@vt5 = constant void (i8*)* @vf5, !type !4
; CHECK: declare void @vf1(i8*)
declare void @vf1(i8*)
; CHECK: define void @vf2(i8*)
define void @vf2(i8*) {
ret void
}
; CHECK: define hidden void @"vf3$merged"(i8*) {
define internal void @vf3(i8*) {
ret void
}
; CHECK: define hidden void @"vf4$merged"(i8*) comdat {
define internal void @vf4(i8*) comdat {
ret void
}
declare void @vf5(i8*)
!0 = !{i32 0, !"typeid1"}
!1 = !{i32 0, !"typeid2"}
!2 = !{i32 0, !"typeid3"}
!3 = !{i32 0, !"typeid4"}
!4 = !{i32 0, !5}
!5 = distinct !{}

View File

@ -1,41 +0,0 @@
; RUN: opt -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck %s
; RUN: FileCheck --check-prefix=SUMMARY %s < %t
; SUMMARY-NOT: TypeTests:
; SUMMARY: TypeIdMap:
; SUMMARY-NEXT: typeid4:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: Indir
; SUMMARY-NEXT: SingleImplName: ''
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: 24,12:
; SUMMARY-NEXT: Kind: UniformRetVal
; SUMMARY-NEXT: Info: 36
; SUMMARY-NEXT: Byte: 0
; SUMMARY-NEXT: Bit: 0
; CHECK: @vt4a = constant i32 (i8*, i32, i32)* @vf4a
@vt4a = constant i32 (i8*, i32, i32)* @vf4a, !type !0
; CHECK: @vt4b = constant i32 (i8*, i32, i32)* @vf4b
@vt4b = constant i32 (i8*, i32, i32)* @vf4b, !type !0
define i32 @vf4a(i8*, i32 %x, i32 %y) {
%z = add i32 %x, %y
ret i32 %z
}
define i32 @vf4b(i8*, i32 %x, i32 %y) {
ret i32 36
}
!0 = !{i32 0, !"typeid4"}

View File

@ -1,90 +0,0 @@
; RUN: opt -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck %s
; RUN: FileCheck --check-prefix=SUMMARY %s < %t
; SUMMARY-NOT: TypeTests:
; SUMMARY: TypeIdMap:
; SUMMARY-NEXT: typeid3:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: Indir
; SUMMARY-NEXT: SingleImplName: ''
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: 12,24:
; SUMMARY-NEXT: Kind: UniqueRetVal
; SUMMARY-NEXT: Info: 0
; SUMMARY-NEXT: Byte: 0
; SUMMARY-NEXT: Bit: 0
; SUMMARY-NEXT: typeid4:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: Indir
; SUMMARY-NEXT: SingleImplName: ''
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: 24,12:
; SUMMARY-NEXT: Kind: UniqueRetVal
; SUMMARY-NEXT: Info: 1
; SUMMARY-NEXT: Byte: 0
; SUMMARY-NEXT: Bit: 0
; CHECK: @vt3a = constant i1 (i8*, i32, i32)* @vf3a
@vt3a = constant i1 (i8*, i32, i32)* @vf3a, !type !0
; CHECK: @vt3b = constant i1 (i8*, i32, i32)* @vf3b
@vt3b = constant i1 (i8*, i32, i32)* @vf3b, !type !0
; CHECK: @vt3c = constant i1 (i8*, i32, i32)* @vf3c
@vt3c = constant i1 (i8*, i32, i32)* @vf3c, !type !0
; CHECK: @vt4a = constant i1 (i8*, i32, i32)* @vf4a
@vt4a = constant i1 (i8*, i32, i32)* @vf4a, !type !1
; CHECK: @vt4b = constant i1 (i8*, i32, i32)* @vf4b
@vt4b = constant i1 (i8*, i32, i32)* @vf4b, !type !1
; CHECK: @vt4c = constant i1 (i8*, i32, i32)* @vf4c
@vt4c = constant i1 (i8*, i32, i32)* @vf4c, !type !1
; CHECK: @__typeid_typeid3_0_12_24_unique_member = hidden alias i8, bitcast (i1 (i8*, i32, i32)** @vt3b to i8*)
; CHECK: @__typeid_typeid4_0_24_12_unique_member = hidden alias i8, bitcast (i1 (i8*, i32, i32)** @vt4b to i8*)
define i1 @vf3a(i8*, i32, i32) {
ret i1 true
}
define i1 @vf3b(i8*, i32, i32) {
ret i1 false
}
define i1 @vf3c(i8*, i32, i32) {
ret i1 true
}
define i1 @vf4a(i8*, i32, i32) {
ret i1 false
}
define i1 @vf4b(i8*, i32, i32) {
ret i1 true
}
define i1 @vf4c(i8*, i32, i32) {
ret i1 false
}
!0 = !{i32 0, !"typeid3"}
!1 = !{i32 0, !"typeid4"}

View File

@ -1,28 +0,0 @@
; RUN: opt -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -o /dev/null %s
; RUN: FileCheck %s < %t
; CHECK: TypeTests: [ 15427464259790519041, 17525413373118030901 ]
; CHECK-NEXT: TypeTestAssumeVCalls:
@vt1a = constant void (i8*)* @vf1a, !type !0
@vt1b = constant void (i8*)* @vf1b, !type !0
@vt2a = constant void (i8*)* @vf2a, !type !1
@vt2b = constant void (i8*)* @vf2b, !type !1
@vt3a = constant void (i8*)* @vf3a, !type !2
@vt3b = constant void (i8*)* @vf3b, !type !2
@vt4a = constant void (i8*)* @vf4a, !type !3
@vt4b = constant void (i8*)* @vf4b, !type !3
declare void @vf1a(i8*)
declare void @vf1b(i8*)
declare void @vf2a(i8*)
declare void @vf2b(i8*)
declare void @vf3a(i8*)
declare void @vf3b(i8*)
declare void @vf4a(i8*)
declare void @vf4b(i8*)
!0 = !{i32 0, !"typeid1"}
!1 = !{i32 0, !"typeid2"}
!2 = !{i32 0, !"typeid3"}
!3 = !{i32 0, !"typeid4"}

View File

@ -1,102 +0,0 @@
; RUN: opt -mtriple=x86_64-unknown-linux-gnu -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck --check-prefixes=CHECK,X86 %s
; RUN: FileCheck --check-prefixes=SUMMARY,SUMMARY-X86 %s < %t
; RUN: opt -mtriple=armv7-unknown-linux-gnu -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck --check-prefixes=CHECK,ARM %s
; RUN: FileCheck --check-prefixes=SUMMARY,SUMMARY-ARM %s < %t
target datalayout = "e-p:64:64"
; SUMMARY: TypeIdMap:
; SUMMARY-NEXT: typeid3:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: Indir
; SUMMARY-NEXT: SingleImplName: ''
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: 12,24:
; SUMMARY-NEXT: Kind: VirtualConstProp
; SUMMARY-NEXT: Info: 0
; SUMMARY-X86-NEXT: Byte: 0
; SUMMARY-X86-NEXT: Bit: 0
; SUMMARY-ARM-NEXT: Byte: 4294967295
; SUMMARY-ARM-NEXT: Bit: 1
; SUMMARY-NEXT: typeid4:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: Indir
; SUMMARY-NEXT: SingleImplName: ''
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: 24,12:
; SUMMARY-NEXT: Kind: VirtualConstProp
; SUMMARY-NEXT: Info: 0
; SUMMARY-X86-NEXT: Byte: 0
; SUMMARY-X86-NEXT: Bit: 0
; SUMMARY-ARM-NEXT: Byte: 4294967292
; SUMMARY-ARM-NEXT: Bit: 1
; CHECK: [[CVT3A:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] zeroinitializer, i1 (i8*, i32, i32)* @vf0i1, [0 x i8] zeroinitializer }, !type !0
@vt3a = constant i1 (i8*, i32, i32)* @vf0i1, !type !0
; CHECK: [[CVT3B:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\00\00\00\01", i1 (i8*, i32, i32)* @vf1i1, [0 x i8] zeroinitializer }, !type !0
@vt3b = constant i1 (i8*, i32, i32)* @vf1i1, !type !0
; CHECK: [[CVT3C:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] zeroinitializer, i1 (i8*, i32, i32)* @vf0i1, [0 x i8] zeroinitializer }, !type !0
@vt3c = constant i1 (i8*, i32, i32)* @vf0i1, !type !0
; CHECK: [[CVT3D:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\00\00\00\01", i1 (i8*, i32, i32)* @vf1i1, [0 x i8] zeroinitializer }, !type !0
@vt3d = constant i1 (i8*, i32, i32)* @vf1i1, !type !0
; CHECK: [[CVT4A:.*]] = private constant { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\01\00\00\00", i32 (i8*, i32, i32)* @vf1i32, [0 x i8] zeroinitializer }, !type !1
@vt4a = constant i32 (i8*, i32, i32)* @vf1i32, !type !1
; CHECK: [[CVT4B:.*]] = private constant { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\02\00\00\00", i32 (i8*, i32, i32)* @vf2i32, [0 x i8] zeroinitializer }, !type !1
@vt4b = constant i32 (i8*, i32, i32)* @vf2i32, !type !1
; X86: @__typeid_typeid3_0_12_24_byte = hidden alias i8, inttoptr (i32 -1 to i8*)
; X86: @__typeid_typeid3_0_12_24_bit = hidden alias i8, inttoptr (i32 1 to i8*)
; X86: @__typeid_typeid4_0_24_12_byte = hidden alias i8, inttoptr (i32 -4 to i8*)
; X86: @__typeid_typeid4_0_24_12_bit = hidden alias i8, inttoptr (i32 1 to i8*)
; ARM-NOT: alias {{.*}} inttoptr
; CHECK: @vt3a = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3A]], i32 0, i32 1)
; CHECK: @vt3b = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3B]], i32 0, i32 1)
; CHECK: @vt3c = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3C]], i32 0, i32 1)
; CHECK: @vt3d = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3D]], i32 0, i32 1)
; CHECK: @vt4a = alias i32 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] }* [[CVT4A]], i32 0, i32 1)
; CHECK: @vt4b = alias i32 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] }* [[CVT4B]], i32 0, i32 1)
define i1 @vf0i1(i8* %this, i32, i32) readnone {
ret i1 0
}
define i1 @vf1i1(i8* %this, i32, i32) readnone {
ret i1 1
}
define i32 @vf1i32(i8* %this, i32, i32) readnone {
ret i32 1
}
define i32 @vf2i32(i8* %this, i32, i32) readnone {
ret i32 2
}
; CHECK: !0 = !{i32 8, !"typeid3"}
; CHECK: !1 = !{i32 8, !"typeid4"}
!0 = !{i32 0, !"typeid3"}
!1 = !{i32 0, !"typeid4"}

View File

@ -1,108 +0,0 @@
; Test that we correctly import an indir resolution for type identifier "typeid1".
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-indir.yaml -wholeprogramdevirt-write-summary=%t < %s | FileCheck %s
; RUN: FileCheck --check-prefix=SUMMARY %s < %t
; SUMMARY: GlobalValueMap:
; SUMMARY-NEXT: 42:
; SUMMARY-NEXT: - Linkage: 0
; SUMMARY-NEXT: NotEligibleToImport: false
; SUMMARY-NEXT: Live: true
; SUMMARY-NEXT: Local: false
; SUMMARY-NEXT: TypeTestAssumeVCalls:
; SUMMARY-NEXT: - GUID: 123
; SUMMARY-NEXT: Offset: 0
; SUMMARY-NEXT: - GUID: 456
; SUMMARY-NEXT: Offset: 4
; SUMMARY-NEXT: TypeCheckedLoadVCalls:
; SUMMARY-NEXT: - GUID: 789
; SUMMARY-NEXT: Offset: 8
; SUMMARY-NEXT: - GUID: 1234
; SUMMARY-NEXT: Offset: 16
; SUMMARY-NEXT: TypeTestAssumeConstVCalls:
; SUMMARY-NEXT: - VFunc:
; SUMMARY-NEXT: GUID: 123
; SUMMARY-NEXT: Offset: 4
; SUMMARY-NEXT: Args: [ 12, 24 ]
; SUMMARY-NEXT: TypeCheckedLoadConstVCalls:
; SUMMARY-NEXT: - VFunc:
; SUMMARY-NEXT: GUID: 456
; SUMMARY-NEXT: Offset: 8
; SUMMARY-NEXT: Args: [ 24, 12 ]
; SUMMARY-NEXT: TypeIdMap:
; SUMMARY-NEXT: typeid1:
; SUMMARY-NEXT: TTRes:
; SUMMARY-NEXT: Kind: Unsat
; SUMMARY-NEXT: SizeM1BitWidth: 0
; SUMMARY-NEXT: AlignLog2: 0
; SUMMARY-NEXT: SizeM1: 0
; SUMMARY-NEXT: BitMask: 0
; SUMMARY-NEXT: InlineBits: 0
; SUMMARY-NEXT: WPDRes:
; SUMMARY-NEXT: 0:
; SUMMARY-NEXT: Kind: Indir
; SUMMARY-NEXT: SingleImplName: ''
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: 4:
; SUMMARY-NEXT: Kind: Indir
; SUMMARY-NEXT: SingleImplName: ''
; SUMMARY-NEXT: ResByArg:
; SUMMARY-NEXT: :
; SUMMARY-NEXT: Kind: UniformRetVal
; SUMMARY-NEXT: Info: 12
; SUMMARY-NEXT: Byte: 0
; SUMMARY-NEXT: Bit: 0
; SUMMARY-NEXT: 12:
; SUMMARY-NEXT: Kind: UniformRetVal
; SUMMARY-NEXT: Info: 24
; SUMMARY-NEXT: Byte: 0
; SUMMARY-NEXT: Bit: 0
; SUMMARY-NEXT: 12,24:
; SUMMARY-NEXT: Kind: UniformRetVal
; SUMMARY-NEXT: Info: 48
; SUMMARY-NEXT: Byte: 0
; SUMMARY-NEXT: Bit: 0
target datalayout = "e-p:32:32"
declare void @llvm.assume(i1)
declare void @llvm.trap()
declare {i8*, i1} @llvm.type.checked.load(i8*, i32, metadata)
declare i1 @llvm.type.test(i8*, metadata)
; CHECK: define i1 @f1
define i1 @f1(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid1")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [1 x i8*], [1 x i8*]* %vtable, i32 0, i32 0
%fptr = load i8*, i8** %fptrptr
%fptr_casted = bitcast i8* %fptr to i1 (i8*, i32)*
; CHECK: call i1 %
%result = call i1 %fptr_casted(i8* %obj, i32 5)
ret i1 %result
}
; CHECK: define i1 @f2
define i1 @f2(i8* %obj) {
%vtableptr = bitcast i8* %obj to [1 x i8*]**
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
%pair = call {i8*, i1} @llvm.type.checked.load(i8* %vtablei8, i32 4, metadata !"typeid1")
%fptr = extractvalue {i8*, i1} %pair, 0
%p = extractvalue {i8*, i1} %pair, 1
; CHECK: [[P:%.*]] = call i1 @llvm.type.test
; CHECK: br i1 [[P]]
br i1 %p, label %cont, label %trap
cont:
%fptr_casted = bitcast i8* %fptr to i1 (i8*, i32)*
; CHECK: call i1 %
%result = call i1 %fptr_casted(i8* %obj, i32 undef)
ret i1 %result
trap:
call void @llvm.trap()
unreachable
}

View File

@ -1,37 +0,0 @@
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-vcp.yaml < %s | FileCheck %s
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
define i32 @call1(i1 %a, i8* %obj) {
%vtableptr = bitcast i8* %obj to [3 x i8*]**
%vtable = load [3 x i8*]*, [3 x i8*]** %vtableptr
br i1 %a, label %bb1, label %bb2
bb1:
; CHECK: {{.*}} = bitcast {{.*}} to i8*
%vtablei8_1 = bitcast [3 x i8*]* %vtable to i8*
%p1 = call i1 @llvm.type.test(i8* %vtablei8_1, metadata !"typeid1")
call void @llvm.assume(i1 %p1)
%fptrptr1 = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 0
%fptr1 = load i8*, i8** %fptrptr1
%fptr1_casted = bitcast i8* %fptr1 to i32 (i8*, i32)*
; CHECK: {{.*}} = bitcast {{.*}} to i8*
%result1 = call i32 %fptr1_casted(i8* %obj, i32 1)
br label %bb2
; CHECK: :
bb2:
%vtablei8_2 = bitcast [3 x i8*]* %vtable to i8*
%p = call i1 @llvm.type.test(i8* %vtablei8_2, metadata !"typeid1")
call void @llvm.assume(i1 %p)
%fptrptr2 = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 0
%fptr2 = load i8*, i8** %fptrptr2
%fptr2_casted = bitcast i8* %fptr2 to i32 (i8*, i32)*
; CHECK: {{.*}} = bitcast {{.*}} to i8*
%result2 = call i32 %fptr2_casted(i8* %obj, i32 1)
ret i32 %result2
}
declare void @llvm.assume(i1)
declare i1 @llvm.type.test(i8*, metadata)

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