-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Batch Mode] Pass PrimarySpecificPaths through compiler. (4) #14230
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
[Batch Mode] Pass PrimarySpecificPaths through compiler. (4) #14230
Conversation
Please test with the following PR: @swift-ci Please smoke test os x platform |
Please test with the following PR: @swift-ci Please smoke test os x platform |
[Batch Mode] WIP: Pass PrimarySpecificPaths to createEmptyModule and IRGenModule() #290 |
Please test with the following PR: @swift-ci Please smoke test linux platform |
Please test with the following PR: @swift-ci Please smoke test os x platform |
2 similar comments
Please test with the following PR: @swift-ci Please smoke test os x platform |
Please test with the following PR: @swift-ci Please smoke test os x platform |
1e4cdbb
to
b3e8ed2
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
b3e8ed2
to
07914b2
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
07914b2
to
1850e88
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
1850e88
to
11e6dd2
Compare
e8dd1eb
to
8c1e064
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
8c1e064
to
c633e32
Compare
Please test with the following PR: |
Please test with the following PR: @swift-ci Please smoke test os x platform |
c633e32
to
a49aa03
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
a49aa03
to
8934888
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
8934888
to
aeef46d
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
aeef46d
to
7ced740
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
After more thought, I decided it was appropriate to use the supplemental outputs for only the first parallel-genererated input. |
Get rid of IRGenOpts attributes that won’t work for batch mode and also remove fakeNamesStub.
1d30537
to
dec7890
Compare
Please test with the following PR: @swift-ci Please smoke test |
@jrose-apple At this point, I think all issues have been addressed. Will see if it passes the tests. |
I'm not sure I like this. Which input is first is essentially arbitrary, and whatever output we would get from such a thing wouldn't have all the data. I'd really rather not pretend we can handle this when we can't. @eeckstein, thoughts? We're talking about if IRGen were to have outputs in addition to its main output, like if it could output a .ll file but still go on to output a .o. In the case of parallel WMO, we've set everything else up so that there's only one of each supplemental output for the whole process, but that breaks down once we hit IRGen. |
Fair point. I'll look at NOT passing a PrimarySpecificPaths into the IRGenModule constructor. If it doesn't emit any supplementaries, then it should only receive an output filename, and a main input filename (for debug info). |
Please test with the following PR: @swift-ci Please smoke test |
4b247d7
to
abe1f18
Compare
@jrose-apple OK, this version should be cleaner. (Thanks for your patience.) Since IRGenModule does nothing with the supplementaries, I think it may make sense to not pass in supplementary output names at all to its constructor. I've also tried to reformat in the latest version to minimize the diffs. |
Please test with the following PR: @swift-ci Please smoke test |
abe1f18
to
9fd7f0a
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
9fd7f0a
to
8262e12
Compare
Please test with the following PR: @swift-ci Please smoke test os x platform |
1 similar comment
Please test with the following PR: @swift-ci Please smoke test os x platform |
Please test with the following PR: @swift-ci Please clean smoke test os x platform |
2 similar comments
Please test with the following PR: @swift-ci Please clean smoke test os x platform |
Please test with the following PR: @swift-ci Please clean smoke test os x platform |
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 think this is it!
tools/sil-opt/SILOpt.cpp
Outdated
@@ -426,8 +426,10 @@ int main(int argc, char **argv) { | |||
runSILLoweringPasses(*CI.getSILModule()); | |||
} else { | |||
auto *SILMod = CI.getSILModule(); | |||
{ | |||
auto T = irgen::createIRGenModule(SILMod, getGlobalLLVMContext()); | |||
{ const auto PSPs = CI.getPrimarySpecificPathsForAtMostOnePrimary(); |
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.
Missing newline here!
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.
Fixed! Great to have worked together and figured out how to do this right. Thanks!
… IRGenModule constructor.
8262e12
to
026b850
Compare
Please test with the following PR: @swift-ci Please clean smoke test |
Batch mode requires that supplementary output paths be specific to the primary input being compiled.
This PR adds arguments and replaces existing output file arguments with an instance of PrimarySpecificPaths in order to make all outputs, not just the main output, dependent on the primary.
It goes along with an lldb PR. Must be merged with apple/swift-lldb#290
Two pieces of state have been removed from IRGenOptions, since they might vary from primary to primary. Because parallel IR generation still needs all of the main output filenames, a parameter has been added,
parallelOutputFilenames
. I don't have a better solution, but it is a bit hokey since it has to be passed down several layers and only used for the parallel case.