update to rustc 1.98 - #612
Conversation
92c6cd5 to
442f98b
Compare
442f98b to
0e0dc17
Compare
|
Going from working The only two PRs that change anything in rustc_codegen_ssa in that range are:
UPDATE: We can fix the compiletests by just removing this flag: - "-Cdebuginfo=2",This flag is responsible for controlling debug symbol emission, 2 means all the debug symbols and it defaults to 0 (I think) meaning none. How the hell does turning on debug symbol emission cause fundamental compilation errors?
fn create_function_debug_context(
&self,
_instance: Instance<'tcx>,
_fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
_llfn: Self::Function,
_mir: &mir::Body<'tcx>,
) -> Option<FunctionDebugContext<'tcx, Self::DIScope, Self::DILocation>> {
// TODO: This is ignored. Do we want to implement this at some point?
None
}
I beliebe the fix I made here is only a temporary fix, I suspect any debug build of sufficient complexity will fail. Don't yet know what to do about that. |
f9b1b4c to
a6bf7bf
Compare
|
Instead of opting out compiletests from debug info, I decided to just patch out the newest changes to debuginfo emission |
|
I really with |
a6bf7bf to
a1b8a94
Compare
a1b8a94 to
1a5281a
Compare
FractalFir
left a comment
There was a problem hiding this comment.
Made a quick pass, found some suspicious things here and there.
| } | ||
|
|
||
| fn volatile_load(&mut self, ty: Self::Type, ptr: Self::Value) -> Self::Value { | ||
| fn volatile_load(&mut self, ty: Self::Type, ptr: Self::Value, _align: Align) -> Self::Value { |
There was a problem hiding this comment.
Seems problematic to ignore Align like this - how about checking that default_align is equal to this Align, or, better yet - use this align instead of b.primitive().default_align(self).abi?
There was a problem hiding this comment.
To be completely honest, I have no idea what this function is even supposed to do. Sure you can probably find some unsafe rust code that reaches it, but like what it's supposed to do from the shader codegen perspective.
This is sadly the case with quite a bit of code in rustc_codegen_spirv, where I highly suspect it's effectively unreachable for any sane shader, there is no compiletest that reaches that code, so I really don't know what it's really supposed to do.
| let layout = self.layout_of(fn_args.type_at(0)); | ||
| let load = self.volatile_load(layout.spirv_type(self.span(), self), ptr); | ||
| let load = | ||
| self.volatile_load(layout.spirv_type(self.span(), self), ptr, Align::ONE); |
There was a problem hiding this comment.
Align::ONE? The argument is seemingly ignored for now, but this is an issue for the future, when it will not. You already got the layout - why not just get the align from there?
|
|
||
| // HACK(firestar99): Undo code cleanup that prevents passing ScalarPairs as `PassMode::Direct` | ||
| // https://github.com/rust-lang/rust/commit/dfc475d018c780475ea962f15d86cfa05a50a148 | ||
| if relative_path == Path::new("src/mir/mod.rs") { |
There was a problem hiding this comment.
Unrelated to the main changes, but this is a kind of silly way to do patches. It can silently fail when things change around: replace does not assert the OG source contains the lines we want to replace, and fails silently if it does not. It might be worth it to add a helper like this:
fn apply_patch(src:&str, og:&str, new:&str)->String{
assert!(src.contains(og), "ppg_cg_ssa patch does not apply!");
src.replace(og,new)
}Would make the failure mode louder, and easier to debug.
There was a problem hiding this comment.
I've thought about replacing it with a directory of *.patch files before. In fact I tripped up on a replace failing due to upstream changes and it not causing a compilation error but simply a behavior change. Luckily, I added that regex just a month ago so I knew what failed.
Requires #610
Note
This is a nightly as close to rustc 1.98 as we can get
Notable changes:
ScalarPairsare passed byPassMode::ScalarPairexclusively. But rust-gpu readjusts the fn abi here to pass any non-sliceScalarPairasPassMode::Direct. Removing this ABI change breaks a bunch of code in all kinds of weird ways, primarilyByteAddressableBufferintrinsics andpanic!()format args decompiler complaining about function pointers and pointer casts. It's just that rust-gpu can't properly handlePassMode::ScalarPairin so many places... So we'll keep our abi adjustments and I just undo that upstream cleanup.close #605