Skip to content

Commit 7dc1ca4

Browse files
committed
---
yaml --- r: 13987 b: refs/heads/try c: 65f4b05 h: refs/heads/master i: 13985: 43ceb52 13983: c485367 v: v3
1 parent 96c1993 commit 7dc1ca4

File tree

3 files changed

+86
-72
lines changed

3 files changed

+86
-72
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: bda40e2e4ada8d091ddd29a2b1b42f7792a1964e
5+
refs/heads/try: 65f4b0587a303c742898512121edf0460d4279f7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rt/intrinsics/intrinsics.i386.ll.in

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ target triple = "@CFG_TARGET_TRIPLE@"
1010
%struct.rust_vec = type { i32, i32, [0 x i8] }
1111
%struct.rust_fn = type { i32*, %struct.rust_box* }
1212
%struct.rust_box = type opaque
13-
%struct.rust_task = type { %struct.rust_task_user, i32, %class.context, %struct.stk_seg*, 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*, i32, i32, %class.memory_region, i8, i8, i8, %class.lock_and_signal, %class.hash_map.4, %class.rust_obstack, %"class.std::map", i32, %"class.debug::task_debug_info" }
13+
%struct.rust_task = type { %struct.rust_task_user, i32, [8 x i8], %class.context, %struct.stk_seg*, 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*, i32, i32, %class.memory_region, %class.boxed_region, i8, i8, i8, %class.lock_and_signal, %class.hash_map.4, %class.rust_obstack, i32, %"class.debug::task_debug_info", i32, [8 x i8] }
1414
%struct.rust_task_user = type { i32, i32, %struct.chan_handle, i32 }
1515
%struct.chan_handle = type { i32, i32 }
16-
%class.context = type { %struct.registers_t, %class.context* }
17-
%struct.registers_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i32, i32 }
18-
%struct.stk_seg = type { %struct.stk_seg*, i32, i32, i32, [0 x i8] }
19-
%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, %union.pthread_attr_t, %struct.rust_env*, %class.context }
16+
%class.context = type { %struct.registers_t, %class.context*, [12 x i8] }
17+
%struct.registers_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i32, i32, [12 x i8] }
18+
%struct.stk_seg = type { %struct.stk_seg*, %struct.stk_seg*, i32, i32, i32, [0 x i8] }
19+
%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, %union.pthread_attr_t, %struct.rust_env*, [8 x i8], %class.context }
2020
%class.rust_thread = type { i32 (...)**, i8, i32 }
2121
%class.rust_log = type { i32 (...)**, %class.rust_srv*, %struct.rust_scheduler*, i8 }
2222
%class.rust_srv = type { i32 (...)**, %struct.rust_env*, %class.memory_region }
23-
%struct.rust_env = type { i32, i32, i8*, i8, i8, i8* }
23+
%struct.rust_env = type { i32, i32, i32, i8*, i8, i8, i8* }
2424
%class.memory_region = type { i32 (...)**, %class.rust_srv*, %class.memory_region*, i32, %class.array_list, i8, i8, %class.lock_and_signal }
2525
%class.array_list = type { i32, %"struct.memory_region::alloc_header"**, i32 }
2626
%"struct.memory_region::alloc_header" = type { i8 }
27-
%class.lock_and_signal = type { i32 (...)**, %union.pthread_cond_t, %union.pthread_mutex_t, i32, i8, i8 }
27+
%class.lock_and_signal = type { i32 (...)**, %union.pthread_cond_t, %union.pthread_mutex_t, i32 }
2828
%union.pthread_cond_t = type { %struct.anon, [4 x i8] }
2929
%struct.anon = type { i32, i32, i64, i64, i64, i8*, i32, i32 }
3030
%union.pthread_mutex_t = type { %"struct.<anonymous union>::__pthread_mutex_s" }
@@ -33,7 +33,8 @@ target triple = "@CFG_TARGET_TRIPLE@"
3333
%class.rust_task_list = type { %class.indexed_list, %struct.rust_scheduler*, i8* }
3434
%class.indexed_list = type { i32 (...)**, %class.array_list.1 }
3535
%class.array_list.1 = type { i32, %struct.rust_task**, i32 }
36-
%class.rust_crate_cache = type { %struct.type_desc*, %struct.rust_scheduler*, i32 }
36+
%class.rust_crate_cache = type { %struct.type_desc*, %struct.rust_hashable_dict*, %struct.rust_scheduler*, i32 }
37+
%struct.rust_hashable_dict = type { %struct.UT_hash_handle, [0 x i8*] }
3738
%struct.randctx = type { i32, [256 x i32], [256 x i32], i32, i32, i32 }
3839
%class.rust_kernel = type { i32 (...)**, %class.memory_region, %class.rust_log, %class.rust_srv*, %class.lock_and_signal, %class.array_list.3, %struct.randctx, i32, %class.hash_map, i32, i32, i32, %struct.rust_env* }
3940
%class.array_list.3 = type { i32, %struct.rust_scheduler**, i32 }
@@ -42,72 +43,78 @@ target triple = "@CFG_TARGET_TRIPLE@"
4243
%union.pthread_attr_t = type { i32, [32 x i8] }
4344
%struct.rust_cond = type { i8 }
4445
%class.timer = type { i32 (...)**, i64, i64 }
46+
%class.boxed_region = type { %class.memory_region*, %struct.rust_opaque_box* }
47+
%struct.rust_opaque_box = type { i32, %struct.type_desc*, %struct.rust_opaque_box*, %struct.rust_opaque_box* }
4548
%class.hash_map.4 = type { %"struct.hash_map<int, rust_port *>::map_entry"* }
4649
%"struct.hash_map<int, rust_port *>::map_entry" = type opaque
4750
%class.rust_obstack = type { %struct.rust_obstack_chunk*, %struct.rust_task* }
4851
%struct.rust_obstack_chunk = type { %struct.rust_obstack_chunk*, i32, i32, i32, [0 x i8] }
52+
%"class.debug::task_debug_info" = type { %"class.std::map" }
4953
%"class.std::map" = type { %"class.std::_Rb_tree" }
50-
%"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" }
51-
%"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.std::less", %"struct.std::_Rb_tree_node_base", i32 }
54+
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<void *, std::pair<void *const, std::basic_string<char> >, std::_Select1st<std::pair<void *const, std::basic_string<char> > >, std::less<void *>, std::allocator<std::pair<void *const, std::basic_string<char> > > >::_Rb_tree_impl" }
55+
%"struct.std::_Rb_tree<void *, std::pair<void *const, std::basic_string<char> >, std::_Select1st<std::pair<void *const, std::basic_string<char> > >, std::less<void *>, std::allocator<std::pair<void *const, std::basic_string<char> > > >::_Rb_tree_impl" = type { %"struct.std::less", %"struct.std::_Rb_tree_node_base", i32 }
5256
%"struct.std::less" = type { i8 }
5357
%"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"* }
54-
%"class.debug::task_debug_info" = type { %"class.std::map.5" }
55-
%"class.std::map.5" = type { %"class.std::_Rb_tree.6" }
56-
%"class.std::_Rb_tree.6" = type { %"struct.std::_Rb_tree<void *, std::pair<void *const, std::basic_string<char> >, std::_Select1st<std::pair<void *const, std::basic_string<char> > >, std::less<void *>, std::allocator<std::pair<void *const, std::basic_string<char> > > >::_Rb_tree_impl" }
57-
%"struct.std::_Rb_tree<void *, std::pair<void *const, std::basic_string<char> >, std::_Select1st<std::pair<void *const, std::basic_string<char> > >, std::less<void *>, std::allocator<std::pair<void *const, std::basic_string<char> > > >::_Rb_tree_impl" = type { %"struct.std::less", %"struct.std::_Rb_tree_node_base", i32 }
5858

