Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd MIR Validate statement #43403
Conversation
rust-highfive
assigned
pnkfelix
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
|
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
RalfJung
referenced this pull request
Jul 22, 2017
Merged
Split up miri into the librustc_mir and bin parts #268
This comment has been minimized.
This comment has been minimized.
|
Tidy fails due to lines longer than 100 chars |
This comment has been minimized.
This comment has been minimized.
|
Yeah I find it very hard to follow that requirement. Always feel like I have to make my code ugly to comply. Seems like I missed some places. :/ |
RalfJung
force-pushed the
RalfJung:mir-validate
branch
from
6f07af4
to
a922bd3
Jul 22, 2017
carols10cents
added
the
S-waiting-on-review
label
Jul 24, 2017
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
nikomatsakis
and unassigned
pnkfelix
Jul 25, 2017
This comment has been minimized.
This comment has been minimized.
|
Ideally I'd like to run AddValidation before ElaborateDrops and after EraseRegions. For this to work, I need to move ElaborateDrops up, but RalfJung@3eb4141 fails badly -- many tests now report "Broken MIR: moving out of lvalue". @arielb1 I suppose just naively moving the pass around doesn't work.^^ Anything else I should try? EDIT: Also I wasn't sure about the comments saying what cannot be done starting where. Those are probably wrong in my patch. |
RalfJung
force-pushed the
RalfJung:mir-validate
branch
from
beb35ff
to
f96f373
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
|
With some more help from @arielb1 I managed to reorder the passes without breaking everything (well, the test suite still passes). They also advised me to change |
This comment has been minimized.
This comment has been minimized.
|
This relies on #43512, which however is already r+'ed so it should land soon-ish. |
RalfJung
force-pushed the
RalfJung:mir-validate
branch
2 times, most recently
from
5a26f2c
to
95105af
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
|
|
RalfJung
force-pushed the
RalfJung:mir-validate
branch
from
95105af
to
958dee8
Jul 28, 2017
This comment has been minimized.
This comment has been minimized.
|
I rebased to resolve the merge conflict. |
RalfJung
added some commits
Jul 11, 2017
RalfJung
force-pushed the
RalfJung:mir-validate
branch
from
9678d2f
to
584d823
Aug 1, 2017
This comment has been minimized.
This comment has been minimized.
|
Still failing to build libstd with the flag turned on:
I am at loss here. Struct ctors are functions that have their own MIR...? |
This comment has been minimized.
This comment has been minimized.
Yes they are. The MIR is created by https://github.com/rust-lang/rust/blob/master/src/librustc_mir/shim.rs |
This comment has been minimized.
This comment has been minimized.
|
I see. I fixed the code to handle that, but now I get
I suppose defaulted trait methods are yet another category that needs separate handling. |
This comment has been minimized.
This comment has been minimized.
|
Okay, now I am seeing really strange behavior... I thought by returning
I also just realized that closures in an unsafe fn probably can use unsafe features as well, so I will have to extend my scan into the closure environment accordingly. |
RalfJung
added some commits
Aug 1, 2017
This comment has been minimized.
This comment has been minimized.
|
Okay, it seems to all work now. This is ready to be merged from my side. I hope I got all this HIR code right. I would really like to test whether closures are correctly detected to be unsafe, but unfortunately, mir-opt tests are not suited for this: Closures contain the filename in their type and name, which shows up in the lines we would like to test for. |
This comment has been minimized.
This comment has been minimized.
|
Ah dang it, I got another ICE in miri's test suite...
|
This comment has been minimized.
This comment has been minimized.
|
Fixed that as well (thanks @eddyb) |
nikomatsakis
approved these changes
Aug 2, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks :) So, what has to happen now to get r+? |
RalfJung
referenced this pull request
Aug 3, 2017
Closed
mir-opt tests: add ability to match lines that contain the filename #43621
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 4, 2017
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 7d8dc7a
into
rust-lang:master
Aug 4, 2017
This comment has been minimized.
This comment has been minimized.
|
It looks like this PR regressed a number of benchmarks 5-7% on perf.rust-lang.org, @RalfJung do you know if this could perhaps cause a performance impact when not enabled? |
This comment has been minimized.
This comment has been minimized.
|
A more clear way to see this regression is perhaps here |
This comment has been minimized.
This comment has been minimized.
|
Is this compile tune or run time? I guess compile time, but it's not entirely clear to me. That is strange, the new pass does nothing when not enabled. There is a slight chance that more @arielb1 could reordering the passes have a bad effect on performance? |
This comment has been minimized.
This comment has been minimized.
|
@RalfJung Compile time. In particular it seems to be the LLVM pass that takes longer time. Trans time is also increasing but the contribution to increased total time is small. |
alexcrichton
referenced this pull request
Aug 12, 2017
Closed
8% regression in syntex_syntax compile time #43827
This comment has been minimized.
This comment has been minimized.
|
Ok I'll open a dedicated issue for this in that case! |
RalfJung commentedJul 22, 2017
This adds statements to MIR that express when types are to be validated (following Types as Contracts). Obviously nothing is stabilized, and in fact a
-Zflag has to be passed for behavior to even change at all.This is meant to make experimentation with Types as Contracts in miri possible. The design is definitely not final.
Cc @nikomatsakis @aturon