You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/compiler.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,16 +34,26 @@ The compiler can optimize for both speed (`-Ospeed`) and size (`-Osize`), as wel
34
34
```
35
35
--optimize, -O Optimizes the module. Typical shorthands are:
36
36
37
-
Default optimizations -O
38
-
Make a release build -O --noAssert
39
-
Make a debug build --debug
40
-
Optimize for speed -Ospeed
41
-
Optimize for size -Osize
37
+
Default optimizations -O
38
+
Make a release build -O --noAssert
39
+
Make a debug build --debug
40
+
Optimize for speed -Ospeed
41
+
Optimize for size -Osize
42
42
43
43
--optimizeLevel How much to focus on optimizing code. [0-3]
44
44
--shrinkLevel How much to focus on shrinking code size. [0-2, s=1, z=2]
45
45
--converge Re-optimizes until no further improvements can be made.
46
46
--noAssert Replaces assertions with just their value without trapping.
47
+
--uncheckedBehavior Changes the behavior of unchecked() expressions.
48
+
Using this option can potentially cause breakage.
49
+
50
+
default The default behavior: unchecked operations are
51
+
only used inside of unchecked().
52
+
never Unchecked operations are never used, even when,
53
+
inside of unchecked().
54
+
always Unchecked operations are always used if possible,
55
+
whether or not unchecked() is used.
56
+
47
57
```
48
58
49
59
Optimization levels can also be tweaked manually: `--optimizeLevel`\(0-3\) indicates how much the compiler focuses on optimizing the code with `--shrinkLevel`\(0-2, 1=s, 2=z\) indicating how much it focuses on keeping the size low during code generation and while optimizing. A shorthand for both is `-O[optimizeLevel][shrinkLevel]` , with shrink level indicated by optionally appending the letter `s`\(1\) or `z`\(2\).
0 commit comments