5959
define void @rust_intrinsic_vec_len(i32* nocapture %retptr, i8* nocapture %env, %struct.type_desc* nocapture %ty, %struct.rust_vec** nocapture %vp) nounwind {
60-
%1 = load %struct.rust_vec** %vp, align 4, !tbaa !0
61-
%2 = getelementptr inbounds %struct.rust_vec* %1, i32 0, i32 0
62-
%3 = load i32* %2, align 4, !tbaa !3
63-
%4 = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1
64-
%5 = load i32* %4, align 4, !tbaa !3
65-
%6 = udiv i32 %3, %5
66-
store i32 %6, i32* %retptr, align 4, !tbaa !3
60+
entry:
61+
%0 = load %struct.rust_vec** %vp, align 4, !tbaa !0
62+
%fill = getelementptr inbounds %struct.rust_vec* %0, i32 0, i32 0
63+
%1 = load i32* %fill, align 4, !tbaa !3
64+
%size = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1
65+
%2 = load i32* %size, align 4, !tbaa !3
66+
%div = udiv i32 %1, %2
67+
store i32 %div, i32* %retptr, align 4, !tbaa !3
6768
ret void
6869
}
6970

7071
define void @rust_intrinsic_ptr_offset(i8** nocapture %retptr, i8* nocapture %env, %struct.type_desc* nocapture %ty, i8* %ptr, i32 %count) nounwind {
71-
%1 = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1
72-
%2 = load i32* %1, align 4, !tbaa !3
73-
%3 = mul i32 %2, %count
74-
%4 = getelementptr inbounds i8* %ptr, i32 %3
75-
store i8* %4, i8** %retptr, align 4, !tbaa !0
72+
entry:
73+
%size = getelementptr inbounds %struct.type_desc* %ty, i32 0, i32 1
74+
%0 = load i32* %size, align 4, !tbaa !3
75+
%mul = mul i32 %0, %count
76+
%arrayidx = getelementptr inbounds i8* %ptr, i32 %mul
77+
store i8* %arrayidx, i8** %retptr, align 4, !tbaa !0
7678
ret void
7779
}
7880

