1
1
; ModuleID = 'intrinsics.cpp'
2
2
target triple = "@CFG_LLVM_TRIPLE@"
3
3
4
- %struct.rust_task = type { i32, %struct.stk_seg*, i32, i32, %struct.gc_alloc*, %struct.rust_scheduler*, %class.rust_crate_cache*, %class.rust_kernel*, i8*, %class.rust_task_list*, %struct.rust_cond*, i8*, %struct.rust_task*, i32, i32, i32, %class.timer, i32*, %class.array_list, %class.context, i32, i32, %class.memory_region, %"class.rust_task::wakeup_callback"*, i8, i8, %class.lock_and_signal }
5
- %struct.stk_seg = type { i32, i32, [0 x i8] }
6
- %struct.gc_alloc = type { %struct.gc_alloc*, %struct.gc_alloc*, i32, [0 x i8] }
7
- %struct.rust_scheduler = type { %class.rust_thread, %struct.rc_base, i32, %class.rust_log, i32, %class.rust_srv*, i8*, %class.rust_task_list, %class.rust_task_list, %class.rust_task_list, %class.rust_task_list, %class.rust_crate_cache, %struct.randctx, %class.rust_kernel*, i32, %class.hash_map, %class.hash_map.3, i32, %class.lock_and_signal, i32, %struct._opaque_pthread_attr_t, %struct.rust_env* }
8
- %class.rust_thread = type { i32 (...)**, i8, %struct._opaque_pthread_t* }
9
- %struct._opaque_pthread_t = type { i32, %struct.__darwin_pthread_handler_rec*, [596 x i8] }
10
- %struct.__darwin_pthread_handler_rec = type { {}*, i8*, %struct.__darwin_pthread_handler_rec* }
11
- %struct.rc_base = type { i32 }
4
+ %0 = type { i32, %"struct.memory_region::alloc_header"**, i32 }
5
+ %1 = type { i32, %struct.rust_scheduler**, i32 }
6
+ %2 = type { %"struct.hash_map<long, rust_task *>::map_entry"* }
7
+ %3 = type { %struct.rust_task*, i32, i32, %class.rust_chan** }
8
+ %class.array_list = type { i32, %struct.rust_task**, i32 }
9
+ %class.circular_buffer = type { %class.rust_kernel*, i32, i32, i32, i32, i8* }
10
+ %class.context = type { %struct.registers_t, %class.context* }
11
+ %"class.debug::task_debug_info" = type { %"class.std::map" }
12
+ %class.hash_map = type { %"struct.hash_map<long, rust_port *>::map_entry"* }
13
+ %class.indexed_list = type { i32 (...)**, %class.array_list }
14
+ %class.lock_and_signal = type { i32 (...)**, %struct._opaque_pthread_cond_t, %struct._opaque_pthread_mutex_t, %struct._opaque_pthread_t*, i8, i8 }
15
+ %class.memory_region = type { i32 (...)**, %class.rust_srv*, %class.memory_region*, i32, %0, i8, i8, %class.lock_and_signal }
16
+ %class.ptr_vec = type { %struct.rust_task*, i32, i32, %struct.rust_token** }
17
+ %class.rust_chan = type { i32, %class.rust_kernel*, %struct.rust_task*, %class.rust_port*, i32, %class.circular_buffer }
18
+ %class.rust_crate_cache = type { %struct.type_desc*, %struct.rust_scheduler*, i32 }
19
+ %class.rust_kernel = type { i32 (...)**, %class.memory_region, %class.rust_log, %class.rust_srv*, %class.lock_and_signal, %1, %struct.randctx, i32, %2, i32, i32, i32, %struct.rust_env* }
12
20
%class.rust_log = type { i32 (...)**, %class.rust_srv*, %struct.rust_scheduler*, i8 }
21
+ %class.rust_obstack = type { %struct.rust_obstack_chunk*, %struct.rust_task* }
22
+ %class.rust_port = type { i32, i32, %class.rust_kernel*, %struct.rust_task*, %class.rust_chan*, i32, %class.ptr_vec, %3, %class.lock_and_signal }
13
23
%class.rust_srv = type { i32 (...)**, %struct.rust_env*, %class.memory_region }
14
- %struct.rust_env = type { i32, i32, i8*, i8, i8, i8* }
15
- %class.memory_region = type { i32 (...)**, %class.rust_srv*, %class.memory_region*, i32, %class.array_list.0, i8, i8, %class.lock_and_signal, i8 }
16
- %class.array_list.0 = type { i32, %"struct.memory_region::alloc_header"**, i32 }
17
- %"struct.memory_region::alloc_header" = type { i32, i32, i8*, [0 x i8] }
18
- %class.lock_and_signal = type { i32 (...)**, %struct._opaque_pthread_cond_t, %struct._opaque_pthread_mutex_t, %struct._opaque_pthread_t*, i8, i8 }
19
- %struct._opaque_pthread_cond_t = type { i32, [24 x i8] }
20
- %struct._opaque_pthread_mutex_t = type { i32, [40 x i8] }
24
+ %"class.rust_task::wakeup_callback" = type { i32 (...)** }
21
25
%class.rust_task_list = type { %class.indexed_list, %struct.rust_scheduler*, i8* }
22
- %class.indexed_list = type { i32 (...)**, %class.array_list }
23
- %class.array_list = type { i32, %struct.rust_task**, i32 }
24
- %class.rust_crate_cache = type { %struct.type_desc*, %struct.rust_scheduler*, i32 }
25
- %struct.type_desc = type { %struct.type_desc**, i32, i32, {}*, {}*, {}*, {}*, {}*, {}*, i32, {}*, %struct.UT_hash_handle, i32, [0 x %struct.type_desc*] }
26
+ %class.rust_thread = type { i32 (...)**, i8, %struct._opaque_pthread_t* }
27
+ %"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<void *, std::pair<void *const, const type_desc *>, std::_Select1st<std::pair<void *const, const type_desc *> >, std::less<void *>, std::allocator<std::pair<void *const, const type_desc *> > >::_Rb_tree_impl" }
28
+ %"class.std::map" = type { %"class.std::_Rb_tree" }
29
+ %class.timer = type { i32 (...)**, i64, i64 }
30
+ %struct.UT_hash_bucket = type { %struct.UT_hash_handle*, i32, i32 }
26
31
%struct.UT_hash_handle = type { %struct.UT_hash_table*, i8*, i8*, %struct.UT_hash_handle*, %struct.UT_hash_handle*, i8*, i32, i32 }
27
32
%struct.UT_hash_table = type { %struct.UT_hash_bucket*, i32, i32, i32, %struct.UT_hash_handle*, i32, i32, i32, i32, i32 }
28
- %struct.UT_hash_bucket = type { %struct.UT_hash_handle*, i32, i32 }
29
- %struct.randctx = type { i32, [256 x i32], [256 x i32], i32, i32, i32 }
30
- %class.rust_kernel = type { i32 (...)**, %class.memory_region, %class.rust_log, %class.rust_srv*, %class.lock_and_signal, %class.array_list.4, %struct.randctx, i32, i32, i32, %struct.rust_env* }
31
- %class.array_list.4 = type { i32, %struct.rust_scheduler**, i32 }
32
- %class.hash_map = type { %"struct.hash_map<rust_task *, rust_task *>::map_entry"* }
33
- %"struct.hash_map<rust_task *, rust_task *>::map_entry" = type opaque
34
- %class.hash_map.3 = type { %"struct.hash_map<rust_port *, rust_port *>::map_entry"* }
35
- %"struct.hash_map<rust_port *, rust_port *>::map_entry" = type opaque
33
+ %struct.__darwin_pthread_handler_rec = type { void (i8*)*, i8*, %struct.__darwin_pthread_handler_rec* }
36
34
%struct._opaque_pthread_attr_t = type { i32, [36 x i8] }
37
- %struct.rust_cond = type { i8 }
38
- %class.timer = type { i32 (...)**, i64, i64 }
39
- %class.context = type { %struct.registers_t, %class.context* }
35
+ %struct._opaque_pthread_cond_t = type { i32, [24 x i8] }
36
+ %struct._opaque_pthread_mutex_t = type { i32, [40 x i8] }
37
+ %struct._opaque_pthread_t = type { i32, %struct.__darwin_pthread_handler_rec*, [596 x i8] }
38
+ %struct.chan_handle = type { i32, i32 }
39
+ %"struct.hash_map<long, rust_port *>::map_entry" = type opaque
40
+ %"struct.hash_map<long, rust_task *>::map_entry" = type opaque
41
+ %"struct.memory_region::alloc_header" = type { i32, i32, i8*, i32, [0 x i8] }
42
+ %struct.randctx = type { i32, [256 x i32], [256 x i32], i32, i32, i32 }
40
43
%struct.registers_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i32, i32 }
41
- %"class.rust_task::wakeup_callback" = type { i32 (...)** }
42
- %struct.rc_base.5 = type { i32 }
43
- %struct.rust_vec = type { i32, i32, [ 0 x i8 ] }
44
- %class.rust_port = type { i32, %class.rust_kernel*, %struct.rust_task*, i32, %class.ptr_vec, %class.ptr_vec.7, %class.rust_chan*, %class.lock_and_signal }
45
- %class.ptr_vec = type { %struct.rust_task*, i32, i32, %struct.rust_token** }
44
+ %struct.rust_cond = type { i8 }
45
+ %struct.rust_env = type { i32, i32, i8*, i8, i8, i8* }
46
+ %struct.rust_obstack_chunk = type { %struct.rust_obstack_chunk*, i32, i32, i32, [0 x i8] }
47
+ %struct.rust_scheduler = type { %class.rust_thread, i32, i32, %class.rust_log, i32, %class.rust_srv*, i8*, %class.rust_task_list, %class.rust_task_list, %class.rust_task_list, %class.rust_task_list, %class.rust_crate_cache, %struct.randctx, %class.rust_kernel*, i32, i32, %class.lock_and_signal, i32, %struct._opaque_pthread_attr_t, %struct.rust_env*, %class.context }
48
+ %struct.rust_shape_tables = type { i8*, i8* }
49
+ %struct.rust_task = type { %struct.rust_task_user, i32, %class.context, %struct.rust_vec*, i32, %struct.rust_scheduler*, %class.rust_crate_cache*, %class.rust_kernel*, i8*, %class.rust_task_list*, %struct.rust_cond*, i8*, %struct.rust_task*, i32, i32, %class.timer, i32*, %class.array_list, i32, i32, %class.memory_region, %"class.rust_task::wakeup_callback"*, i8, i8, i8, %class.lock_and_signal, %class.hash_map, %class.rust_obstack, %"class.std::map", i32, %"class.debug::task_debug_info" }
50
+ %struct.rust_task_user = type { i32, i32, %struct.chan_handle, i32 }
46
51
%struct.rust_token = type opaque
47
- %class.ptr_vec.7 = type { %struct.rust_task*, i32, i32, %class.rust_chan** }
48
- %class.rust_chan = type { i32, %class.rust_kernel*, %struct.rust_task*, %class.rust_port*, i32, %class.circular_buffer }
49
- %class.circular_buffer = type { %class.rust_kernel*, i32, i32, i32, i32, i8* }
52
+ %struct.rust_vec = type { i32, i32, [0 x i8] }
53
+ %"struct.std::_Rb_tree<void *, std::pair<void *const, const type_desc *>, std::_Select1st<std::pair<void *const, const type_desc *> >, std::less<void *>, std::allocator<std::pair<void *const, const type_desc *> > >::_Rb_tree_impl" = type { %struct.rust_cond, %"struct.std::_Rb_tree_node_base", i32 }
54
+ %"struct.std::_Rb_tree_node_base" = type { i32, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"* }
55
+ %struct.type_desc = type { %struct.type_desc**, i32, i32, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, i8*, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*)*, i32, void (i8*, %struct.rust_task*, i8*, %struct.type_desc**, i8*, i8*, i8)*, i8*, %struct.rust_shape_tables*, i32, i32, %struct.UT_hash_handle, i32, [0 x %struct.type_desc*] }
50
56
51
- @.str = private unnamed_addr constant [42 x i8] c"attempt to cast values of differing sizes\00", align 1
52
- @.str1 = private unnamed_addr constant [15 x i8] c"intrinsics.cpp\00", align 1
57
+ @.str = private unnamed_addr constant [42 x i8] c"attempt to cast values of differing sizes\00"
58
+ @.str1 = private unnamed_addr constant [15 x i8] c"intrinsics.cpp\00"
53
59
54
- define linkonce_odr void @rust_intrinsic_vec_len(%struct.rust_task* nocapture %task, i32* nocapture %retptr, %struct.type_desc* nocapture %ty, %struct.rust_vec** nocapture %v) nounwind {
55
- entry:
56
- %ptr1 = load %struct.rust_vec** %v, align 4, !tbaa !0
57
- %fill1 = getelementptr inbounds %struct.rust_vec* %ptr1, i32 0, i32 0
58
- %tmp2 = load i32* %fill1, align 4, !tbaa !0
59
- %size = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1
60
- %tmp20 = load i32* %size, align 4, !tbaa !0
61
- %div = udiv i32 %tmp2, %tmp20
62
- store i32 %div, i32* %retptr, align 4, !tbaa !0
60
+ define void @rust_intrinsic_vec_len(%struct.rust_task* nocapture %task, i32* nocapture %retptr, %struct.type_desc* nocapture %ty, %struct.rust_vec** nocapture %vp) nounwind {
61
+ %1 = load %struct.rust_vec** %vp, align 4
62
+ %2 = getelementptr inbounds %struct.rust_vec* %1, i32 0, i32 0
63
+ %3 = load i32* %2, align 4
64
+ %4 = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1
65
+ %5 = load i32* %4, align 4
66
+ %6 = udiv i32 %3, %5
67
+ store i32 %6, i32* %retptr, align 4
63
68
ret void
64
69
}
65
70
66
- define linkonce_odr void @rust_intrinsic_ptr_offset(%struct.rust_task* nocapture %task, i8** nocapture %retptr, %struct.type_desc* nocapture %ty, i8* %ptr, i32 %count) nounwind {
67
- entry:
68
- %size = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1
69
- %tmp1 = load i32* %size, align 4, !tbaa !0
70
- %mul = mul i32 %tmp1, %count
71
- %arrayidx = getelementptr inbounds i8* %ptr, i32 %mul
72
- store i8* %arrayidx, i8** %retptr, align 4, !tbaa !3
71
+ define void @rust_intrinsic_ptr_offset(%struct.rust_task* nocapture %task, i8** nocapture %retptr, %struct.type_desc* nocapture %ty, i8* %ptr, i32 %count) nounwind {
72
+ %1 = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1
73
+ %2 = load i32* %1, align 4
74
+ %3 = mul i32 %2, %count
75
+ %4 = getelementptr inbounds i8* %ptr, i32 %3
76
+ store i8* %4, i8** %retptr, align 4
73
77
ret void
74
78
}
75
79
76
- define linkonce_odr void @rust_intrinsic_cast(%struct.rust_task* %task, i8* nocapture %retptr, %struct.type_desc* nocapture %t1, %struct.type_desc* nocapture %t2, i8* nocapture %src) {
77
- entry:
78
- %size = getelementptr inbounds %struct.type_desc* %t1, i32 0, i32 1
79
- %tmp1 = load i32* %size, align 4, !tbaa !0
80
- %size3 = getelementptr inbounds %struct.type_desc* %t2, i32 0, i32 1
81
- %tmp4 = load i32* %size3, align 4, !tbaa !0
82
- %cmp = icmp eq i32 %tmp1, %tmp4
83
- br i1 %cmp, label %if.end, label %if.then
80
+ define void @rust_intrinsic_cast(%struct.rust_task* %task, i8* nocapture %retptr, %struct.type_desc* nocapture %t1, %struct.type_desc* nocapture %t2, i8* nocapture %src) {
81
+ %1 = getelementptr inbounds %struct.type_desc* %t1, i32 0, i32 1
82
+ %2 = load i32* %1, align 4
83
+ %3 = getelementptr inbounds %struct.type_desc* %t2, i32 0, i32 1
84
+ %4 = load i32* %3, align 4
85
+ %5 = icmp eq i32 %2, %4
86
+ br i1 %5, label %7, label %6
84
87
85
88
if.then: ; preds = %entry
86
89
tail call void @upcall_fail(i8* getelementptr inbounds ([42 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8]* @.str1, i32 0, i32 0), i32 45)
87
90
br label %return
88
91
89
- if.end: ; preds = %entry
90
- tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %retptr, i8* %src, i32 %tmp1 , i32 1, i1 false)
91
- br label %return
92
+ ; <label>:7 ; preds = %0
93
+ tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %retptr, i8* %src, i32 %2 , i32 1, i1 false)
94
+ br label %8
92
95
93
- return: ; preds = %if.end , %if.then
96
+ ; <label>:8 ; preds = %7 , %6
94
97
ret void
95
98
}
96
99
97
100
declare void @upcall_fail(i8*, i8*, i32)
98
101
99
102
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
100
103
101
- define linkonce_odr void @rust_intrinsic_addr_of(%struct.rust_task* nocapture %task, i8** nocapture %retptr, %struct.type_desc* nocapture %ty, i8* %valptr) nounwind {
102
- entry:
103
- store i8* %valptr, i8** %retptr, align 4, !tbaa !3
104
+ define void @rust_intrinsic_addr_of(%struct.rust_task* nocapture %task, i8** nocapture %retptr, %struct.type_desc* nocapture %ty, i8* %valptr) nounwind {
105
+ store i8* %valptr, i8** %retptr, align 4
104
106
ret void
105
107
}
106
108
@@ -113,7 +115,8 @@ entry:
113
115
114
116
declare void @port_recv(i32*, %class.rust_port*)
115
117
116
- !0 = metadata !{metadata !"long", metadata !1}
117
- !1 = metadata !{metadata !"omnipotent char", metadata !2}
118
- !2 = metadata !{metadata !"Simple C/C++ TBAA", null}
119
- !3 = metadata !{metadata !"any pointer", metadata !1}
118
+ define void @rust_intrinsic_get_type_desc(%struct.rust_task* nocapture %task, i8** nocapture %retptr, %struct.type_desc* %ty) nounwind {
119
+ %ty.c = bitcast %struct.type_desc* %ty to i8*
120
+ store i8* %ty.c, i8** %retptr, align 4
121
+ ret void
122
+ }
0 commit comments