Skip to content

[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

Merged
merged 7 commits into from
Feb 16, 2018

Conversation

davidungar
Copy link
Contributor

@davidungar davidungar commented Jan 29, 2018

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.

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar changed the title [Batch Mode] Pass PrimarySpecificPaths through compiler. [Batch Mode] Pass PrimarySpecificPaths through compiler. (4) Jan 29, 2018
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar
Copy link
Contributor Author

[Batch Mode] WIP: Pass PrimarySpecificPaths to createEmptyModule and IRGenModule() #290

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test linux platform

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

2 similar comments
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 1e4cdbb to b3e8ed2 Compare January 29, 2018 05:43
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from b3e8ed2 to 07914b2 Compare January 29, 2018 05:48
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 07914b2 to 1850e88 Compare January 29, 2018 20:56
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 1850e88 to 11e6dd2 Compare January 30, 2018 00:34
@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch 2 times, most recently from e8dd1eb to 8c1e064 Compare February 8, 2018 03:31
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 8c1e064 to c633e32 Compare February 8, 2018 04:15
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from c633e32 to a49aa03 Compare February 8, 2018 05:06
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from a49aa03 to 8934888 Compare February 8, 2018 06:00
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 8934888 to aeef46d Compare February 8, 2018 06:07
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from aeef46d to 7ced740 Compare February 8, 2018 06:12
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar
Copy link
Contributor Author

After more thought, I decided it was appropriate to use the supplemental outputs for only the first parallel-genererated input.

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 1d30537 to dec7890 Compare February 15, 2018 22:39
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test

@davidungar
Copy link
Contributor Author

@jrose-apple At this point, I think all issues have been addressed. Will see if it passes the tests.

@jrose-apple
Copy link
Contributor

After more thought, I decided it was appropriate to use the supplemental outputs for only the first parallel-genererated input.

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.

@davidungar
Copy link
Contributor Author

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).

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 4b247d7 to abe1f18 Compare February 15, 2018 23:49
@davidungar
Copy link
Contributor Author

@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.
If it looks good and you would like me to streamline the commits, I can squash some. Thanks.

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from abe1f18 to 9fd7f0a Compare February 15, 2018 23:55
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 9fd7f0a to 8262e12 Compare February 15, 2018 23:59
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

1 similar comment
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please smoke test os x platform

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please clean smoke test os x platform

2 similar comments
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please clean smoke test os x platform

@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please clean smoke test os x platform

Copy link
Contributor

@jrose-apple jrose-apple left a 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!

@@ -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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline here!

Copy link
Contributor Author

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!

@davidungar davidungar force-pushed the PR-18-5-lldb-interface branch from 8262e12 to 026b850 Compare February 16, 2018 03:52
@davidungar
Copy link
Contributor Author

Please test with the following PR:
apple/swift-lldb#290

@swift-ci Please clean smoke test

@davidungar davidungar merged commit e7ba87f into swiftlang:master Feb 16, 2018
@davidungar davidungar deleted the PR-18-5-lldb-interface branch May 16, 2018 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants