Common Var(flag_move_loop_invariants) Optimization
Move loop invariant computations out of loops.
+fmove-loop-stores
+Common Var(flag_move_loop_stores) Optimization
+Move stores out of loops.
+
fdce
Common Var(flag_dce) Init(1) Optimization
Use the RTL dead code elimination pass.
-floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
-flto-partition=@var{alg} -fmerge-all-constants @gol
-fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
--fmove-loop-invariants -fno-branch-count-reg @gol
+-fmove-loop-invariants -fmove-loop-stores -fno-branch-count-reg @gol
-fno-defer-pop -fno-fp-int-builtin-inexact -fno-function-cse @gol
-fno-guess-branch-probability -fno-inline -fno-math-errno -fno-peephole @gol
-fno-peephole2 -fno-printf-return-value -fno-sched-interblock @gol
-fipa-reference-addressable @gol
-fmerge-constants @gol
-fmove-loop-invariants @gol
+-fmove-loop-stores@gol
-fomit-frame-pointer @gol
-freorder-blocks @gol
-fshrink-wrap @gol
@gccoptlist{-fbranch-count-reg -fdelayed-branch @gol
-fdse -fif-conversion -fif-conversion2 @gol
-finline-functions-called-once @gol
--fmove-loop-invariants -fssa-phiopt @gol
+-fmove-loop-invariants -fmove-loop-stores -fssa-phiopt @gol
-ftree-bit-ccp -ftree-dse -ftree-pta -ftree-sra}
@end table
Enables the loop invariant motion pass in the RTL loop optimizer. Enabled
at level @option{-O1} and higher, except for @option{-Og}.
+@item -fmove-loop-stores
+@opindex fmove-loop-stores
+Enables the loop store motion pass in the GIMPLE loop optimizer. This
+moves invariant stores to after the end of the loop in exchange for
+carrying the stored value in a register across the iteration.
+Note for this option to have an effect @option{-ftree-loop-im} has to
+be enabled as well. Enabled at level @option{-O1} and higher, except
+for @option{-Og}.
+
@item -fsplit-loops
@opindex fsplit-loops
Split a loop into two if it contains a condition that's always true
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fif_conversion2, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_finline_functions_called_once, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fmove_loop_invariants, NULL, 1 },
+ { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fmove_loop_stores, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fssa_phiopt, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fipa_modref, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_ftree_bit_ccp, NULL, 1 },