-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
|
||
/// Projection -> Pack | ||
impl<'tcx, T> ToPack<ykpack::Projection<Box<ykpack::Place>, ykpack::LocalIndex>> | ||
for (&ConvCx<'_, 'tcx, '_>, &Projection<'tcx, Place<'tcx>, Local, T>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are taking a parameterised MIR Projection
and from it making a parameterised TIR projection. I'd like to make the TIR projection concrete, especially since the MIR counterpart is only every constructed under one guise. The upstream PR suggests making the MIR struct concrete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
src/librustc_yk_sections/Cargo.toml
Outdated
@@ -13,6 +13,7 @@ test = false | |||
[dependencies] | |||
rustc = { path = "../librustc" } | |||
rustc_yk_link = { path = "../librustc_yk_link" } | |||
ykpack = { git = "https://github.com/softdevteam/yk" } | |||
#ykpack = { git = "https://github.com/softdevteam/yk" } | |||
ykpack = { path = "../../../yk/ykpack" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As usual, we mustn't forget to back this hunk out.
This is a companion commit to: softdevteam/ykrustc#18
src/librustc_yk_sections/emit_tir.rs
Outdated
@@ -10,14 +9,17 @@ | |||
//! This module converts MIR into Yorick TIR (Tracing IR). | |||
//! Note that we preserve the MIR block structure when lowering to TIR. | |||
//! | |||
//! Note also that TIR is currently untyped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is worth stating: TIR is many things (and isn't many other things), and that'll be in flux for a while. This particular property seems to me only one of many.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. TBH I don't think we will get far without types anyway.
@@ -264,6 +267,8 @@ impl<'tcx> ToPack<ykpack::Terminator> for (&ConvCx<'_, 'tcx, '_>, &Terminator<'t | |||
unwind_bb: unwind_bb.map(|bb| u32::from(bb)), | |||
}, | |||
TerminatorKind::Call{ref func, cleanup: cleanup_bb, ref destination, .. } => { | |||
// In MIR, a call instruction accepts an arbitrary operand, but in TIR we special |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this (I'm not saying it's badly phrased... I just don't understand it!).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In mir they have Call(Operand)
where Operand
is really general. It can express things which I don't think you can even call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see.
match *op { | ||
Operand::Move(place) | Operand::Copy(place) | ||
=> ykpack::Operand::Place((*ccx, place).to_pack()), | ||
_ => ykpack::Operand::Unimplemented, // FIXME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad formatting. Also I think we should make this unimplemeted
shouldn't we? Or will that stop nearly every program from compiling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to crash, I just want to see an unimplemented
node in my CFG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I have a tool for drawing the cfg from a serialised pack)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WRT to formatting, how would you have done it? The second line is a continuation of the first, hence the indent. Joining the lines upsets the tidy check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Ignore me.
src/librustc_yk_sections/emit_tir.rs
Outdated
ykpack::Statement::Unimplemented(ykpack::UnimplementedStatement::Retag), | ||
// Type ascription. | ||
// https://github.com/rust-lang/rfcs/pull/803 | ||
StatementKind::AscribeUserType(..) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! They can map to our Nop
instruction then!
I think this is ready for re-review. The ykpack change should go in first, then we should flip the dependency back before merging this. |
Please squash. |
This is a companion commit to: softdevteam/ykrustc#18
Squashed. Once the ykpack change is merged, we can flip the dependency, squash again, and then r+. |
I suggest squashing the dependency in now so that I can merge these even if you're not available when I am. [Given how long ykrustc takes to build, it can only be a good thing!] |
How much is rustc itself patched? If you only patched the codegen backend, you may compile the codegen backend separately and then use |
@bjorn3 I'll look into it, but we've made some pretty invasive changes. |
I can do it now, but we'll still need another commit. We need the post-merge commit ID to silence the tidy checker. All non-crates.io deps need to be listed in a whitelist with an exact commit ID :( This is why I was holding off. |
3: Implement more TIR data structures. r=ltratt a=vext01 This is a companion commit to: softdevteam/ykrustc#18 Co-authored-by: Edd Barrett <[email protected]>
This is a companion commit to: softdevteam/ykrustc#18
3: Implement more TIR data structures. r=ltratt a=vext01 This is a companion commit to: softdevteam/ykrustc#18 Co-authored-by: Edd Barrett <[email protected]>
820b008 make the necessary dependency adjustments. OK to squash? (Not sure why GH is displaying things in the order it is...) |
Please squash. |
splat |
bors r+ |
18: Implement more TIR lowerings. r=ltratt a=vext01 This is a whole load more TIR lowerings. The TIR graphs are starting to look more complete, although there's still a lot more to do. I only stopped here because the changes are getting large, and more edits can come in later PRs. There's one part of this code (which I will point out), which i'm likely to change. It involves a type-parameterised MIR struct, which I think ultimately we will make concrete in TIR. However, I want to see the outcome of this upstream PR first: rust-lang/rust#60441 There's a ykpack change to accompany this: ykjit/yk#3 Co-authored-by: Edd Barrett <[email protected]>
Build failed |
My bad. Although I remembered to fix the ykpack tests, I forgot the test in ykrustc. OK to squash? |
Please squash. |
splat |
bors r+ |
18: Implement more TIR lowerings. r=ltratt a=vext01 This is a whole load more TIR lowerings. The TIR graphs are starting to look more complete, although there's still a lot more to do. I only stopped here because the changes are getting large, and more edits can come in later PRs. There's one part of this code (which I will point out), which i'm likely to change. It involves a type-parameterised MIR struct, which I think ultimately we will make concrete in TIR. However, I want to see the outcome of this upstream PR first: rust-lang/rust#60441 There's a ykpack change to accompany this: ykjit/yk#3 Co-authored-by: Edd Barrett <[email protected]>
Build succeeded |
simplify is_vxworks_pure_dynamic()
This is a combination of 18 commits. Commit softdevteam#2: Additional examples and some small improvements. Commit softdevteam#3: fixed mir-opt non-mir extensions and spanview title elements Corrected a fairly recent assumption in runtest.rs that all MIR dump files end in .mir. (It was appending .mir to the graphviz .dot and spanview .html file names when generating blessed output files. That also left outdated files in the baseline alongside the files with the incorrect names, which I've now removed.) Updated spanview HTML title elements to match their content, replacing a hardcoded and incorrect name that was left in accidentally when originally submitted. Commit softdevteam#4: added more test examples also improved Makefiles with support for non-zero exit status and to force validation of tests unless a specific test overrides it with a specific comment. Commit softdevteam#5: Fixed rare issues after testing on real-world crate Commit softdevteam#6: Addressed PR feedback, and removed temporary -Zexperimental-coverage -Zinstrument-coverage once again supports the latest capabilities of LLVM instrprof coverage instrumentation. Also fixed a bug in spanview. Commit softdevteam#7: Fix closure handling, add tests for closures and inner items And cleaned up other tests for consistency, and to make it more clear where spans start/end by breaking up lines. Commit softdevteam#8: renamed "typical" test results "expected" Now that the `llvm-cov show` tests are improved to normally expect matching actuals, and to allow individual tests to override that expectation. Commit softdevteam#9: test coverage of inline generic struct function Commit softdevteam#10: Addressed review feedback * Removed unnecessary Unreachable filter. * Replaced a match wildcard with remining variants. * Added more comments to help clarify the role of successors() in the CFG traversal Commit softdevteam#11: refactoring based on feedback * refactored `fn coverage_spans()`. * changed the way I expand an empty coverage span to improve performance * fixed a typo that I had accidently left in, in visit.rs Commit softdevteam#12: Optimized use of SourceMap and SourceFile Commit softdevteam#13: Fixed a regression, and synched with upstream Some generated test file names changed due to some new change upstream. Commit softdevteam#14: Stripping out crate disambiguators from demangled names These can vary depending on the test platform. Commit softdevteam#15: Ignore llvm-cov show diff on test with generics, expand IO error message Tests with generics produce llvm-cov show results with demangled names that can include an unstable "crate disambiguator" (hex value). The value changes when run in the Rust CI Windows environment. I added a sed filter to strip them out (in a prior commit), but sed also appears to fail in the same environment. Until I can figure out a workaround, I'm just going to ignore this specific test result. I added a FIXME to follow up later, but it's not that critical. I also saw an error with Windows GNU, but the IO error did not specify a path for the directory or file that triggered the error. I updated the error messages to provide more info for next, time but also noticed some other tests with similar steps did not fail. Looks spurious. Commit softdevteam#16: Modify rust-demangler to strip disambiguators by default Commit softdevteam#17: Remove std::process::exit from coverage tests Due to Issue #77553, programs that call std::process::exit() do not generate coverage results on Windows MSVC. Commit softdevteam#18: fix: test file paths exceeding Windows max path len
This is a whole load more TIR lowerings. The TIR graphs are starting to look more complete, although there's still a lot more to do. I only stopped here because the changes are getting large, and more edits can come in later PRs.
There's one part of this code (which I will point out), which i'm likely to change. It involves a type-parameterised MIR struct, which I think ultimately we will make concrete in TIR. However, I want to see the outcome of this upstream PR first:
rust-lang/rust#60441
There's a ykpack change to accompany this:
ykjit/yk#3