Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
91eabf5
Add a sane error for rust-call functions not taking tuples during typ…
CraftSpider Nov 11, 2020
bf04b04
Missing feature-gate-abi file
CraftSpider Nov 11, 2020
1e9d5c7
Minor stylistic / review changes
CraftSpider Nov 12, 2020
2b7ffec
Don't special case constant operands when lowering intrinsics
tmiasko Nov 16, 2020
207de01
libary: Forward compiler-builtins "asm" and "mangled-names" feature
stlankes Nov 16, 2020
c03790f
Add //ignore-macos to pretty-std-collections.rs
est31 Nov 16, 2020
ed26f6e
compiletest: Fix a warning in debuginfo tests on windows-gnu
petrochenkov Nov 16, 2020
78a37f8
add optimization fuel checks to some mir passes
cjkenn Nov 16, 2020
2a5a379
Add two regression tests
Alexendoo Nov 16, 2020
b4c9424
update ui test for increased fuel usage
cjkenn Nov 17, 2020
92aa0e6
Use `span_suggestion_verbose` instead of `span_suggestion` for `fn` w…
ThePuzzlemaker Nov 15, 2020
b8ed466
Fix ui tests for `fn`s with qualifiers in `extern` blocks
ThePuzzlemaker Nov 15, 2020
c825c74
Move change to check_fn, fix up overloaded-calls-nontuple
CraftSpider Nov 17, 2020
e8426a6
Remove unnecessary abi import
CraftSpider Nov 17, 2020
614a748
Highlight MIR as Rust on GitHub
camelid Nov 17, 2020
7faebe5
Move capture lowering from THIR to MIR
arora-aman Nov 17, 2020
9f70e78
Remove THIR::ExprKind::SelfRef
arora-aman Nov 17, 2020
36972b0
fix handling the default config for profiler and sanitizers
12101111 Nov 18, 2020
5163912
Allow using `download-ci-llvm` from directories other than the root
jyn514 Nov 18, 2020
efcbf1b
Permit standalone generic parameters as const generic arguments in ma…
varkor Nov 18, 2020
85bc953
Add tests for multi-segment paths in const generic arguments
varkor Nov 18, 2020
51c2218
move fuel checks to later points in instcombine and const_prop, add o…
cjkenn Nov 18, 2020
1e524fb
change print-fuel ui test to check-pass
cjkenn Nov 18, 2020
2098ade
Remove redundant notes in E0275
estebank Nov 16, 2020
3527964
Account for indirect cyclic requirements
estebank Nov 18, 2020
c12e77b
review comment
estebank Nov 18, 2020
b556690
move checks later into optimization passes
cjkenn Nov 19, 2020
1d3305a
remove check from const promotion
cjkenn Nov 19, 2020
07de702
update print fuel test output again...
cjkenn Nov 19, 2020
5a58b50
Rollup merge of #78961 - CraftSpider:22565, r=oli-obk
Dylan-DPC Nov 19, 2020
3f0f224
Rollup merge of #79082 - ThePuzzlemaker:issue-78941-fix, r=estebank
Dylan-DPC Nov 19, 2020
29c8e50
Rollup merge of #79090 - hermitcore:builtins, r=Mark-Simulacrum
Dylan-DPC Nov 19, 2020
552d8c5
Rollup merge of #79094 - est31:ignore_macos, r=pietroalbini
Dylan-DPC Nov 19, 2020
05ff58e
Rollup merge of #79101 - tmiasko:lower-func-type, r=jonas-schievink
Dylan-DPC Nov 19, 2020
6010f7b
Rollup merge of #79102 - Alexendoo:ice-regression-tests, r=Mark-Simul…
Dylan-DPC Nov 19, 2020
470f768
Rollup merge of #79110 - estebank:issue-58964, r=oli-obk
Dylan-DPC Nov 19, 2020
04a4404
Rollup merge of #79116 - petrochenkov:gdbwarn, r=Mark-Simulacrum
Dylan-DPC Nov 19, 2020
2fdcd24
Rollup merge of #79117 - cjkenn:mir-fuel, r=oli-obk
Dylan-DPC Nov 19, 2020
62838c6
Rollup merge of #79147 - camelid:mir-gitattributes, r=oli-obk
Dylan-DPC Nov 19, 2020
5c7d530
Rollup merge of #79149 - sexxi-goose:upvar_ref, r=nikomatsakis
Dylan-DPC Nov 19, 2020
3b857a5
Rollup merge of #79155 - 12101111:fix-profiler-config, r=Mark-Simulacrum
Dylan-DPC Nov 19, 2020
de62272
Rollup merge of #79156 - jyn514:relative-llvm, r=Mark-Simulacrum
Dylan-DPC Nov 19, 2020
b5fffdc
Rollup merge of #79164 - varkor:unbraced-single-segment-const-argumen…
Dylan-DPC Nov 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions compiler/rustc_mir/src/transform/lower_intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ pub struct LowerIntrinsics;

impl<'tcx> MirPass<'tcx> for LowerIntrinsics {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
for block in body.basic_blocks_mut() {
let (basic_blocks, local_decls) = body.basic_blocks_and_local_decls_mut();
for block in basic_blocks {
let terminator = block.terminator.as_mut().unwrap();
if let TerminatorKind::Call {
func: Operand::Constant(box Constant { literal: ty::Const { ty: func_ty, .. }, .. }),
args,
destination,
..
} = &mut terminator.kind
{
if let TerminatorKind::Call { func, args, destination, .. } = &mut terminator.kind {
let func_ty = func.ty(local_decls, tcx);
let (intrinsic_name, substs) = match resolve_rust_intrinsic(tcx, func_ty) {
None => continue,
Some(it) => it,
Expand Down
31 changes: 31 additions & 0 deletions src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- // MIR for `non_const` before LowerIntrinsics
+ // 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
scope 1 {
debug size_of_t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:57:9: 57: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
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:57:21: 57: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
}

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
}
}

7 changes: 7 additions & 0 deletions src/test/mir-opt/lower_intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@ pub fn f_zst<T>(t: T) {

#[inline(never)]
pub fn f_non_zst<T>(t: T) {}

// EMIT_MIR lower_intrinsics.non_const.LowerIntrinsics.diff
pub fn non_const<T>() -> usize {
// Check that lowering works with non-const operand as a func.
let size_of_t = core::intrinsics::size_of::<T>;
size_of_t()
}