19.1 Optimization Feature Summary

Each big O optimization is equal to specific options. Lists of currently-supported optimization options are show below. “No” versions of options may be available, for example -fdefer-pop and -fno-defer-pop.

These features are subject to change.

Enabled/Disabled f<option> O1 enabled O2 enabled O3 enabled Os enabled
O1 optimization
defer pop Enabled fdefer-pop Yes Yes Yes Yes
guess branch probability Enabled fguess-branch-probability Yes Yes Yes Yes
cprop registers Enabled fcprop-registers Yes Yes Yes Yes
forward propogate Enabled fforward-propagate Yes Yes Yes Yes
if conversion Enabled fif-conversion Yes Yes Yes Yes
if conversion2 Enabled fif-conversion2 Yes Yes Yes Yes
ipa pure const Enabled fipa-pure-const Yes Yes Yes Yes
ipa reference Enabled fipa-reference Yes Yes Yes Yes
ipa profile Enabled fipa-profile Yes Yes Yes Yes
merge constants Enabled fmerge-constants Yes Yes Yes Yes
reorder blocks Enabled freorder-blocks Yes Yes Yes Yes
shrink wrap Enabled fshrink-wrap Yes Yes Yes Yes
split wide types Enabled, Disabled for Os, O1 fsplit-wide-types No (XC-DSC disables) Yes Yes No (XC-DSC disables)
tree ccp Enabled ftree-ccp Yes Yes Yes Yes
tree bit ccp Enabled ftree-bit-ccp Yes Yes Yes Yes
tree coalesce vars Enabled ftree-coalesce-vars Yes Yes Yes Yes
tree dce Enabled ftree-dce Yes Yes Yes Yes
tree dominator opts Enabled ftree-dominator-opts Yes Yes Yes Yes
tree dse Enabled ftree-dse Yes Yes Yes Yes
tree ter Enabled ftree-ter Yes Yes Yes Yes
tree sra Enabled ftree-sra Yes Yes Yes Yes
tree fre Enabled ftree-fre Yes Yes Yes Yes
tree copy prop Enabled ftree-copy-prop Yes Yes Yes Yes
tree sink Enabled ftree-sink Yes Yes Yes Yes
tree ch Enabled ftree-ch Yes Yes Yes Yes
combine stack adjustments Enabled fcombine-stack-adjustments Yes Yes Yes Yes
compare elim Enabled fcompare-elim Yes Yes Yes Yes
tree slsr Enabled ftree-slsr Yes Yes Yes Yes
branch count reg Enabled fbranch-count-reg Yes Yes Yes Yes
move loop invariants Enabled, Disabled for Os fmove-loop-invariants Yes Yes Yes No (XC-DSC disables)
tree pta Enabled ftree-pta Yes Yes Yes Yes
ssa phiopt Enabled fssa-phiopt Yes Yes Yes Yes
tree builtin call dce Enabled ftree-builtin-call-dce Yes Yes Yes Yes
omit frame pointer Enabled fomit-frame-pointer Yes Yes Yes Yes
O2 optimization
inline small functions Enabled, Disabled for Os, O1 finline-small-functions No Yes Yes No (XC-DSC disables)
indirect inlining Enabled, Disabled for Os, O1 findirect-inlining No Yes Yes No (XC-DSC disables)
partial inlining Enabled fpartial-inlining No Yes Yes Yes
thread jumps Enabled fthread-jumps No Yes Yes Yes
crossjumping Enabled fcrossjumping No Yes Yes Yes
optimize sibling calls Enabled foptimize-sibling-calls No Yes Yes Yes
cse follow jumps Enabled fcse-follow-jumps No Yes Yes Yes
gcse Enabled fgcse No Yes Yes Yes
expensive optimizations Enabled fexpensive-optimizations No Yes Yes Yes
rerun cse after loop Enabled frerun-cse-after-loop No Yes Yes Yes
caller saves Enabled fcaller-saves No Yes Yes Yes
peephole2 Enabled fpeephole2 No Yes Yes Yes
schedule insns Disabled, except -merrata fschedule-insns No (XC-DSC disables) No (XC-DSC disables) No (XC-DSC disables) No (XC-DSC disables)
schedule insns2 Disabled, except -merrata fschedule-insns2 No (XC-DSC disables) No (XC-DSC disables) No (XC-DSC disables) No (XC-DSC disables)
strict aliasing Enabled fstrict-aliasing No Yes Yes Yes
reorder blocks algorithm Enabled, Disabled for Os (by default in gcc) freorder-blocks-algorithm= No Yes Yes No
reorder functions Enabled freorder-functions No Yes Yes Yes
tree vrp Enabled ftree-vrp No Yes Yes Yes
code hoisting Enabled fcode-hoisting No Yes Yes Yes
tree pre Enabled ftree-pre No Yes Yes Yes
tree switch conversion Enabled, Disabled for Os, O1 ftree-switch-conversion No Yes Yes No (XC-DSC disables)
ipa cp Enabled fipa-cp No Yes Yes Yes
ipa bit cp Enabled fipa-bit-cp No Yes Yes Yes
ipa vrp Enabled fipa-vrp No Yes Yes Yes
devirtualize Enabled fdevirtualize No Yes Yes Yes
devirtualize speculatively Enabled fdevirtualize-speculatively No Yes Yes Yes
ipa sra Enabled fipa-sra No Yes Yes Yes
align loops Enabled falign-loops No Yes Yes Yes
align jumps Enabled falign-jumps No Yes Yes Yes
align labels Enabled falign-labels No Yes Yes Yes
align functions Enabled falign-functions No Yes Yes Yes
tree tail merge Enabled ftree-tail-merge No Yes Yes Yes
vect cost model Enabled fvect-cost-model No Yes Yes Yes
optimize strlen Enabled, Disabled for Os (by default in gcc) foptimize-strlen No Yes Yes No
hoist adjacent loads Enabled fhoist-adjacent-loads No Yes Yes Yes
ipa icf Enabled fipa-icf No Yes Yes Yes
isolate erroneous paths dereference Enabled fisolate-erroneous-paths-dereference No Yes Yes Yes
ipa ra Enabled fipa-ra No Yes Yes Yes
lra remat Enabled flra-remat No Yes Yes Yes
store merging Enabled fstore-merging No Yes Yes Yes
O3 optimization
tree loop distribute patterns Enabled ftree-loop-distribute-patterns No No Yes Yes
predictive commoning Enabled fpredictive-commoning No No Yes No
split paths Enabled fsplit-paths No No Yes No
inline functions Enabled, Disabled for Os, O1 finline-functions No No Yes No
inline functions called once Enabled, Disabled for Os, O1 finline-functions-called-once No No Yes No
split loops Enabled fsplit-loops No No Yes No
unswitch loops Enabled funswitch-loops No No Yes No
loop unroll and jam Enabled floop-unroll-and-jam No No Yes No
gcse after reload Enabled fgcse-after-reload No No Yes No
tree loop vectorize Disabled ftree-loop-vectorize No No No No
tree slp vectorize Disabled ftree-slp-vectorize No No No No
vect cost model Enabled fvect-cost-model No No Yes No
ipa cp clone Enabled fipa-cp-clone No No Yes No
tree partial pre Enabled ftree-partial-pre No No Yes No
peel loops Enabled fpeel-loops No No Yes No