GlobalSplit: Convert tests to opaque pointers

This commit is contained in:
Matt Arsenault 2022-11-26 19:21:01 -05:00
parent a4dbba76b1
commit 6362dd004a
2 changed files with 20 additions and 20 deletions

View File

@ -4,21 +4,21 @@ target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
; CHECK: @global =
@global = internal constant { [2 x i8* ()*], [1 x i8* ()*] } {
[2 x i8* ()*] [i8* ()* @f, i8* ()* @g],
[1 x i8* ()*] [i8* ()* @h]
@global = internal constant { [2 x ptr], [1 x ptr] } {
[2 x ptr] [ptr @f, ptr @g],
[1 x ptr] [ptr @h]
}
define i8* @f() {
ret i8* bitcast (i8* ()** getelementptr ({ [2 x i8* ()*], [1 x i8* ()*] }, { [2 x i8* ()*], [1 x i8* ()*] }* @global, i32 0, inrange i32 0, i32 0) to i8*)
define ptr @f() {
ret ptr getelementptr ({ [2 x ptr], [1 x ptr] }, ptr @global, i32 0, inrange i32 0, i32 0)
}
define i8* @g() {
ret i8* null
define ptr @g() {
ret ptr null
}
define i8* @h() {
ret i8* null
define ptr @h() {
ret ptr null
}
!0 = !{i32 16}

View File

@ -4,26 +4,26 @@ target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
; CHECK: @global =
@global = constant { [2 x i8* ()*], [1 x i8* ()*] } {
[2 x i8* ()*] [i8* ()* @f, i8* ()* @g],
[1 x i8* ()*] [i8* ()* @h]
@global = constant { [2 x ptr], [1 x ptr] } {
[2 x ptr] [ptr @f, ptr @g],
[1 x ptr] [ptr @h]
}
define i8* @f() {
ret i8* bitcast (i8* ()** getelementptr ({ [2 x i8* ()*], [1 x i8* ()*] }, { [2 x i8* ()*], [1 x i8* ()*] }* @global, i32 0, inrange i32 0, i32 0) to i8*)
define ptr @f() {
ret ptr getelementptr ({ [2 x ptr], [1 x ptr] }, ptr @global, i32 0, inrange i32 0, i32 0)
}
define i8* @g() {
ret i8* null
define ptr @g() {
ret ptr null
}
define i8* @h() {
ret i8* null
define ptr @h() {
ret ptr null
}
define void @foo() {
%p = call i1 @llvm.type.test(i8* null, metadata !"")
%p = call i1 @llvm.type.test(ptr null, metadata !"")
ret void
}
declare i1 @llvm.type.test(i8*, metadata) nounwind readnone
declare i1 @llvm.type.test(ptr, metadata) nounwind readnone