Skip to content

Commit cc72e4f

Browse files
author
Colin Robertson
committed
Acrolinx more things.
1 parent 18a08f3 commit cc72e4f

8 files changed

+60
-59
lines changed

docs/build/reference/gt-support-fiber-safe-thread-local-storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Supports fiber safety for data allocated using static thread-local storage, that
1818

1919
Data declared with `__declspec(thread)` is referenced through a thread-local storage (TLS) array. The TLS array is an array of addresses that the system maintains for each thread. Each address in this array gives the location of thread-local storage data.
2020

21-
A fiber is a lightweight object that consists of a stack and a register context and can be scheduled on various threads. A fiber can run on any thread. Because a fiber may get swapped out and restarted later on a different thread, the address of the TLS array must not be cached or optimized as a common subexpression across a function call. **`/GT`** prevents such optimizations.
21+
A fiber is a lightweight object that consists of a stack and a register context and can be scheduled on various threads. A fiber can run on any thread. Because a fiber may get swapped out and restarted later on a different thread, the compiler mustn't cache the address of the TLS array, or optimize it as a common subexpression across a function call. **`/GT`** prevents such optimizations.
2222

2323
### To set this compiler option in the Visual Studio development environment
2424

docs/build/reference/ltcg-link-time-code-generation.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ These options are deprecated starting in Visual Studio 2015:
2121
### Arguments
2222

2323
**`INCREMENTAL`**<br/>
24-
(Optional) Specifies that the linker only applies whole program optimization or link-time code generation (LTCG) to the set of files affected by an edit, instead of the entire project. By default, this flag is not set when **`/LTCG`** is specified, and the entire project is linked by using whole program optimization.
24+
(Optional) Specifies that the linker only applies whole program optimization or link-time code generation (LTCG) to files affected by an edit, instead of the entire project. By default, this flag isn't set when **`/LTCG`** is specified, and the entire project is linked by using whole program optimization.
2525

2626
**`NOSTATUS`** &#124; **`STATUS`**<br/>
27-
(Optional) Specifies whether the linker displays a progress indicator that shows what percentage of the link is complete. By default, this status information is not displayed.
27+
(Optional) Specifies whether the linker displays a progress indicator that shows what percentage of the link is complete. By default, this status information isn't displayed.
2828

2929
**`OFF`**<br/>
30-
(Optional) Disables link-time code generation. This behavior is the same as when **`/LTCG`** is not specified on the command line.
30+
(Optional) Disables link-time code generation. This behavior is the same as when **`/LTCG`** isn't specified on the command line.
3131

3232
**`PGINSTRUMENT`**<br/>
3333
(Optional) This option is deprecated starting in Visual Studio 2015. Instead, use **`/LTCG`** and `[/GENPROFILE` or `/FASTGENPROFILE`](genprofile-fastgenprofile-generate-profiling-instrumented-build.md) to generate an instrumented build for profile-guided optimization. The data that is collected from instrumented runs is used to create an optimized image. For more information, see [Profile-Guided Optimizations](../profile-guided-optimizations.md). The short form of this option is **`/LTCG:PGI`**.
@@ -42,7 +42,7 @@ These options are deprecated starting in Visual Studio 2015:
4242

4343
The **`/LTCG`** option tells the linker to call the compiler and perform whole-program optimization. You can also do profile guided optimization. For more information, see [Profile-Guided Optimizations](../profile-guided-optimizations.md).
4444

45-
With the following exceptions, you cannot add linker options to the PGO combination of **`/LTCG`** and **`/USEPROFILE`** that were not specified in the previous PGO initialization combination of **`/LTCG`** and **`/GENPROFILE`** options:
45+
With the following exceptions, you can't add linker options to the PGO combination of **`/LTCG`** and **`/USEPROFILE`** that weren't specified in the previous PGO initialization combination of **`/LTCG`** and **`/GENPROFILE`** options:
4646

4747
- [`/BASE`](base-base-address.md)
4848

@@ -68,17 +68,17 @@ With the following exceptions, you cannot add linker options to the PGO combinat
6868

6969
- [`/VERBOSE`](verbose-print-progress-messages.md)
7070

71-
Any linker options that are specified together with the **`/LTCG`** and **`/GENPROFILE`** options to initialize PGO do not have to be specified when you build by using **`/LTCG`** and **`/USEPROFILE`**; they are implied.
71+
Any linker options that are specified together with the **`/LTCG`** and **`/GENPROFILE`** options to initialize PGO don't have to be specified when you build by using **`/LTCG`** and **`/USEPROFILE`**; they're implied.
7272