7981
define void @rust_intrinsic_cast(i8* nocapture %retptr, i8* nocapture %env, %struct.type_desc* nocapture %t1, %struct.type_desc* nocapture %t2, i8* nocapture %src) nounwind {
80-
%1 = getelementptr inbounds %struct.type_desc* %t1, i32 0, i32 1
81-
%2 = load i32* %1, align 4, !tbaa !3
82-
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %retptr, i8* %src, i32 %2, i32 1, i1 false)
82+
entry:
83+
%size = getelementptr inbounds %struct.type_desc* %t1, i32 0, i32 1
84+
%0 = load i32* %size, align 4, !tbaa !3
85+
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %retptr, i8* %src, i32 %0, i32 1, i1 false)
8386
ret void
8487
}
8588

8689
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
8790

8891
define void @rust_intrinsic_addr_of(i8** nocapture %retptr, i8* nocapture %env, %struct.type_desc* nocapture %ty, i8* %valptr) nounwind {
92+
entry:
8993
store i8* %valptr, i8** %retptr, align 4, !tbaa !0
9094
ret void
9195
}
9296

9397
define void @rust_intrinsic_call_with_retptr(i8** %retptr, i8* nocapture %env, %struct.type_desc* nocapture %ty, %struct.rust_fn* nocapture %recvfn) {
94-
%1 = getelementptr inbounds %struct.rust_fn* %recvfn, i32 0, i32 0
95-
%2 = load i32** %1, align 4, !tbaa !0
96-
%3 = bitcast i32* %2 to void (i8**, i8*, i8**)*
97-
%4 = getelementptr inbounds %struct.rust_fn* %recvfn, i32 0, i32 1
98-
%5 = load %struct.rust_box** %4, align 4, !tbaa !0
99-
%6 = bitcast %struct.rust_box* %5 to i8*
100-
tail call void %3(i8** null, i8* %6, i8** %retptr)
98+
entry:
99+
%fn1 = getelementptr inbounds %struct.rust_fn* %recvfn, i32 0, i32 0
100+
%0 = load i32** %fn1, align 4, !tbaa !0
101+
%1 = bitcast i32* %0 to void (i8**, i8*, i8**)*
102+
%env2 = getelementptr inbounds %struct.rust_fn* %recvfn, i32 0, i32 1
103+
%2 = load %struct.rust_box** %env2, align 4, !tbaa !0
104+
%3 = bitcast %struct.rust_box* %2 to i8*
105+
tail call void %1(i8** null, i8* %3, i8** %retptr)
101106
ret void
102107
}
103108

104109
define void @rust_intrinsic_get_type_desc(i8** nocapture %retptr, i8* nocapture %env, %struct.type_desc* %ty) nounwind {
110+
entry:
105111
%ty.c = bitcast %struct.type_desc* %ty to i8*
106112
store i8* %ty.c, i8** %retptr, align 4, !tbaa !0
107113
ret void
108114
}
109115

110116
define void @rust_intrinsic_task_sleep(i8** nocapture %retptr, i8* nocapture %env, %struct.rust_task* %task, i32 %time_in_us, i8* %killed) {
117+
entry:
111118
tail call void @rust_task_sleep(%struct.rust_task* %task, i32 %time_in_us, i8* %killed)
112119
ret void
113120
}

0 commit comments

Comments
 (0)