Skip to content
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

Add emit_bc feature #2

Open
wants to merge 2 commits into
base: uber/ios/0.15.0.002
Choose a base branch
from
Open

Conversation

ghvg1313
Copy link
Collaborator

Adding emit_bc feature for bc_merge pipeline

Despite different output, emit-object and emit-bc is largely the same in terms of input flag, etc, it's still in "compiling stage", feels like a feature flag is more fitting here rather than a new action

@ghvg1313 ghvg1313 requested a review from rmaz July 29, 2020 05:14
# If we're emitting a single object, we don't use an object map; we just
# declare the output file that the compiler will generate and there are
# no other partial outputs.
# If emit_bc is on, only one bitcode file is emitted
Copy link

Choose a reason for hiding this comment

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

why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tried output-file-map, it doesn't seem to work with emic_bc, -### revealed it just ignore the output option and default to module-name.bc

Copy link

Choose a reason for hiding this comment

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

even with num-threads set? curious.

Copy link
Collaborator Author

@ghvg1313 ghvg1313 Jul 30, 2020

Choose a reason for hiding this comment

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

OK I'm missing something here

  • with num-threads on, swift will actually try to output multiple bc files, except that I can't find an option to control the output location, whatever client option I provide it just ignores it and output to the root
  • with single threaded wmo, it will behave like buck did, this seems intentional, I'm just gonna disable threading during bc_merge pipeline I think

Copy link

Choose a reason for hiding this comment

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

When you say root what do you mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

bazel exec root
so swiftc -emit-bc -wmo -num-threads 6 -output-file-map output.json a.swift b.swift-### will get you swiftc- frontend -emit-bc ... a.bc b.bc
Doesn't matter what you put in output.json

Copy link

Choose a reason for hiding this comment

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

Interesting. Pretty fine with the single object file output if that makes things easier.

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.

2 participants