73-
The rest of this article discusses **`/LTCG`** in terms of link-time code generation.
73+
The rest of this article discusses the link-time code generation done by **`/LTCG`**.
7474

7575
**`/LTCG`** is implied with [`/GL`](gl-whole-program-optimization.md).
7676

77-
The linker invokes link-time code generation if it is passed a module that was compiled by using **`/GL`** or an MSIL module (see [`.netmodule` Files as Linker Input](netmodule-files-as-linker-input.md)). If you do not explicitly specify **`/LTCG`** when you pass **`/GL`** or MSIL modules to the linker, the linker eventually detects this and restarts the link by using **`/LTCG`**. Explicitly specify **`/LTCG`** when you pass **`/GL`** and MSIL modules to the linker for the fastest possible build performance.
77+
The linker invokes link-time code generation if it's passed a module that was compiled by using **`/GL`** or an MSIL module (see [`.netmodule` Files as Linker Input](netmodule-files-as-linker-input.md)). If you don't explicitly specify **`/LTCG`** when you pass **`/GL`** or MSIL modules to the linker, the linker eventually detects this situation and restarts the link by using **`/LTCG`**. Explicitly specify **`/LTCG`** when you pass **`/GL`** and MSIL modules to the linker for the fastest possible build performance.
7878

79-
For even faster performance, use **`/LTCG:INCREMENTAL`**. This option tells the linker to only re-optimize the set of files that is affected by a source file change, instead of the entire project. This can significantly reduce the link time required. This is not the same option as incremental linking.
79+
For even faster performance, use **`/LTCG:INCREMENTAL`**. This option tells the linker to reoptimize only the files affected by a source file change, instead of the entire project. This option can significantly reduce the link time required. This option isn't the same option as [incremental linking](incremental-link-incrementally.md).
8080

81-
**`/LTCG`** is not valid for use with [`/INCREMENTAL`](incremental-link-incrementally.md).
81+
**`/LTCG`** isn't valid for use with [`/INCREMENTAL`](incremental-link-incrementally.md).
8282

8383
When **`/LTCG`** is used to link modules compiled by using [`/Og`](og-global-optimizations.md), [`/O1`](o1-o2-minimize-size-maximize-speed.md), [`/O2`](o1-o2-minimize-size-maximize-speed.md), or [`/Ox`](ox-full-optimization.md), the following optimizations are performed:
8484

