Bitcode and Assembly?

I work for a third party library vendor and we are pretty sure our customers will ask us for a Bitcode version of our library.


We are very performance sensitive though, and we've optimized critical sections of our library in NEON assembly. When we compile to LLVM bitcode, we are assuming that NEON assembly will be encapsulated. Is that correct?


We're also worried about writing code in assembly though. Bitcode seems to leave open the possibility that our application could end up running on a platform who's capabilities we did not optimize for in advance. It seems like it might be a good idea to make sure our software paths are working well. Would it also be a good idea to attempt to drop out of NEON directly and use the LLVM SIMD intrinsics? I believe Accelerate was also tried and found to be too high level for our stuff. We're also multiplatform.

One aside:


> 2. When using Xcode, bitcode is only produced during archive build, not debug or release build.


The build setting that causes Xcode to pass `-fembed-bitcode` to the compiler in an archive build, but not in a release, or debug build, is `DEPLOYMENT_POSTPROCESSING`. Setting this to `YES` for your release configuration in combination with `ENABLE_BITCODE = YES` will cause Xcode to generate bitcode in regular release builds, as well.

You wrote: "For iOS, this should *just work*."


What about tvOS? Or Apple Watch?


Many thanks!

It seems there are several ways to include bitcode in normal build and not just archive:

* setting the flag to '-fembed-bitcode'

* setting user-defined setting 'BITCODE_GENERATION_MODE=bitcode'

* setting option DEPLOYMENT_POSTPROCESSING to YES


What is the correct way that will stick in future versions of Xcode?

Thanks for this validation of what I was finding as well. Sure took a while to narrow down why a local release build (not archive) for a device (not simulator) was still generating bitcode when I was expecting it to for only an build+archive action.

Bitcode and Assembly?
 
 
Q