Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
cdec87ca
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cdec87ca
编写于
9月 11, 2021
作者:
G
Gary Guo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add mir opt test for min_align_of -> AlignOf lowering
上级
1c3409f3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
180 addition
and
151 deletion
+180
-151
src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
...st/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
+24
-0
src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
...ir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
+81
-81
src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir
...test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir
+18
-18
src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir
...est/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir
+13
-13
src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
...test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
+13
-13
src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
...t/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
+16
-16
src/test/mir-opt/lower_intrinsics.rs
src/test/mir-opt/lower_intrinsics.rs
+5
-0
src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
...mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
+10
-10
未找到文件。
src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
0 → 100644
浏览文件 @
cdec87ca
- // MIR for `align_of` before LowerIntrinsics
+ // MIR for `align_of` after LowerIntrinsics
fn align_of() -> usize {
let mut _0: usize; // return place in scope 0 at $DIR/lower_intrinsics.rs:18:25: 18:30
bb0: {
- _0 = std::intrinsics::min_align_of::<T>() -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:19:5: 19:42
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:19:5: 19:40
- // + literal: Const { ty: extern "rust-intrinsic" fn() -> usize {std::intrinsics::min_align_of::<T>}, val: Value(Scalar(<ZST>)) }
+ _0 = AlignOf(T); // scope 0 at $DIR/lower_intrinsics.rs:19:5: 19:42
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:19:5: 19:42
}
bb1: {
return; // scope 0 at $DIR/lower_intrinsics.rs:20:2: 20:2
}
bb2 (cleanup): {
resume; // scope 0 at $DIR/lower_intrinsics.rs:18:1: 20:2
}
}
src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
浏览文件 @
cdec87ca
...
...
@@ -2,127 +2,127 @@
+ // MIR for `discriminant` after LowerIntrinsics
fn discriminant(_1: T) -> () {
debug t => _1; // in scope 0 at $DIR/lower_intrinsics.rs:
68:24: 68
:25
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:
68:30: 68
:30
let _2: <T as std::marker::DiscriminantKind>::Discriminant; // in scope 0 at $DIR/lower_intrinsics.rs:
69:5: 69
:45
let mut _3: &T; // in scope 0 at $DIR/lower_intrinsics.rs:
69:42: 69
:44
let _4: &T; // in scope 0 at $DIR/lower_intrinsics.rs:
69:42: 69
:44
let _5: u8; // in scope 0 at $DIR/lower_intrinsics.rs:7
0:5: 70
:45
let mut _6: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:7
0:42: 70
:44
let _7: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:7
0:42: 70
:44
let _8: i32; // in scope 0 at $DIR/lower_intrinsics.rs:7
0:43: 70
:44
let _9: u8; // in scope 0 at $DIR/lower_intrinsics.rs:7
1:5: 71
:46
let mut _10: &(); // in scope 0 at $DIR/lower_intrinsics.rs:7
1:42: 71
:45
let _11: &(); // in scope 0 at $DIR/lower_intrinsics.rs:7
1:42: 71
:45
let _12: (); // in scope 0 at $DIR/lower_intrinsics.rs:7
1:43: 71
:45
let _13: isize; // in scope 0 at $DIR/lower_intrinsics.rs:7
2:5: 72
:48
let mut _14: &E; // in scope 0 at $DIR/lower_intrinsics.rs:7
2:42: 72
:47
let _15: &E; // in scope 0 at $DIR/lower_intrinsics.rs:7
2:42: 72
:47
let _16: E; // in scope 0 at $DIR/lower_intrinsics.rs:7
2:43: 72
:47
let mut _17: &E; // in scope 0 at $DIR/lower_intrinsics.rs:7
2:42: 72
:47
let mut _18: &(); // in scope 0 at $DIR/lower_intrinsics.rs:7
1:42: 71
:45
let mut _19: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:7
0:42: 70
:44
debug t => _1; // in scope 0 at $DIR/lower_intrinsics.rs:
73:24: 73
:25
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:
73:30: 73
:30
let _2: <T as std::marker::DiscriminantKind>::Discriminant; // in scope 0 at $DIR/lower_intrinsics.rs:
74:5: 74
:45
let mut _3: &T; // in scope 0 at $DIR/lower_intrinsics.rs:
74:42: 74
:44
let _4: &T; // in scope 0 at $DIR/lower_intrinsics.rs:
74:42: 74
:44
let _5: u8; // in scope 0 at $DIR/lower_intrinsics.rs:7
5:5: 75
:45
let mut _6: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:7
5:42: 75
:44
let _7: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:7
5:42: 75
:44
let _8: i32; // in scope 0 at $DIR/lower_intrinsics.rs:7
5:43: 75
:44
let _9: u8; // in scope 0 at $DIR/lower_intrinsics.rs:7
6:5: 76
:46
let mut _10: &(); // in scope 0 at $DIR/lower_intrinsics.rs:7
6:42: 76
:45
let _11: &(); // in scope 0 at $DIR/lower_intrinsics.rs:7
6:42: 76
:45
let _12: (); // in scope 0 at $DIR/lower_intrinsics.rs:7
6:43: 76
:45
let _13: isize; // in scope 0 at $DIR/lower_intrinsics.rs:7
7:5: 77
:48
let mut _14: &E; // in scope 0 at $DIR/lower_intrinsics.rs:7
7:42: 77
:47
let _15: &E; // in scope 0 at $DIR/lower_intrinsics.rs:7
7:42: 77
:47
let _16: E; // in scope 0 at $DIR/lower_intrinsics.rs:7
7:43: 77
:47
let mut _17: &E; // in scope 0 at $DIR/lower_intrinsics.rs:7
7:42: 77
:47
let mut _18: &(); // in scope 0 at $DIR/lower_intrinsics.rs:7
6:42: 76
:45
let mut _19: &i32; // in scope 0 at $DIR/lower_intrinsics.rs:7
5:42: 75
:44
bb0: {
StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:
69:5: 69
:45
StorageLive(_3); // scope 0 at $DIR/lower_intrinsics.rs:
69:42: 69
:44
StorageLive(_4); // scope 0 at $DIR/lower_intrinsics.rs:
69:42: 69
:44
_4 = &_1; // scope 0 at $DIR/lower_intrinsics.rs:
69:42: 69
:44
_3 = &(*_4); // scope 0 at $DIR/lower_intrinsics.rs:
69:42: 69
:44
- _2 = discriminant_value::<T>(move _3) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:
69:5: 69
:45
StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:
74:5: 74
:45
StorageLive(_3); // scope 0 at $DIR/lower_intrinsics.rs:
74:42: 74
:44
StorageLive(_4); // scope 0 at $DIR/lower_intrinsics.rs:
74:42: 74
:44
_4 = &_1; // scope 0 at $DIR/lower_intrinsics.rs:
74:42: 74
:44
_3 = &(*_4); // scope 0 at $DIR/lower_intrinsics.rs:
74:42: 74
:44
- _2 = discriminant_value::<T>(move _3) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:
74:5: 74
:45
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:
69:5: 69
:41
- // + span: $DIR/lower_intrinsics.rs:
74:5: 74
:41
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r T) -> <T as std::marker::DiscriminantKind>::Discriminant {std::intrinsics::discriminant_value::<T>}, val: Value(Scalar(<ZST>)) }
+ _2 = discriminant((*_3)); // scope 0 at $DIR/lower_intrinsics.rs:
69:5: 69
:45
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:
69:5: 69
:45
+ _2 = discriminant((*_3)); // scope 0 at $DIR/lower_intrinsics.rs:
74:5: 74
:45
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:
74:5: 74
:45
}
bb1: {
StorageDead(_3); // scope 0 at $DIR/lower_intrinsics.rs:
69:44: 69
:45
StorageDead(_4); // scope 0 at $DIR/lower_intrinsics.rs:
69:45: 69
:46
StorageDead(_2); // scope 0 at $DIR/lower_intrinsics.rs:
69:45: 69
:46
StorageLive(_5); // scope 0 at $DIR/lower_intrinsics.rs:7
0:5: 70
:45
StorageLive(_6); // scope 0 at $DIR/lower_intrinsics.rs:7
0:42: 70
:44
StorageLive(_7); // scope 0 at $DIR/lower_intrinsics.rs:7
0:42: 70
:44
_19 = const discriminant::<T>::promoted[2]; // scope 0 at $DIR/lower_intrinsics.rs:7
0:42: 70
:44
StorageDead(_3); // scope 0 at $DIR/lower_intrinsics.rs:
74:44: 74
:45
StorageDead(_4); // scope 0 at $DIR/lower_intrinsics.rs:
74:45: 74
:46
StorageDead(_2); // scope 0 at $DIR/lower_intrinsics.rs:
74:45: 74
:46
StorageLive(_5); // scope 0 at $DIR/lower_intrinsics.rs:7
5:5: 75
:45
StorageLive(_6); // scope 0 at $DIR/lower_intrinsics.rs:7
5:42: 75
:44
StorageLive(_7); // scope 0 at $DIR/lower_intrinsics.rs:7
5:42: 75
:44
_19 = const discriminant::<T>::promoted[2]; // scope 0 at $DIR/lower_intrinsics.rs:7
5:42: 75
:44
// ty::Const
// + ty: &i32
// + val: Unevaluated(discriminant, [T], Some(promoted[2]))
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:7
0:42: 70
:44
// + literal: Const { ty: &i32, val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:2
7
~ lower_intrinsics[2872]::discriminant), const_param_did: None }, substs_: Some([T]), promoted: Some(promoted[2]) }) }
_7 = &(*_19); // scope 0 at $DIR/lower_intrinsics.rs:7
0:42: 70
:44
_6 = &(*_7); // scope 0 at $DIR/lower_intrinsics.rs:7
0:42: 70
:44
- _5 = discriminant_value::<i32>(move _6) -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:7
0:5: 70
:45
// + span: $DIR/lower_intrinsics.rs:7
5:42: 75
:44
// + literal: Const { ty: &i32, val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:2
9
~ lower_intrinsics[2872]::discriminant), const_param_did: None }, substs_: Some([T]), promoted: Some(promoted[2]) }) }
_7 = &(*_19); // scope 0 at $DIR/lower_intrinsics.rs:7
5:42: 75
:44
_6 = &(*_7); // scope 0 at $DIR/lower_intrinsics.rs:7
5:42: 75
:44
- _5 = discriminant_value::<i32>(move _6) -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:7
5:5: 75
:45
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:7
0:5: 70
:41
- // + span: $DIR/lower_intrinsics.rs:7
5:5: 75
:41
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r i32) -> <i32 as std::marker::DiscriminantKind>::Discriminant {std::intrinsics::discriminant_value::<i32>}, val: Value(Scalar(<ZST>)) }
+ _5 = discriminant((*_6)); // scope 0 at $DIR/lower_intrinsics.rs:7
0:5: 70
:45
+ goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:7
0:5: 70
:45
+ _5 = discriminant((*_6)); // scope 0 at $DIR/lower_intrinsics.rs:7
5:5: 75
:45
+ goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:7
5:5: 75
:45
}
bb2: {
StorageDead(_6); // scope 0 at $DIR/lower_intrinsics.rs:7
0:44: 70
:45
StorageDead(_7); // scope 0 at $DIR/lower_intrinsics.rs:7
0:45: 70
:46
StorageDead(_5); // scope 0 at $DIR/lower_intrinsics.rs:7
0:45: 70
:46
StorageLive(_9); // scope 0 at $DIR/lower_intrinsics.rs:7
1:5: 71
:46
StorageLive(_10); // scope 0 at $DIR/lower_intrinsics.rs:7
1:42: 71
:45
StorageLive(_11); // scope 0 at $DIR/lower_intrinsics.rs:7
1:42: 71
:45
_18 = const discriminant::<T>::promoted[1]; // scope 0 at $DIR/lower_intrinsics.rs:7
1:42: 71
:45
StorageDead(_6); // scope 0 at $DIR/lower_intrinsics.rs:7
5:44: 75
:45
StorageDead(_7); // scope 0 at $DIR/lower_intrinsics.rs:7
5:45: 75
:46
StorageDead(_5); // scope 0 at $DIR/lower_intrinsics.rs:7
5:45: 75
:46
StorageLive(_9); // scope 0 at $DIR/lower_intrinsics.rs:7
6:5: 76
:46
StorageLive(_10); // scope 0 at $DIR/lower_intrinsics.rs:7
6:42: 76
:45
StorageLive(_11); // scope 0 at $DIR/lower_intrinsics.rs:7
6:42: 76
:45
_18 = const discriminant::<T>::promoted[1]; // scope 0 at $DIR/lower_intrinsics.rs:7
6:42: 76
:45
// ty::Const
// + ty: &()
// + val: Unevaluated(discriminant, [T], Some(promoted[1]))
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:7
1:42: 71
:45
// + literal: Const { ty: &(), val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:2
7
~ lower_intrinsics[2872]::discriminant), const_param_did: None }, substs_: Some([T]), promoted: Some(promoted[1]) }) }
_11 = &(*_18); // scope 0 at $DIR/lower_intrinsics.rs:7
1:42: 71
:45
_10 = &(*_11); // scope 0 at $DIR/lower_intrinsics.rs:7
1:42: 71
:45
- _9 = discriminant_value::<()>(move _10) -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:7
1:5: 71
:46
// + span: $DIR/lower_intrinsics.rs:7
6:42: 76
:45
// + literal: Const { ty: &(), val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:2
9
~ lower_intrinsics[2872]::discriminant), const_param_did: None }, substs_: Some([T]), promoted: Some(promoted[1]) }) }
_11 = &(*_18); // scope 0 at $DIR/lower_intrinsics.rs:7
6:42: 76
:45
_10 = &(*_11); // scope 0 at $DIR/lower_intrinsics.rs:7
6:42: 76
:45
- _9 = discriminant_value::<()>(move _10) -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:7
6:5: 76
:46
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:7
1:5: 71
:41
- // + span: $DIR/lower_intrinsics.rs:7
6:5: 76
:41
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r ()) -> <() as std::marker::DiscriminantKind>::Discriminant {std::intrinsics::discriminant_value::<()>}, val: Value(Scalar(<ZST>)) }
+ _9 = discriminant((*_10)); // scope 0 at $DIR/lower_intrinsics.rs:7
1:5: 71
:46
+ goto -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:7
1:5: 71
:46
+ _9 = discriminant((*_10)); // scope 0 at $DIR/lower_intrinsics.rs:7
6:5: 76
:46
+ goto -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:7
6:5: 76
:46
}
bb3: {
StorageDead(_10); // scope 0 at $DIR/lower_intrinsics.rs:7
1:45: 71
:46
StorageDead(_11); // scope 0 at $DIR/lower_intrinsics.rs:7
1:46: 71
:47
StorageDead(_9); // scope 0 at $DIR/lower_intrinsics.rs:7
1:46: 71
:47
StorageLive(_13); // scope 0 at $DIR/lower_intrinsics.rs:7
2:5: 72
:48
StorageLive(_14); // scope 0 at $DIR/lower_intrinsics.rs:7
2:42: 72
:47
StorageLive(_15); // scope 0 at $DIR/lower_intrinsics.rs:7
2:42: 72
:47
_17 = const discriminant::<T>::promoted[0]; // scope 0 at $DIR/lower_intrinsics.rs:7
2:42: 72
:47
StorageDead(_10); // scope 0 at $DIR/lower_intrinsics.rs:7
6:45: 76
:46
StorageDead(_11); // scope 0 at $DIR/lower_intrinsics.rs:7
6:46: 76
:47
StorageDead(_9); // scope 0 at $DIR/lower_intrinsics.rs:7
6:46: 76
:47
StorageLive(_13); // scope 0 at $DIR/lower_intrinsics.rs:7
7:5: 77
:48
StorageLive(_14); // scope 0 at $DIR/lower_intrinsics.rs:7
7:42: 77
:47
StorageLive(_15); // scope 0 at $DIR/lower_intrinsics.rs:7
7:42: 77
:47
_17 = const discriminant::<T>::promoted[0]; // scope 0 at $DIR/lower_intrinsics.rs:7
7:42: 77
:47
// ty::Const
// + ty: &E
// + val: Unevaluated(discriminant, [T], Some(promoted[0]))
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:7
2:42: 72
:47
// + literal: Const { ty: &E, val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:2
7
~ lower_intrinsics[2872]::discriminant), const_param_did: None }, substs_: Some([T]), promoted: Some(promoted[0]) }) }
_15 = &(*_17); // scope 0 at $DIR/lower_intrinsics.rs:7
2:42: 72
:47
_14 = &(*_15); // scope 0 at $DIR/lower_intrinsics.rs:7
2:42: 72
:47
- _13 = discriminant_value::<E>(move _14) -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:7
2:5: 72
:48
// + span: $DIR/lower_intrinsics.rs:7
7:42: 77
:47
// + literal: Const { ty: &E, val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:2
9
~ lower_intrinsics[2872]::discriminant), const_param_did: None }, substs_: Some([T]), promoted: Some(promoted[0]) }) }
_15 = &(*_17); // scope 0 at $DIR/lower_intrinsics.rs:7
7:42: 77
:47
_14 = &(*_15); // scope 0 at $DIR/lower_intrinsics.rs:7
7:42: 77
:47
- _13 = discriminant_value::<E>(move _14) -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:7
7:5: 77
:48
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:7
2:5: 72
:41
- // + span: $DIR/lower_intrinsics.rs:7
7:5: 77
:41
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r E) -> <E as std::marker::DiscriminantKind>::Discriminant {std::intrinsics::discriminant_value::<E>}, val: Value(Scalar(<ZST>)) }
+ _13 = discriminant((*_14)); // scope 0 at $DIR/lower_intrinsics.rs:7
2:5: 72
:48
+ goto -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:7
2:5: 72
:48
+ _13 = discriminant((*_14)); // scope 0 at $DIR/lower_intrinsics.rs:7
7:5: 77
:48
+ goto -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:7
7:5: 77
:48
}
bb4: {
StorageDead(_14); // scope 0 at $DIR/lower_intrinsics.rs:7
2:47: 72
:48
StorageDead(_15); // scope 0 at $DIR/lower_intrinsics.rs:7
2:48: 72
:49
StorageDead(_13); // scope 0 at $DIR/lower_intrinsics.rs:7
2:48: 72
:49
_0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:
68:30: 73
:2
drop(_1) -> bb5; // scope 0 at $DIR/lower_intrinsics.rs:7
3:1: 73
:2
StorageDead(_14); // scope 0 at $DIR/lower_intrinsics.rs:7
7:47: 77
:48
StorageDead(_15); // scope 0 at $DIR/lower_intrinsics.rs:7
7:48: 77
:49
StorageDead(_13); // scope 0 at $DIR/lower_intrinsics.rs:7
7:48: 77
:49
_0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:
73:30: 78
:2
drop(_1) -> bb5; // scope 0 at $DIR/lower_intrinsics.rs:7
8:1: 78
:2
}
bb5: {
return; // scope 0 at $DIR/lower_intrinsics.rs:7
3:2: 73
:2
return; // scope 0 at $DIR/lower_intrinsics.rs:7
8:2: 78
:2
}
bb6 (cleanup): {
resume; // scope 0 at $DIR/lower_intrinsics.rs:
68:1: 73
:2
resume; // scope 0 at $DIR/lower_intrinsics.rs:
73:1: 78
:2
}
}
src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir
浏览文件 @
cdec87ca
// MIR for `f_u64` before PreCodegen
fn f_u64() -> () {
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:3
4:16: 34
:16
let mut _1: u64; // in scope 0 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
scope 1 (inlined f_dispatch::<u64>) { // at $DIR/lower_intrinsics.rs:
35:5: 35
:21
debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics.rs:
35:5: 35
:21
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:3
9:16: 39
:16
let mut _1: u64; // in scope 0 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
scope 1 (inlined f_dispatch::<u64>) { // at $DIR/lower_intrinsics.rs:
40:5: 40
:21
debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics.rs:
40:5: 40
:21
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
_1 = const 0_u64; // scope 0 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
_3 = move _1; // scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
_2 = f_non_zst::<u64>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
_1 = const 0_u64; // scope 0 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
_3 = move _1; // scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
_2 = f_non_zst::<u64>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:
35:5: 35
:21
// + span: $DIR/lower_intrinsics.rs:
40:5: 40
:21
// + literal: Const { ty: fn(u64) {f_non_zst::<u64>}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:
35:5: 35
:21
return; // scope 0 at $DIR/lower_intrinsics.rs:
36:2: 36
:2
StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:
40:5: 40
:21
return; // scope 0 at $DIR/lower_intrinsics.rs:
41:2: 41
:2
}
}
src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir
浏览文件 @
cdec87ca
// MIR for `f_unit` before PreCodegen
fn f_unit() -> () {
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:
28:17: 28
:17
let mut _1: (); // in scope 0 at $DIR/lower_intrinsics.rs:
29:16: 29
:18
scope 1 (inlined f_dispatch::<()>) { // at $DIR/lower_intrinsics.rs:
29:5: 29
:19
debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:
29:5: 29
:19
let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:
29:5: 29
:19
scope 2 (inlined std::mem::size_of::<()>) { // at $DIR/lower_intrinsics.rs:
29:5: 29
:19
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:
33:17: 33
:17
let mut _1: (); // in scope 0 at $DIR/lower_intrinsics.rs:
34:16: 34
:18
scope 1 (inlined f_dispatch::<()>) { // at $DIR/lower_intrinsics.rs:
34:5: 34
:19
debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:
34:5: 34
:19
let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:
34:5: 34
:19
scope 2 (inlined std::mem::size_of::<()>) { // at $DIR/lower_intrinsics.rs:
34:5: 34
:19
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:
29:16: 29
:18
StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:
29:5: 29
:19
_2 = f_zst::<()>(const ()) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:
29:5: 29
:19
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:
34:16: 34
:18
StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:
34:5: 34
:19
_2 = f_zst::<()>(const ()) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:
34:5: 34
:19
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:
29:5: 29
:19
// + span: $DIR/lower_intrinsics.rs:
34:5: 34
:19
// + literal: Const { ty: fn(()) {f_zst::<()>}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:
29:5: 29
:19
StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:
29:18: 29
:19
return; // scope 0 at $DIR/lower_intrinsics.rs:3
0:2: 30
:2
StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:
34:5: 34
:19
StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:
34:18: 34
:19
return; // scope 0 at $DIR/lower_intrinsics.rs:3
5:2: 35
:2
}
}
src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
浏览文件 @
cdec87ca
...
...
@@ -2,32 +2,32 @@
+ // MIR for `forget` after LowerIntrinsics
fn forget(_1: T) -> () {
debug t => _1; // in scope 0 at $DIR/lower_intrinsics.rs:
18:18: 18
:19
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:
18:24: 18
:24
let mut _2: T; // in scope 0 at $DIR/lower_intrinsics.rs:
19:30: 19
:31
debug t => _1; // in scope 0 at $DIR/lower_intrinsics.rs:
23:18: 23
:19
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:
23:24: 23
:24
let mut _2: T; // in scope 0 at $DIR/lower_intrinsics.rs:
24:30: 24
:31
bb0: {
StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:
19:30: 19
:31
_2 = move _1; // scope 0 at $DIR/lower_intrinsics.rs:
19:30: 19
:31
- _0 = std::intrinsics::forget::<T>(move _2) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:
19:5: 19
:32
StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:
24:30: 24
:31
_2 = move _1; // scope 0 at $DIR/lower_intrinsics.rs:
24:30: 24
:31
- _0 = std::intrinsics::forget::<T>(move _2) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:
24:5: 24
:32
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:
19:5: 19
:29
- // + span: $DIR/lower_intrinsics.rs:
24:5: 24
:29
- // + literal: Const { ty: extern "rust-intrinsic" fn(T) {std::intrinsics::forget::<T>}, val: Value(Scalar(<ZST>)) }
+ _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:
19:5: 19
:32
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:
19:5: 19
:32
+ _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:
24:5: 24
:32
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:
24:5: 24
:32
}
bb1: {
StorageDead(_2); // scope 0 at $DIR/lower_intrinsics.rs:
19:31: 19
:32
goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:2
0:1: 20
:2
StorageDead(_2); // scope 0 at $DIR/lower_intrinsics.rs:
24:31: 24
:32
goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:2
5:1: 25
:2
}
bb2: {
return; // scope 0 at $DIR/lower_intrinsics.rs:2
0:2: 20
:2
return; // scope 0 at $DIR/lower_intrinsics.rs:2
5:2: 25
:2
}
bb3 (cleanup): {
resume; // scope 0 at $DIR/lower_intrinsics.rs:
18:1: 20
:2
resume; // scope 0 at $DIR/lower_intrinsics.rs:
23:1: 25
:2
}
}
src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
浏览文件 @
cdec87ca
...
...
@@ -2,34 +2,34 @@
+ // MIR for `non_const` after LowerIntrinsics
fn non_const() -> usize {
let mut _0: usize; // return place in scope 0 at $DIR/lower_intrinsics.rs:
55:26: 55
:31
let _1: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}; // in scope 0 at $DIR/lower_intrinsics.rs:
57:9: 57
:18
let mut _2: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}; // in scope 0 at $DIR/lower_intrinsics.rs:
58:5: 58
:14
let mut _0: usize; // return place in scope 0 at $DIR/lower_intrinsics.rs:
60:26: 60
:31
let _1: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}; // in scope 0 at $DIR/lower_intrinsics.rs:
62:9: 62
:18
let mut _2: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}; // in scope 0 at $DIR/lower_intrinsics.rs:
63:5: 63
:14
scope 1 {
debug size_of_t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:
57:9: 57
:18
debug size_of_t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:
62:9: 62
:18
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:
57:9: 57
:18
_1 = std::intrinsics::size_of::<T>; // scope 0 at $DIR/lower_intrinsics.rs:
57:21: 57
:51
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:
62:9: 62
:18
_1 = std::intrinsics::size_of::<T>; // scope 0 at $DIR/lower_intrinsics.rs:
62:21: 62
:51
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:
57:21: 57
:51
// + span: $DIR/lower_intrinsics.rs:
62:21: 62
:51
// + literal: Const { ty: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}, val: Value(Scalar(<ZST>)) }
StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:
58:5: 58
:14
_2 = _1; // scope 1 at $DIR/lower_intrinsics.rs:
58:5: 58
:14
- _0 = move _2() -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:
58:5: 58
:16
+ _0 = SizeOf(T); // scope 1 at $DIR/lower_intrinsics.rs:
58:5: 58
:16
+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:
58:5: 58
:16
StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:
63:5: 63
:14
_2 = _1; // scope 1 at $DIR/lower_intrinsics.rs:
63:5: 63
:14
- _0 = move _2() -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:
63:5: 63
:16
+ _0 = SizeOf(T); // scope 1 at $DIR/lower_intrinsics.rs:
63:5: 63
:16
+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:
63:5: 63
:16
}
bb1: {
StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:
58:15: 58
:16
StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:
59:1: 59
:2
return; // scope 0 at $DIR/lower_intrinsics.rs:
59:2: 59
:2
StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:
63:15: 63
:16
StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:
64:1: 64
:2
return; // scope 0 at $DIR/lower_intrinsics.rs:
64:2: 64
:2
}
bb2 (cleanup): {
resume; // scope 0 at $DIR/lower_intrinsics.rs:
55:1: 59
:2
resume; // scope 0 at $DIR/lower_intrinsics.rs:
60:1: 64
:2
}
}
src/test/mir-opt/lower_intrinsics.rs
浏览文件 @
cdec87ca
...
...
@@ -14,6 +14,11 @@ pub fn size_of<T>() -> usize {
core
::
intrinsics
::
size_of
::
<
T
>
()
}
// EMIT_MIR lower_intrinsics.align_of.LowerIntrinsics.diff
pub
fn
align_of
<
T
>
()
->
usize
{
core
::
intrinsics
::
min_align_of
::
<
T
>
()
}
// EMIT_MIR lower_intrinsics.forget.LowerIntrinsics.diff
pub
fn
forget
<
T
>
(
t
:
T
)
{
core
::
intrinsics
::
forget
(
t
)
...
...
src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
浏览文件 @
cdec87ca
...
...
@@ -2,25 +2,25 @@
+ // MIR for `unreachable` after LowerIntrinsics
fn unreachable() -> ! {
let mut _0: !; // return place in scope 0 at $DIR/lower_intrinsics.rs:2
3:25: 23
:26
let mut _1: !; // in scope 0 at $DIR/lower_intrinsics.rs:2
3:27: 25
:2
let _2: (); // in scope 0 at $DIR/lower_intrinsics.rs:2
4:14: 24
:45
let mut _3: !; // in scope 0 at $DIR/lower_intrinsics.rs:2
4:14: 24
:45
let mut _0: !; // return place in scope 0 at $DIR/lower_intrinsics.rs:2
8:25: 28
:26
let mut _1: !; // in scope 0 at $DIR/lower_intrinsics.rs:2
8:27: 30
:2
let _2: (); // in scope 0 at $DIR/lower_intrinsics.rs:2
9:14: 29
:45
let mut _3: !; // in scope 0 at $DIR/lower_intrinsics.rs:2
9:14: 29
:45
scope 1 {
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:2
4:5: 24
:47
StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:2
4:14: 24
:45
- std::intrinsics::unreachable(); // scope 1 at $DIR/lower_intrinsics.rs:2
4:14: 24
:45
StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:2
9:5: 29
:47
StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:2
9:14: 29
:45
- std::intrinsics::unreachable(); // scope 1 at $DIR/lower_intrinsics.rs:2
9:14: 29
:45
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:2
4:14: 24
:43
- // + span: $DIR/lower_intrinsics.rs:2
9:14: 29
:43
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn() -> ! {std::intrinsics::unreachable}, val: Value(Scalar(<ZST>)) }
+ unreachable; // scope 1 at $DIR/lower_intrinsics.rs:2
4:14: 24
:45
+ unreachable; // scope 1 at $DIR/lower_intrinsics.rs:2
9:14: 29
:45
}
bb1 (cleanup): {
resume; // scope 0 at $DIR/lower_intrinsics.rs:2
3:1: 25
:2
resume; // scope 0 at $DIR/lower_intrinsics.rs:2
8:1: 30
:2
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录