26.11.2012 Views

Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...

Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...

Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

32035 Rev. 3.22 November 2007<br />

3.13.3 Other Switches<br />

<str<strong>on</strong>g>Compiler</str<strong>on</strong>g> <str<strong>on</strong>g>Usage</str<strong>on</strong>g> <str<strong>on</strong>g>Guidelines</str<strong>on</strong>g> <str<strong>on</strong>g>for</str<strong>on</strong>g> AMD<str<strong>on</strong>g>64</str<strong>on</strong>g> Plat<str<strong>on</strong>g>for</str<strong>on</strong>g>ms<br />

In additi<strong>on</strong> to the generic switches, the following switches may improve the per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance of the<br />

program. It is worth experimenting with these switches.<br />

Use the -xO[1|2|3|4|5] switch to enable various levels of general optimizati<strong>on</strong> algorithms. Usually<br />

using a higher number results in faster executi<strong>on</strong>, but in some cases -xO2 or -xO3 may be faster than<br />

-xO4 or -xO5.<br />

Note: The -fast switch implies the -O5 switch.<br />

The -xprofile=collect:[name] and -xprofile=use:[name] flags enable profile guided optimizati<strong>on</strong>.<br />

The flags must be specified both when compiling and linking. After compiling with the<br />

-xprofile=collect:[name] flag, run the program <strong>on</strong> a typical dataset. Then compile with<br />

-xprofile=use:[name] to utilize the resulting profile data to tune the program.<br />

The -xcrossfile flag enables optimizati<strong>on</strong> across all source files. This flag must be combined with<br />

-xO4 or -xO5 to be effective.<br />

Note: The -fast switch implies the -xO5 switch.<br />

Additi<strong>on</strong>al per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance improvements can be gained in floating point programs using the<br />

-fsimple[=n] switch. The -fsimple=2 switch enables aggressive floating point optimizati<strong>on</strong>s, but<br />

sacrifices numeric accuracy. This flag is implied by -fast.<br />

Chapter 3 Per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance-Centric <str<strong>on</strong>g>Compiler</str<strong>on</strong>g> Switches 39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!