diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-03-04 01:23:30 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-03-04 01:23:30 +0000 |
commit | b406baaeef73d90b28db42c26a3d96a8389810e5 (patch) | |
tree | f217ba381356664227d6efa7f991fa8df2de6852 /llvm/test/Transforms/WholeProgramDevirt | |
parent | c963f20e4c74c747bbfdd6d6666c3a69f269754b (diff) | |
download | bcm5719-llvm-b406baaeef73d90b28db42c26a3d96a8389810e5.tar.gz bcm5719-llvm-b406baaeef73d90b28db42c26a3d96a8389810e5.zip |
WholeProgramDevirt: Add any unsuccessful llvm.type.checked.load devirtualizations to the list of llvm.type.test users.
Any unsuccessful llvm.type.checked.load devirtualizations will be translated
into uses of llvm.type.test, so we need to add the resulting llvm.type.test
intrinsics to the function summaries so that the LowerTypeTests pass will
export them.
Differential Revision: https://reviews.llvm.org/D29808
llvm-svn: 296939
Diffstat (limited to 'llvm/test/Transforms/WholeProgramDevirt')
-rw-r--r-- | llvm/test/Transforms/WholeProgramDevirt/Inputs/export.yaml | 20 | ||||
-rw-r--r-- | llvm/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll | 30 |
2 files changed, 50 insertions, 0 deletions
diff --git a/llvm/test/Transforms/WholeProgramDevirt/Inputs/export.yaml b/llvm/test/Transforms/WholeProgramDevirt/Inputs/export.yaml new file mode 100644 index 00000000000..0f6f59de752 --- /dev/null +++ b/llvm/test/Transforms/WholeProgramDevirt/Inputs/export.yaml @@ -0,0 +1,20 @@ +--- +GlobalValueMap: + 42: + - 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] +... diff --git a/llvm/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll b/llvm/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll new file mode 100644 index 00000000000..607c89a6e87 --- /dev/null +++ b/llvm/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll @@ -0,0 +1,30 @@ +; 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: +; CHECK-NEXT: - 15427464259790519041 +; CHECK-NEXT: - 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"} |