summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/WholeProgramDevirt
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-06-24 21:21:32 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-06-24 21:21:32 +0000
commit7efd7506078fb48d0b901d33da38ea538cf2fa6a (patch)
tree44f73d391f04c2c0a9bafe9a1c962520267baeb6 /llvm/test/Transforms/WholeProgramDevirt
parentc7509de7cc2674e3c60d4fbc5d0700282db10574 (diff)
downloadbcm5719-llvm-7efd7506078fb48d0b901d33da38ea538cf2fa6a.tar.gz
bcm5719-llvm-7efd7506078fb48d0b901d33da38ea538cf2fa6a.zip
IR: New representation for CFI and virtual call optimization pass metadata.
The bitset metadata currently used in LLVM has a few problems: 1. It has the wrong name. The name "bitset" refers to an implementation detail of one use of the metadata (i.e. its original use case, CFI). This makes it harder to understand, as the name makes no sense in the context of virtual call optimization. 2. It is represented using a global named metadata node, rather than being directly associated with a global. This makes it harder to manipulate the metadata when rebuilding global variables, summarise it as part of ThinLTO and drop unused metadata when associated globals are dropped. For this reason, CFI does not currently work correctly when both CFI and vcall opt are enabled, as vcall opt needs to rebuild vtable globals, and fails to associate metadata with the rebuilt globals. As I understand it, the same problem could also affect ASan, which rebuilds globals with a red zone. This patch solves both of those problems in the following way: 1. Rename the metadata to "type metadata". This new name reflects how the metadata is currently being used (i.e. to represent type information for CFI and vtable opt). The new name is reflected in the name for the associated intrinsic (llvm.type.test) and pass (LowerTypeTests). 2. Attach metadata directly to the globals that it pertains to, rather than using the "llvm.bitsets" global metadata node as we are doing now. This is done using the newly introduced capability to attach metadata to global variables (r271348 and r271358). See also: http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html Differential Revision: http://reviews.llvm.org/D21053 llvm-svn: 273729
Diffstat (limited to 'llvm/test/Transforms/WholeProgramDevirt')
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll13
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/constant-arg.ll20
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl.ll12
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/non-array-vtable.ll9
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/non-constant-vtable.ll9
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll12
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/uniform-retval.ll12
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/unique-retval.ll23
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll12
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/vcp-no-this.ll12
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll12
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll12
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll16
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll12
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll25
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll23
16 files changed, 98 insertions, 136 deletions
diff --git a/llvm/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll b/llvm/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll
index 9402076adf0..97445efb101 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/bad-read-from-vtable.ll
@@ -3,7 +3,7 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt = global [2 x i8*] [i8* zeroinitializer, i8* bitcast (void (i8*)* @vf to i8*)]
+@vt = global [2 x i8*] [i8* zeroinitializer, i8* bitcast (void (i8*)* @vf to i8*)], !type !0
define void @vf(i8* %this) {
ret void
@@ -14,7 +14,7 @@ define void @unaligned(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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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**
@@ -30,7 +30,7 @@ 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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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**
@@ -46,7 +46,7 @@ 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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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**
@@ -57,8 +57,7 @@ define void @nonfunction(i8* %obj) {
ret void
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [2 x i8*]* @vt, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/constant-arg.ll b/llvm/test/Transforms/WholeProgramDevirt/constant-arg.ll
index e26759faedc..08047033aef 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/constant-arg.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/constant-arg.ll
@@ -9,10 +9,10 @@ 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)* @vf4 to i8*)], [0 x i8] zeroinitializer }
; 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 }
-@vt1 = constant [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf1 to i8*)]
-@vt2 = constant [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf2 to i8*)]
-@vt4 = constant [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf4 to i8*)]
-@vt8 = constant [1 x i8*] [i8* bitcast (i1 (i8*, i32)* @vf8 to i8*)]
+@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
@@ -43,7 +43,7 @@ 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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -59,7 +59,7 @@ 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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -70,11 +70,7 @@ define i1 @call2(i8* %obj) {
ret i1 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!2 = !{!"bitset", [1 x i8*]* @vt4, i32 0}
-!3 = !{!"bitset", [1 x i8*]* @vt8, i32 0}
-!llvm.bitsets = !{!0, !1, !2, !3}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl.ll b/llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl.ll
index 85041551f67..7d665f534a5 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/devirt-single-impl.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = constant [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)]
-@vt2 = constant [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)]
+@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
@@ -15,7 +15,7 @@ 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*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -25,9 +25,7 @@ define void @call(i8* %obj) {
ret void
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0, !1}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/non-array-vtable.ll b/llvm/test/Transforms/WholeProgramDevirt/non-array-vtable.ll
index d6befd591e9..e9c2db79fcb 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/non-array-vtable.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/non-array-vtable.ll
@@ -3,7 +3,7 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt = constant i8* bitcast (void (i8*)* @vf to i8*)
+@vt = constant i8* bitcast (void (i8*)* @vf to i8*), !type !0
define void @vf(i8* %this) {
ret void
@@ -14,7 +14,7 @@ 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*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -24,8 +24,7 @@ define void @call(i8* %obj) {
ret void
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", i8** @vt, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/non-constant-vtable.ll b/llvm/test/Transforms/WholeProgramDevirt/non-constant-vtable.ll
index 394f5e6c37a..f66409093c4 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/non-constant-vtable.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/non-constant-vtable.ll
@@ -3,7 +3,7 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt = global [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)]
+@vt = global [1 x i8*] [i8* bitcast (void (i8*)* @vf to i8*)], !type !0
define void @vf(i8* %this) {
ret void
@@ -14,7 +14,7 @@ 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*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -24,8 +24,7 @@ define void @call(i8* %obj) {
ret void
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll b/llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll
index d34a529daa4..8fea9bc7b24 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)]
-@vt2 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)]
+@vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)], !type !0
define i32 @vf1(i8* %this) readnone {
ret i32 123
@@ -19,7 +19,7 @@ define i32 @call(i8* %obj) personality i8* undef {
%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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -37,9 +37,7 @@ ret:
ret i32 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0, !1}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/uniform-retval.ll b/llvm/test/Transforms/WholeProgramDevirt/uniform-retval.ll
index f6433c32aba..ef3a7e49b52 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/uniform-retval.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/uniform-retval.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)]
-@vt2 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)]
+@vt1 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)], !type !0
define i32 @vf1(i8* %this) readnone {
ret i32 123
@@ -19,7 +19,7 @@ define i32 @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*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -30,9 +30,7 @@ define i32 @call(i8* %obj) {
ret i32 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0, !1}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/unique-retval.ll b/llvm/test/Transforms/WholeProgramDevirt/unique-retval.ll
index 41aa3e59e8a..50b938c43e4 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/unique-retval.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/unique-retval.ll
@@ -3,10 +3,10 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = constant [1 x i8*] [i8* bitcast (i1 (i8*)* @vf0 to i8*)]
-@vt2 = constant [1 x i8*] [i8* bitcast (i1 (i8*)* @vf0 to i8*)]
-@vt3 = constant [1 x i8*] [i8* bitcast (i1 (i8*)* @vf1 to i8*)]
-@vt4 = constant [1 x i8*] [i8* bitcast (i1 (i8*)* @vf1 to i8*)]
+@vt1 = constant [1 x i8*] [i8* bitcast (i1 (i8*)* @vf0 to i8*)], !type !0
+@vt2 = constant [1 x i8*] [i8* bitcast (i1 (i8*)* @vf0 to i8*)], !type !0, !type !1
+@vt3 = constant [1 x i8*] [i8* bitcast (i1 (i8*)* @vf1 to i8*)], !type !0, !type !1
+@vt4 = constant [1 x i8*] [i8* bitcast (i1 (i8*)* @vf1 to i8*)], !type !1
define i1 @vf0(i8* %this) readnone {
ret i1 0
@@ -22,7 +22,7 @@ define i1 @call1(i8* %obj) {
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
; CHECK: [[VT1:%[^ ]*]] = bitcast [1 x i8*]* {{.*}} to i8*
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset1")
+ %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
@@ -39,7 +39,7 @@ define i1 @call2(i8* %obj) {
%vtable = load [1 x i8*]*, [1 x i8*]** %vtableptr
; CHECK: [[VT2:%[^ ]*]] = bitcast [1 x i8*]* {{.*}} to i8*
%vtablei8 = bitcast [1 x i8*]* %vtable to i8*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset2")
+ %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid2")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [1 x i8*], [1 x i8*]* %vtable, i32 0, i32 0
%fptr = load i8*, i8** %fptrptr
@@ -49,13 +49,8 @@ define i1 @call2(i8* %obj) {
ret i1 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset1", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset1", [1 x i8*]* @vt2, i32 0}
-!2 = !{!"bitset1", [1 x i8*]* @vt3, i32 0}
-!3 = !{!"bitset2", [1 x i8*]* @vt2, i32 0}
-!4 = !{!"bitset2", [1 x i8*]* @vt3, i32 0}
-!5 = !{!"bitset2", [1 x i8*]* @vt4, i32 0}
-!llvm.bitsets = !{!0, !1, !2, !3, !4, !5}
+!0 = !{i32 0, !"typeid1"}
+!1 = !{i32 0, !"typeid2"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll b/llvm/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll
index f963d18e164..b5d51f2d463 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/vcp-accesses-memory.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)]
-@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)]
+@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
define i32 @vf1(i8* %this, i32 %arg) {
ret i32 %arg
@@ -19,7 +19,7 @@ define i32 @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*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -29,9 +29,7 @@ define i32 @call(i8* %obj) {
ret i32 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/vcp-no-this.ll b/llvm/test/Transforms/WholeProgramDevirt/vcp-no-this.ll
index 28d39e169e8..c564665471c 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/vcp-no-this.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/vcp-no-this.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = global [1 x i8*] [i8* bitcast (i32 ()* @vf1 to i8*)]
-@vt2 = global [1 x i8*] [i8* bitcast (i32 ()* @vf2 to i8*)]
+@vt1 = global [1 x i8*] [i8* bitcast (i32 ()* @vf1 to i8*)], !type !0
+@vt2 = global [1 x i8*] [i8* bitcast (i32 ()* @vf2 to i8*)], !type !0
define i32 @vf1() readnone {
ret i32 1
@@ -19,7 +19,7 @@ define i32 @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*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -29,9 +29,7 @@ define i32 @call(i8* %obj) {
ret i32 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll b/llvm/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll
index c056832de6d..197c923c3a1 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/vcp-non-constant-arg.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)]
-@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)]
+@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
define i32 @vf1(i8* %this, i32 %arg) readnone {
ret i32 %arg
@@ -19,7 +19,7 @@ define void @call(i8* %obj, i32 %arg) {
%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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -29,9 +29,7 @@ define void @call(i8* %obj, i32 %arg) {
ret void
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll b/llvm/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll
index 4dbbc1b458b..93936d5e1d2 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/vcp-too-wide-ints.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = global [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf1 to i8*)]
-@vt2 = global [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf2 to i8*)]
+@vt1 = global [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf1 to i8*)], !type !0
+@vt2 = global [1 x i8*] [i8* bitcast (i128 (i8*, i128)* @vf2 to i8*)], !type !0
define i128 @vf1(i8* %this, i128 %arg) readnone {
ret i128 %arg
@@ -19,7 +19,7 @@ define i128 @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*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -29,9 +29,7 @@ define i128 @call(i8* %obj) {
ret i128 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll b/llvm/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll
index 6dff4d17a2b..3124889a707 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/vcp-type-mismatch.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)]
-@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)]
+@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf1 to i8*)], !type !0
+@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*, i32)* @vf2 to i8*)], !type !0
define i32 @vf1(i8* %this, i32 %arg) readnone {
ret i32 %arg
@@ -19,7 +19,7 @@ define i32 @bad_arg_type(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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -34,7 +34,7 @@ define i32 @bad_arg_count(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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -49,7 +49,7 @@ define i64 @bad_return_type(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.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -59,9 +59,7 @@ define i64 @bad_return_type(i8* %obj) {
ret i64 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll b/llvm/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll
index 39a63c62f44..fc4dee37dba 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/vcp-uses-this.ll
@@ -3,8 +3,8 @@
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)]
-@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)]
+@vt1 = global [1 x i8*] [i8* bitcast (i32 (i8*)* @vf1 to i8*)], !type !0
+@vt2 = global [1 x i8*] [i8* bitcast (i32 (i8*)* @vf2 to i8*)], !type !0
define i32 @vf1(i8* %this) readnone {
%this_int = ptrtoint i8* %this to i32
@@ -21,7 +21,7 @@ define i32 @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*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %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
@@ -31,9 +31,7 @@ define i32 @call(i8* %obj) {
ret i32 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [1 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [1 x i8*]* @vt2, i32 0}
-!llvm.bitsets = !{!0}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll b/llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll
index 3686f8aca3e..f65b8a28288 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll
@@ -8,34 +8,34 @@ target triple = "x86_64-unknown-linux-gnu"
i8* bitcast (i1 (i8*)* @vf0i1 to i8*),
i8* bitcast (i1 (i8*)* @vf1i1 to i8*),
i8* bitcast (i32 (i8*)* @vf1i32 to i8*)
-], section "vt1sec"
+], section "vt1sec", !type !0
; CHECK: [[VT2DATA:@[^ ]*]] = private constant { [8 x i8], [3 x i8*], [0 x i8] } { [8 x i8] c"\00\00\00\02\02\00\00\00", [3 x i8*] [i8* bitcast (i1 (i8*)* @vf1i1 to i8*), i8* bitcast (i1 (i8*)* @vf0i1 to i8*), i8* bitcast (i32 (i8*)* @vf2i32 to i8*)], [0 x i8] zeroinitializer }{{$}}
@vt2 = constant [3 x i8*] [
i8* bitcast (i1 (i8*)* @vf1i1 to i8*),
i8* bitcast (i1 (i8*)* @vf0i1 to i8*),
i8* bitcast (i32 (i8*)* @vf2i32 to i8*)
-]
+], !type !0
; CHECK: [[VT3DATA:@[^ ]*]] = private constant { [8 x i8], [3 x i8*], [0 x i8] } { [8 x i8] c"\00\00\00\01\03\00\00\00", [3 x i8*] [i8* bitcast (i1 (i8*)* @vf0i1 to i8*), i8* bitcast (i1 (i8*)* @vf1i1 to i8*), i8* bitcast (i32 (i8*)* @vf3i32 to i8*)], [0 x i8] zeroinitializer }{{$}}
@vt3 = constant [3 x i8*] [
i8* bitcast (i1 (i8*)* @vf0i1 to i8*),
i8* bitcast (i1 (i8*)* @vf1i1 to i8*),
i8* bitcast (i32 (i8*)* @vf3i32 to i8*)
-]
+], !type !0
; CHECK: [[VT4DATA:@[^ ]*]] = private constant { [8 x i8], [3 x i8*], [0 x i8] } { [8 x i8] c"\00\00\00\02\04\00\00\00", [3 x i8*] [i8* bitcast (i1 (i8*)* @vf1i1 to i8*), i8* bitcast (i1 (i8*)* @vf0i1 to i8*), i8* bitcast (i32 (i8*)* @vf4i32 to i8*)], [0 x i8] zeroinitializer }{{$}}
@vt4 = constant [3 x i8*] [
i8* bitcast (i1 (i8*)* @vf1i1 to i8*),
i8* bitcast (i1 (i8*)* @vf0i1 to i8*),
i8* bitcast (i32 (i8*)* @vf4i32 to i8*)
-]
+], !type !0
@vt5 = constant [3 x i8*] [
i8* bitcast (void ()* @__cxa_pure_virtual to i8*),
i8* bitcast (void ()* @__cxa_pure_virtual to i8*),
i8* bitcast (void ()* @__cxa_pure_virtual to i8*)
-]
+], !type !0
; CHECK: @vt1 = alias [3 x i8*], getelementptr inbounds ({ [8 x i8], [3 x i8*], [0 x i8] }, { [8 x i8], [3 x i8*], [0 x i8] }* [[VT1DATA]], i32 0, i32 1)
; CHECK: @vt2 = alias [3 x i8*], getelementptr inbounds ({ [8 x i8], [3 x i8*], [0 x i8] }, { [8 x i8], [3 x i8*], [0 x i8] }* [[VT2DATA]], i32 0, i32 1)
@@ -72,7 +72,7 @@ define i1 @call1(i8* %obj) {
%vtable = load [3 x i8*]*, [3 x i8*]** %vtableptr
; CHECK: [[VT1:%[^ ]*]] = bitcast [3 x i8*]* {{.*}} to i8*
%vtablei8 = bitcast [3 x i8*]* %vtable to i8*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 0
%fptr = load i8*, i8** %fptrptr
@@ -92,7 +92,7 @@ define i1 @call2(i8* %obj) {
%vtable = load [3 x i8*]*, [3 x i8*]** %vtableptr
; CHECK: [[VT2:%[^ ]*]] = bitcast [3 x i8*]* {{.*}} to i8*
%vtablei8 = bitcast [3 x i8*]* %vtable to i8*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 1
%fptr = load i8*, i8** %fptrptr
@@ -112,7 +112,7 @@ define i32 @call3(i8* %obj) {
%vtable = load [3 x i8*]*, [3 x i8*]** %vtableptr
; CHECK: [[VT3:%[^ ]*]] = bitcast [3 x i8*]* {{.*}} to i8*
%vtablei8 = bitcast [3 x i8*]* %vtable to i8*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 2
%fptr = load i8*, i8** %fptrptr
@@ -125,13 +125,8 @@ define i32 @call3(i8* %obj) {
ret i32 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
declare void @__cxa_pure_virtual()
-!0 = !{!"bitset", [3 x i8*]* @vt1, i32 0}
-!1 = !{!"bitset", [3 x i8*]* @vt2, i32 0}
-!2 = !{!"bitset", [3 x i8*]* @vt3, i32 0}
-!3 = !{!"bitset", [3 x i8*]* @vt4, i32 0}
-!4 = !{!"bitset", [3 x i8*]* @vt5, i32 0}
-!llvm.bitsets = !{!0, !1, !2, !3, !4}
+!0 = !{i32 0, !"typeid"}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll b/llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll
index 44608cf67a3..04c89ddb026 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll
@@ -9,14 +9,14 @@ i8* null,
i8* bitcast (i1 (i8*)* @vf0i1 to i8*),
i8* bitcast (i1 (i8*)* @vf1i1 to i8*),
i8* bitcast (i32 (i8*)* @vf1i32 to i8*)
-]
+], !type !1
; CHECK: [[VT2DATA:@[^ ]*]] = private constant { [0 x i8], [3 x i8*], [8 x i8] } { [0 x i8] zeroinitializer, [3 x i8*] [i8* bitcast (i1 (i8*)* @vf1i1 to i8*), i8* bitcast (i1 (i8*)* @vf0i1 to i8*), i8* bitcast (i32 (i8*)* @vf2i32 to i8*)], [8 x i8] c"\02\00\00\00\02\00\00\00" }
@vt2 = constant [3 x i8*] [
i8* bitcast (i1 (i8*)* @vf1i1 to i8*),
i8* bitcast (i1 (i8*)* @vf0i1 to i8*),
i8* bitcast (i32 (i8*)* @vf2i32 to i8*)
-]
+], !type !0
; CHECK: [[VT3DATA:@[^ ]*]] = private constant { [0 x i8], [4 x i8*], [8 x i8] } { [0 x i8] zeroinitializer, [4 x i8*] [i8* null, i8* bitcast (i1 (i8*)* @vf0i1 to i8*), i8* bitcast (i1 (i8*)* @vf1i1 to i8*), i8* bitcast (i32 (i8*)* @vf3i32 to i8*)], [8 x i8] c"\03\00\00\00\01\00\00\00" }
@vt3 = constant [4 x i8*] [
@@ -24,14 +24,14 @@ i8* null,
i8* bitcast (i1 (i8*)* @vf0i1 to i8*),
i8* bitcast (i1 (i8*)* @vf1i1 to i8*),
i8* bitcast (i32 (i8*)* @vf3i32 to i8*)
-]
+], !type !1
; CHECK: [[VT4DATA:@[^ ]*]] = private constant { [0 x i8], [3 x i8*], [8 x i8] } { [0 x i8] zeroinitializer, [3 x i8*] [i8* bitcast (i1 (i8*)* @vf1i1 to i8*), i8* bitcast (i1 (i8*)* @vf0i1 to i8*), i8* bitcast (i32 (i8*)* @vf4i32 to i8*)], [8 x i8] c"\04\00\00\00\02\00\00\00" }
@vt4 = constant [3 x i8*] [
i8* bitcast (i1 (i8*)* @vf1i1 to i8*),
i8* bitcast (i1 (i8*)* @vf0i1 to i8*),
i8* bitcast (i32 (i8*)* @vf4i32 to i8*)
-]
+], !type !0
; CHECK: @vt1 = alias [4 x i8*], getelementptr inbounds ({ [0 x i8], [4 x i8*], [8 x i8] }, { [0 x i8], [4 x i8*], [8 x i8] }* [[VT1DATA]], i32 0, i32 1)
; CHECK: @vt2 = alias [3 x i8*], getelementptr inbounds ({ [0 x i8], [3 x i8*], [8 x i8] }, { [0 x i8], [3 x i8*], [8 x i8] }* [[VT2DATA]], i32 0, i32 1)
@@ -68,7 +68,7 @@ define i1 @call1(i8* %obj) {
%vtable = load [3 x i8*]*, [3 x i8*]** %vtableptr
; CHECK: [[VT1:%[^ ]*]] = bitcast [3 x i8*]* {{.*}} to i8*
%vtablei8 = bitcast [3 x i8*]* %vtable to i8*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 0
%fptr = load i8*, i8** %fptrptr
@@ -88,7 +88,7 @@ define i1 @call2(i8* %obj) {
%vtable = load [3 x i8*]*, [3 x i8*]** %vtableptr
; CHECK: [[VT2:%[^ ]*]] = bitcast [3 x i8*]* {{.*}} to i8*
%vtablei8 = bitcast [3 x i8*]* %vtable to i8*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 1
%fptr = load i8*, i8** %fptrptr
@@ -108,7 +108,7 @@ define i32 @call3(i8* %obj) {
%vtable = load [3 x i8*]*, [3 x i8*]** %vtableptr
; CHECK: [[VT3:%[^ ]*]] = bitcast [3 x i8*]* {{.*}} to i8*
%vtablei8 = bitcast [3 x i8*]* %vtable to i8*
- %p = call i1 @llvm.bitset.test(i8* %vtablei8, metadata !"bitset")
+ %p = call i1 @llvm.type.test(i8* %vtablei8, metadata !"typeid")
call void @llvm.assume(i1 %p)
%fptrptr = getelementptr [3 x i8*], [3 x i8*]* %vtable, i32 0, i32 2
%fptr = load i8*, i8** %fptrptr
@@ -121,11 +121,8 @@ define i32 @call3(i8* %obj) {
ret i32 %result
}
-declare i1 @llvm.bitset.test(i8*, metadata)
+declare i1 @llvm.type.test(i8*, metadata)
declare void @llvm.assume(i1)
-!0 = !{!"bitset", [4 x i8*]* @vt1, i32 8}
-!1 = !{!"bitset", [3 x i8*]* @vt2, i32 0}
-!2 = !{!"bitset", [4 x i8*]* @vt3, i32 8}
-!3 = !{!"bitset", [3 x i8*]* @vt4, i32 0}
-!llvm.bitsets = !{!0, !1, !2, !3}
+!0 = !{i32 0, !"typeid"}
+!1 = !{i32 8, !"typeid"}
OpenPOWER on IntegriCloud