Don't run the objc-arc-contract pass when disable-llvm-optzns is passed.
In pipeline setups where the swift-frontend is called twice;
- the first time to create bitcode
- the second time to generate object code from the bitcode (using
disable-llvm-optzns)
we don't want to run the objc-arc-contract pass twice.
rdar://91908312
Previously, we were just running ObjCARCContract when codegening. This is out of
character with the rest of the LLVM passes in Swift, namely that after these
have run, an IR pass no longer contains any compiler intrinsics. This can be
seen by SwiftARCContract running in the -O pipeline.
This commit harmonizes the behavior here.
For testing purposes, I added a flag that disables the running of
ObjCARCContract for testing purposes.
rdar://34824507