[AMDGPU] Add True16 register classes.
[llvm-project.git] / llvm / test / Transforms / WholeProgramDevirt / vcp-too-wide-ints.ll
blob959ed008e3bf1ff2e8f34b668df0d1be937cb873
1 ; RUN: opt -S -passes=wholeprogramdevirt -whole-program-visibility %s | FileCheck %s
3 target datalayout = "e-p:64:64"
4 target triple = "x86_64-unknown-linux-gnu"
6 @vt1 = constant [1 x ptr] [ptr @vf1], !type !0
7 @vt2 = constant [1 x ptr] [ptr @vf2], !type !0
8 @vt3 = constant [1 x ptr] [ptr @vf3], !type !1
9 @vt4 = constant [1 x ptr] [ptr @vf4], !type !1
11 define i64 @vf1(ptr %this, i128 %arg) readnone {
12   %argtrunc = trunc i128 %arg to i64
13   ret i64 %argtrunc
16 define i64 @vf2(ptr %this, i128 %arg) readnone {
17   %argtrunc = trunc i128 %arg to i64
18   ret i64 %argtrunc
21 define i128 @vf3(ptr %this, i64 %arg) readnone {
22   %argzext = zext i64 %arg to i128
23   ret i128 %argzext
26 define i128 @vf4(ptr %this, i64 %arg) readnone {
27   %argzext = zext i64 %arg to i128
28   ret i128 %argzext
31 ; CHECK: define i64 @call1
32 define i64 @call1(ptr %obj) {
33   %vtable = load ptr, ptr %obj
34   %p = call i1 @llvm.type.test(ptr %vtable, metadata !"typeid1")
35   call void @llvm.assume(i1 %p)
36   %fptr = load ptr, ptr %vtable
37   ; CHECK: call i64 %
38   %result = call i64 %fptr(ptr %obj, i128 1)
39   ret i64 %result
42 ; CHECK: define i128 @call2
43 define i128 @call2(ptr %obj) {
44   %vtable = load ptr, ptr %obj
45   %p = call i1 @llvm.type.test(ptr %vtable, metadata !"typeid2")
46   call void @llvm.assume(i1 %p)
47   %fptr = load ptr, ptr %vtable
48   ; CHECK: call i128 %
49   %result = call i128 %fptr(ptr %obj, i64 1)
50   ret i128 %result
53 declare i1 @llvm.type.test(ptr, metadata)
54 declare void @llvm.assume(i1)
56 !0 = !{i32 0, !"typeid1"}
57 !1 = !{i32 0, !"typeid2"}