@@ -99,7 +99,7 @@ When **`/LTCG`** is used to link modules compiled by using [`/Og`](og-global-opt
9999
100100
Using **`/LTCG`** and **`/O2`** causes double-alignment optimization.
101101

102-
If **`/LTCG`** and **`/O1`** are specified, double alignment is not performed. If most of the functions in an application are compiled for speed, with a few functions compiled for size (for example, by using the [`optimize`](../../preprocessor/optimize.md) pragma), the compiler double-aligns the functions that are optimized for size if they call functions that require double alignment.
102+
If **`/LTCG`** and **`/O1`** are specified, double alignment isn't performed. If most of the functions in an application are compiled for speed, with a few functions compiled for size (for example, by using the [`optimize`](../../preprocessor/optimize.md) pragma), the compiler double-aligns the functions that are optimized for size if they call functions that require double alignment.
103103

104104
If the compiler can identify all of the call sites of a function, the compiler ignores explicit calling-convention modifiers on a function and tries to optimize the function's calling convention:
105105

@@ -109,7 +109,7 @@ If the compiler can identify all of the call sites of a function, the compiler i
109109

110110
- remove unused parameters
111111

112-
If a function is called through a function pointer, or if a function is called from outside a module that is compiled by using **`/GL`**, the compiler does not attempt to optimize the function's calling convention.
112+
If a function is called through a function pointer, or if a function is called from outside a module that is compiled by using **`/GL`**, the compiler doesn't attempt to optimize the function's calling convention.
113113

114114
> [!NOTE]
115115
> If you use **`/LTCG`** and redefine `mainCRTStartup`, your application can have unpredictable behavior that relates to user code that executes before global objects are initialized. There are three ways to address this issue: do not redefine `mainCRTStartup`, do not compile the file that contains `mainCRTStartup` by using **`/LTCG`**, or initialize global variables and objects statically.
@@ -120,7 +120,7 @@ Modules that are compiled by using [`/GL`](gl-whole-program-optimization.md) and
120120

121121
- **`/LTCG`** can accept native object files, and mixed native/managed object files (compiled by using **`/clr`**). The **`/clr:pure`** and **`/clr:safe`** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017 and later.
122122

123-
- **`/LTCG:PGI`** does not accept native modules compiled by using **`/GL`** and **`/clr`**
123+
- **`/LTCG:PGI`** doesn't accept native modules compiled by using **`/GL`** and **`/clr`**
124124

125125
### To set this compiler option in the Visual Studio development environment
126126

docs/build/reference/o-options-optimize-code.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: "/O Options (Optimize Code)"
2+
title: "/O options (Optimize code)"
33
description: "The MSVC /O compiler options specify the compiler optimizations to use."
44
ms.date: 07/08/2020
55
f1_keywords: ["VC.Project.VCCLCompilerTool.Optimization", "/o", "VC.Project.VCCLWCECompilerTool.Optimization"]
66
helpviewer_keywords: ["performance, cle.exe compiler", "cl.exe compiler, performance"]
77
ms.assetid: 77997af9-5555-4b3d-aa57-6615b27d4d5d
88
---
9-
# `/O` Options (Optimize Code)
9+
# `/O` options (Optimize code)
1010

1111
The **`/O`** options control various optimizations that help you create code for maximum speed or minimum size.
1212

@@ -26,13 +26,13 @@ The **`/O`** options control various optimizations that help you create code for
2626

2727
- [`/Ot`](os-ot-favor-small-code-favor-fast-code.md) (a default setting) tells the compiler to favor optimizations for speed over optimizations for size.
2828

29-
- [`/Ox`](ox-full-optimization.md) is a combination option that selects several of the optimizations with an emphasis on speed. It is a strict subset of the **/O2** optimizations.
29+
- [`/Ox`](ox-full-optimization.md) is a combination option that selects several of the optimizations with an emphasis on speed. **`/Ox`** is a strict subset of the **`/O2`** optimizations.
3030

3131
- [`/Oy`](oy-frame-pointer-omission.md) suppresses the creation of frame pointers on the call stack for quicker function calls.
3232

3333
## Remarks
3434

35-
You can combine multiple **`/O`** options into a single option statement. For example, **`/Odi`** is the same as **`/Od /Oi`**. Certain options are mutually exclusive and cause a compiler error if used together. See the individual **`/O`** options for more information.
35+
You can combine multiple **`/O`** options into a single option statement. For example, **`/Odi`** is the same as **`/Od /Oi`**. Certain options are mutually exclusive and cause a compiler error if used together. For more information, see the individual **`/O`** options.
3636

3737
## See also
3838

docs/build/reference/og-global-optimizations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Deprecated. Provides local and global optimizations, automatic-register allocati
1616
1717
## Remarks
1818

19-
**`/Og`** is deprecated. These optimizations are now generally enabled by default. For more information on optimizations, see [`/O1`, `/O2` (Minimize Size, Maximize Speed)](o1-o2-minimize-size-maximize-speed.md) or [`/Ox` (Enable Most Speed Optimizations)](ox-full-optimization.md).
19+
**`/Og`** is deprecated. These optimizations are now enabled by default when any optimizations are enabled. For more information on optimizations, see [`/O1`, `/O2` (Minimize Size, Maximize Speed)](o1-o2-minimize-size-maximize-speed.md), or [`/Ox` (Enable Most Speed Optimizations)](ox-full-optimization.md).
2020

2121
The following optimizations are available under **`/Og`**:
2222

2323
- Local and global common subexpression elimination
2424

25-
In this optimization, the value of a common subexpression is calculated once. In the following example, if the values of `b` and `c` do not change between the three expressions, the compiler can assign the calculation of `b + c` to a temporary variable, and substitute the variable for `b + c`:
25+
In this optimization, the value of a common subexpression is calculated once. In the following example, if the values of `b` and `c` don't change between the three expressions, the compiler can assign the calculation of `b + c` to a temporary variable, and use that variable for `b + c`:
2626

2727
```C
2828
a = b + c;
@@ -38,7 +38,7 @@ The following optimizations are available under **`/Og`**:
3838

3939
- Loop optimization
4040

41-
This optimization removes invariant subexpressions from the body of a loop. An optimal loop contains only expressions whose values change through each execution of the loop. In the following example, the expression `x + y` does not change in the loop body:
41+
This optimization removes invariant subexpressions from the body of a loop. An optimal loop contains only expressions whose values change through each execution of the loop. In the following example, the expression `x + y` doesn't change in the loop body:
4242
4343
```C
4444
i = -100;

docs/build/reference/os-ot-favor-small-code-favor-fast-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Minimizes or maximizes the size of EXEs and DLLs.
1919

2020
**`/Os`** (Favor Small Code) minimizes the size of EXEs and DLLs by instructing the compiler to favor size over speed. The compiler can reduce many C and C++ constructs to functionally similar sequences of machine code. Occasionally these differences offer tradeoffs of size versus speed. The **`/Os`** and **`/Ot`** options allow you to specify a preference for one over the other:
2121

22-
**`/Ot`** (Favor Fast Code) maximizes the speed of EXEs and DLLs by instructing the compiler to favor speed over size. This is the default when optimizations are enabled. The compiler can reduce many C and C++ constructs to functionally similar sequences of machine code. Occasionally, these differences offer tradeoffs of size versus speed. The **`/Ot`** option is implied by the [`/O2`](o1-o2-minimize-size-maximize-speed.md) (Maximize speed) option. The **`/O2`** option combines several options to produce very fast code.
22+
**`/Ot`** (Favor Fast Code) maximizes the speed of EXEs and DLLs by instructing the compiler to favor speed over size. **`/Ot`** is the default when optimizations are enabled. The compiler can reduce many C and C++ constructs to functionally similar sequences of machine code. Occasionally, these differences offer tradeoffs of size versus speed. The **`/Ot`** option is implied by the [`/O2`](o1-o2-minimize-size-maximize-speed.md) (Maximize speed) option. The **`/O2`** option combines several options to produce faster code.
2323

2424
> [!NOTE]
2525
> Information that's gathered from profiling test runs overrides any optimizations that would otherwise be in effect if you specify **`/Ob`**, **`/Os`**, or **`/Ot`**. For more information, see [Profile-Guided Optimizations](../profile-guided-optimizations.md).

docs/build/reference/ox-full-optimization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ ms.assetid: 3ad7c30b-c615-428c-b1d0-2e024f81c760
88
---
99
# `/Ox` (Enable Most Speed Optimizations)
1010

11-
The **`/Ox`** compiler option enables a combination of optimizations that favor speed. In some versions of the Visual Studio IDE and the compiler help message, this is called *full optimization*, but the **`/Ox`** compiler option enables only a subset of the speed optimization options enabled by **`/O2`**.
11+
The **`/Ox`** compiler option enables a combination of optimizations that favor speed. In some versions of the Visual Studio IDE and the compiler help message, it's called *full optimization*, but the **`/Ox`** compiler option enables only a subset of the speed optimization options enabled by **`/O2`**.
1212

1313
## Syntax
1414

1515
> **`/Ox`**
1616
1717
## Remarks
1818

19-
The **`/Ox`** compiler option enables the **`/O`** compiler options that favor speed. The **`/Ox`** compiler option does not include the additional [`/GF` (Eliminate Duplicate Strings)](gf-eliminate-duplicate-strings.md) and [`/Gy` (Enable Function-Level Linking)](gy-enable-function-level-linking.md) options enabled by [`/O1` or `/O2` (Minimize Size, Maximize Speed)](o1-o2-minimize-size-maximize-speed.md). The additional options applied by **`/O1`** and **`/O2`** can cause pointers to strings or to functions to share a target address, which can affect debugging and strict language conformance. The **`/Ox`** option is an easy way to enable most optimizations without including **`/GF`** and **`/Gy`**. For more information, see the descriptions of the [`/GF`](gf-eliminate-duplicate-strings.md) and [`/Gy`](gy-enable-function-level-linking.md) options.
19+
The **`/Ox`** compiler option enables the **`/O`** compiler options that favor speed. The **`/Ox`** compiler option doesn't include the additional [`/GF` (Eliminate Duplicate Strings)](gf-eliminate-duplicate-strings.md) and [`/Gy` (Enable Function-Level Linking)](gy-enable-function-level-linking.md) options enabled by [`/O1` or `/O2` (Minimize Size, Maximize Speed)](o1-o2-minimize-size-maximize-speed.md). The additional options applied by **`/O1`** and **`/O2`** can cause pointers to strings or to functions to share a target address, which can affect debugging and strict language conformance. The **`/Ox`** option is an easy way to enable most optimizations without including **`/GF`** and **`/Gy`**. For more information, see the descriptions of the [`/GF`](gf-eliminate-duplicate-strings.md) and [`/Gy`](gy-enable-function-level-linking.md) options.
2020

2121
The **`/Ox`** compiler option is the same as using the following options in combination:
2222

0 commit comments

Comments
 (0)