Replace rr::Config with an integer optimization level pragma
Extensive run-time control over the LLVM optimization passes we run
used to be part of SwiftConfig, but it hasn't been used in many years.
They're not relevant to Subzero at all, and passing around the config
adds unnecessary complexity.
We only need control over the optimization level for the LargeStack
Reactor unit test. It is also likely of value to keep a rudimentary
optimization level selection for future tiered compilation approaches.
This change eliminates rr::Config and replaces it with the simple
`OptimizationLevel` integer that can be set using Pragma(). Note that
while the values have no strict semantics, this is also true for typical
compiler optimization levels such as O0, O1, O2, etc.
Level 0 omits SROA and InstructionCombining passes, just like LLVM's
buildO0DefaultPipeline().
The SwiftConfig 'AsmEmitDir' was removed and instead one can now define
REACTOR_ASM_EMIT_DIR to change the asm output directory at build time.
Bug: b/191050320
Change-Id: I0283eac4520aef84a4b37ab5fd4c08224219a99f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/65250
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/docs/RuntimeConfiguration.md b/docs/RuntimeConfiguration.md
index cbe5c19..5083a8a 100644
--- a/docs/RuntimeConfiguration.md
+++ b/docs/RuntimeConfiguration.md
@@ -8,15 +8,15 @@
SwiftShader looks for a file named `SwiftShader.ini` (case-sensitive) in the working directory. At startup, SwiftShader reads this file, if it exists, and sets the options specified in it.
-The configuration file syntax is a series of key-value pairs, divided into sections. The following example shows three key-value pairs in two sections (`ThreadCount` and `AffinityMask` in the `[Processor]` section, and `AsmEmitDir` in the `[Debug]` section):
+The configuration file syntax is a series of key-value pairs, divided into sections. The following example shows three key-value pairs in two sections (`ThreadCount` and `AffinityMask` in the `[Processor]` section, and `EnableSpirvProfiling` in the `[Profiler]` section):
```
[Processor]
ThreadCount=4
AffinityMask=0xf
# Comment
-[Debug]
-AsmEmitDir=/home/user/asm_dumps
+[Profiler]
+EnableSpirvProfiling=true
```
The syntax rules are as follows: