This commit adds a flag to disable optimizations on a specific functions. The
primary motivation of this patch is to allow the optimizer developers to reduce
testcasese by disabling optimizations of parts of the code without having to
recompile the compiler or inspect SIL. The annotations "inline(never)"
and "optimize.none" can go a long way.
The second motivation for this patch is to allow our internal adopters to work
around compiler bugs.
rar://19745484
Usage:
@semantics("optimize.never")
public func miscompile() { ... }
Swift SVN r27475
The GlobalPropertyOpt pass performs a static analysis over the whole module.
If it can prove that an array property call (_getArrayPropertyIsNativeNoTypeCheck) always yiels true,
then it replaces the call with a literal-true.
The pass runs on the high-level SIL using the array semantics calls.
Currently it only handles the isNativeNoTypeCheck array property, but in future it might handle additinal properties
(therefore I chose this general name for it).
It gives +24% on DeltaBlue.
Swift SVN r27361