Fix #5987: make rustc generate *only* IR output in generateIR #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All compilations are run asynchronously under
await Promise.all
inBaseCompiler.doCompilation
:https://github.com/compiler-explorer/compiler-explorer/blob/f3277b8aed2ca12ce961d08ef792c4061a3331ac/lib/base-compiler.ts#L2256-L2261
ASM and MIR processing is done from the main
runCompiler
and IR from the auxiliarygenerateIR
. But both compilation calls are passed the sameoptions
- which include--emit asm
for generation ofoutput.s
assembly file and--emit mir=...
for generation of MIR file. So these 2 identically-named file pairs are generated and cleaned up in both of the parallel compilations, sometimes one compilation cleans up its output before the other one tries to process its own, and mayhem ensues.This PR makes rust's
generateIR
indeed generate just IR by filtering switches.From a design perspective: ideally CE would be more opinionated on which outputs are generated on the main compilation and which on auxiliary ones. I see no reason for MIR to be generated by an additional switch on the main compilation and IR require a different compilation (there's also something called
generateRustHir
- I don't know what it does and am slightly afraid to ask).I think most (all?) asm/IR outputs could be generated in a single main compilation, and just post-processed for the different panes in parallel - which could spell very good news also for servers load. But I don't dare say anything categorical about all languages, compilers and output (probably no one does). Would be happy to hear opinions.
(Anyway that's just for sake of discussion, this PR does nothing fancy of that sort)