Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor call & function handling in trans, enable MIR bootstrap. #32080

Merged
merged 77 commits into from Mar 18, 2016

Conversation

Projects
None yet
7 participants
@eddyb
Copy link
Member

eddyb commented Mar 6, 2016

Non-Rust and Rust ABIs were combined into a common codepath, which means:

  • The ugly __rust_abi "clown shoes" shim for C->Rust FFI is gone, fixes #10116.
  • Methods, including virtual ones support non-Rust ABIs, closes #30235.
  • Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical.
  • Zero-sized types are never passed as arguments; again, behavior shouldn't change.

Additionally, MIR support for calling intrinsics (through old trans) was implemented.
Alongside assorted fixes, it enabled MIR to launch 🚀 and do a complete bootstrap.
To try it yourself, ./configure --enable-orbit or make RUSTFLAGS="-Z orbit".

@eddyb eddyb force-pushed the eddyb:transcendent branch from 2fbb50c to 90130dc Mar 6, 2016

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 6, 2016

r? @nikomatsakis

(just making sure an assignment is given, feel free to delegate elsewhere)

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 8, 2016

☔️ The latest upstream changes (presumably #31606) made this pull request unmergeable. Please resolve the merge conflicts.

@eddyb

This comment has been minimized.

Copy link
Member Author

eddyb commented Mar 9, 2016

Status: I can build snap-stage3 with MIR forced on for everything.
These are the common run-pass failures for stage1 and stage2:
(that means they are likely MIR trans bugs and not due to miscompiled rustc)

failures:
    [run-pass] run-pass/allocator-override.rs
    [run-pass] run-pass/asm-in-out-operand.rs
    [run-pass] run-pass/asm-indirect-memory.rs
    [run-pass] run-pass/asm-out-assign.rs
    [run-pass] run-pass/associated-const-type-parameters.rs
    [run-pass] run-pass/backtrace-debuginfo.rs
    [run-pass] run-pass/const-str-ptr.rs
    [run-pass] run-pass/ignore-all-the-things.rs
    [run-pass] run-pass/int-abs-overflow.rs
    [run-pass] run-pass/issue-14936.rs
    [run-pass] run-pass/issue-15080.rs
    [run-pass] run-pass/issue-15104.rs
    [run-pass] run-pass/issue-23338-ensure-param-drop-order.rs
    [run-pass] run-pass/issue-7784.rs
    [run-pass] run-pass/issue-8460.rs
    [run-pass] run-pass/issue-8860.rs
    [run-pass] run-pass/match-vec-alternatives.rs
    [run-pass] run-pass/mir_raw_fat_ptr.rs
    [run-pass] run-pass/num-wrapping.rs
    [run-pass] run-pass/out-of-stack.rs
    [run-pass] run-pass/simd-intrinsic-generic-cast.rs
    [run-pass] run-pass/simd-intrinsic-generic-elements.rs
    [run-pass] run-pass/super-fast-paren-parsing.rs
    [run-pass] run-pass/vec-matching-fixed.rs
    [run-pass] run-pass/vec-matching-fold.rs
    [run-pass] run-pass/vec-matching-legal-tail-element-borrow.rs
    [run-pass] run-pass/vec-matching.rs
    [run-pass] run-pass/vec-tail-matching.rs
    [run-pass] run-pass/zero-size-type-destructors.rs

The only run-pass test that only fails in stage2 is run-pass/super-fast-paren-parsing.rs, which ends up in a stack overflow in rustc (@arielb1 was talking about needing llvm lifetime intrinsics to prevent this, I think).

@rust-lang/tools If I provide a flag to enable MIR trans for everything, and an attribute to mark functions which can't be yet properly translated via MIR, would it be possible to have buildbot ensure MIR doesn't regress?

@eddyb eddyb force-pushed the eddyb:transcendent branch from b7e69e9 to 40f3bc9 Mar 9, 2016

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 9, 2016

‼️ 😲

@eddyb eddyb force-pushed the eddyb:transcendent branch 2 times, most recently from 934c483 to 5024b6d Mar 9, 2016

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 9, 2016

@eddyb I'd be fine at least adding a MIR bot! If it's a ./configure switch just lemme know and I can set up something like auto-linux-64-opt-mir or something like that.

Do you think MIR will want platform coverage as well? A Linux/OSX/Windows builder, or just one with it enabled?

@eddyb eddyb force-pushed the eddyb:transcendent branch from 5024b6d to c8ba80b Mar 9, 2016

@eddyb

This comment has been minimized.

Copy link
Member Author

eddyb commented Mar 9, 2016

@alexcrichton Before the next snapshot, make RUSTFLAGS_STAGE1="-Z orbit" RUSTFLAGS_STAGE2=-"Z orbit", after that just make RUSTFLAGS="-Z orbit".

Sadly, it doesn't look like tests inherit RUSTFLAGS_STAGEn, just RUSTFLAGS, so we might need a snapshot anyway.

We'll want at least a non-MSVC and a MSVC builder, because of the differences in how unwinding works there.

@eddyb eddyb changed the title [WIP] Refactor how calls and functions are handled across trans. [WIP] Refactor call & function handling in trans, enable MIR bootstrap. Mar 9, 2016

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 9, 2016

Ok, sounds like a linux + MSVC builder, and can you add this as a ./configure option? That'll be easiest to add to our build matrix.

@eddyb eddyb force-pushed the eddyb:transcendent branch from c8ba80b to 23b378d Mar 9, 2016

@eddyb

This comment has been minimized.

Copy link
Member Author

eddyb commented Mar 9, 2016

@alexcrichton Does that last commit look good?

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 9, 2016

Looks good to me!

@eddyb eddyb force-pushed the eddyb:transcendent branch from 7d5f75a to afcafe6 Mar 9, 2016

@eddyb

This comment has been minimized.

Copy link
Member Author

eddyb commented Mar 10, 2016

Down to 9 run-pass MIR failures:

    [run-pass] run-pass/backtrace-debuginfo.rs
    [run-pass] run-pass/const-str-ptr.rs
    [run-pass] run-pass/int-abs-overflow.rs
    [run-pass] run-pass/issue-23338-ensure-param-drop-order.rs
    [run-pass] run-pass/issue-8460.rs
    [run-pass] run-pass/issue-8860.rs
    [run-pass] run-pass/mir_raw_fat_ptr.rs
    [run-pass] run-pass/simd-intrinsic-generic-elements.rs
    [run-pass] run-pass/zero-size-type-destructors.rs

I'll just start tagging them with #[rustc_no_mir], this PR is getting kind of long...

@eddyb eddyb changed the title [WIP] Refactor call & function handling in trans, enable MIR bootstrap. Refactor call & function handling in trans, enable MIR bootstrap. Mar 10, 2016

@eddyb eddyb force-pushed the eddyb:transcendent branch 6 times, most recently from 76a4fa2 to 0c413a8 Mar 10, 2016

@eddyb eddyb force-pushed the eddyb:transcendent branch from 099445b to e177207 Mar 18, 2016

@eddyb

This comment has been minimized.

Copy link
Member Author

eddyb commented Mar 18, 2016

@bors r=nikomatsakis force

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 18, 2016

📌 Commit e177207 has been approved by nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 18, 2016

⌛️ Testing commit e177207 with merge 3c572b6...

bors added a commit that referenced this pull request Mar 18, 2016

Auto merge of #32080 - eddyb:transcendent, r=nikomatsakis
Refactor call & function handling in trans, enable MIR bootstrap.

Non-Rust and Rust ABIs were combined into a common codepath, which means:
* The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116.
* Methods, *including virtual ones* support non-Rust ABIs, closes #30235.
* Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical.
* Zero-sized types are never passed as arguments; again, behavior shouldn't change.

Additionally, MIR support for calling intrinsics (through old trans) was implemented.
Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap.
To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 18, 2016

💔 Test failed - auto-win-gnu-64-opt

@eddyb

This comment has been minimized.

Copy link
Member Author

eddyb commented Mar 18, 2016

@bors r=nikomatsakis force

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 18, 2016

📌 Commit b12dcde has been approved by nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 18, 2016

⌛️ Testing commit b12dcde with merge 235d774...

bors added a commit that referenced this pull request Mar 18, 2016

Auto merge of #32080 - eddyb:transcendent, r=nikomatsakis
Refactor call & function handling in trans, enable MIR bootstrap.

Non-Rust and Rust ABIs were combined into a common codepath, which means:
* The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116.
* Methods, *including virtual ones* support non-Rust ABIs, closes #30235.
* Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical.
* Zero-sized types are never passed as arguments; again, behavior shouldn't change.

Additionally, MIR support for calling intrinsics (through old trans) was implemented.
Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap.
To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.

@bors bors merged commit b12dcde into rust-lang:master Mar 18, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@eddyb eddyb deleted the eddyb:transcendent branch Mar 18, 2016

@jonas-schievink

This comment has been minimized.

Copy link
Member

jonas-schievink commented Mar 18, 2016

:shipit:


It's doing strictly more work, AFAICT, because we emit more IR (not sure exactly why yet).

Pretty impressive that translation still ends up being faster!

bors added a commit that referenced this pull request Mar 20, 2016

Auto merge of #32345 - eddyb:snap-to-orbit, r=alexcrichton
Update snapshots to 2016-03-18 (235d774).

The new snapshots notably include @nikomatsakis' #32164 fix for the regionck error spew.
Also, `./configure --enable-orbit` *and/or* `make RUSTFLAGS="-Z orbit"` should work now (#32080).

bors added a commit that referenced this pull request Apr 2, 2016

Auto merge of #32210 - Aatch:mir-traversal, r=nikomatsakis
rBreak Critical Edges and other MIR work

This PR is built on top of #32080.

This adds the basic depth-first traversals for MIR, preorder, postorder and reverse postorder. The MIR blocks are now translated using reverse postorder. There is also a transform for breaking critical edges, which includes the edges from `invoke`d calls (`Drop` and `Call`), to account for the fact that we can't add code after an `invoke`. It also stops generating the intermediate block (since the transform essentially does it if necessary already).

The kinds of cases this deals with are difficult to produce, so the test is the one I managed to get. However, it seems to bootstrap with `-Z orbit`, which it didn't before my changes.

bors added a commit that referenced this pull request Apr 3, 2016

Auto merge of #32210 - Aatch:mir-traversal, r=nikomatsakis
rBreak Critical Edges and other MIR work

This PR is built on top of #32080.

This adds the basic depth-first traversals for MIR, preorder, postorder and reverse postorder. The MIR blocks are now translated using reverse postorder. There is also a transform for breaking critical edges, which includes the edges from `invoke`d calls (`Drop` and `Call`), to account for the fact that we can't add code after an `invoke`. It also stops generating the intermediate block (since the transform essentially does it if necessary already).

The kinds of cases this deals with are difficult to produce, so the test is the one I managed to get. However, it seems to bootstrap with `-Z orbit`, which it didn't before my changes.

bors added a commit that referenced this pull request Apr 3, 2016

Auto merge of #32210 - Aatch:mir-traversal, r=nikomatsakis
rBreak Critical Edges and other MIR work

This PR is built on top of #32080.

This adds the basic depth-first traversals for MIR, preorder, postorder and reverse postorder. The MIR blocks are now translated using reverse postorder. There is also a transform for breaking critical edges, which includes the edges from `invoke`d calls (`Drop` and `Call`), to account for the fact that we can't add code after an `invoke`. It also stops generating the intermediate block (since the transform essentially does it if necessary already).

The kinds of cases this deals with are difficult to produce, so the test is the one I managed to get. However, it seems to bootstrap with `-Z orbit`, which it didn't before my changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.