mirror of
https://github.com/RPCSX/llvm.git
synced 2026-01-31 01:05:23 +01:00
IR: Function summary representation for type tests.
Each function summary has an attached list of type identifier GUIDs. The idea is that during the regular LTO phase we would match these GUIDs to type identifiers defined by the regular LTO module and store the resolutions in a top-level "type identifier summary" (which will be implemented separately). Differential Revision: https://reviews.llvm.org/D27967 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290280 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
30
test/Bitcode/thinlto-type-tests.ll
Normal file
30
test/Bitcode/thinlto-type-tests.ll
Normal file
@@ -0,0 +1,30 @@
|
||||
; RUN: opt -module-summary %s -o %t.o
|
||||
; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
|
||||
; RUN: llvm-lto -thinlto -o %t2 %t.o
|
||||
; RUN: llvm-bcanalyzer -dump %t2.thinlto.bc | FileCheck --check-prefix=COMBINED %s
|
||||
|
||||
; COMBINED: <TYPE_TESTS op0=-2012135647395072713/>
|
||||
; COMBINED: <TYPE_TESTS op0=6699318081062747564 op1=-2012135647395072713/>
|
||||
; COMBINED: <TYPE_TESTS op0=6699318081062747564/>
|
||||
|
||||
; CHECK: <TYPE_TESTS op0=6699318081062747564/>
|
||||
define i1 @f() {
|
||||
%p = call i1 @llvm.type.test(i8* null, metadata !"foo")
|
||||
ret i1 %p
|
||||
}
|
||||
|
||||
; CHECK: <TYPE_TESTS op0=6699318081062747564 op1=-2012135647395072713/>
|
||||
define i1 @g() {
|
||||
%p = call i1 @llvm.type.test(i8* null, metadata !"foo")
|
||||
%q = call i1 @llvm.type.test(i8* null, metadata !"bar")
|
||||
%pq = and i1 %p, %q
|
||||
ret i1 %pq
|
||||
}
|
||||
|
||||
; CHECK: <TYPE_TESTS op0=-2012135647395072713/>
|
||||
define i1 @h() {
|
||||
%p = call i1 @llvm.type.test(i8* null, metadata !"bar")
|
||||
ret i1 %p
|
||||
}
|
||||
|
||||
declare i1 @llvm.type.test(i8*, metadata) nounwind readnone
|
||||
Reference in New Issue
Block a user