> The following adds the missing capability to sink loads to > tree-ssa-sink.c. This enables sinking of loads and dependent > expressions into code paths that uses them (thus performing > partial dead code elimination on loads).
There is a much heavier implementation in tree-ssa-loop-im.c attached to PR tree-opt/57186 as well as 3 testcases. > The algorithm is simple (similar to that sinking stores) to > be light-weight on compile-time thus it may miss some > opportunities but it fires quite a bit on GCC itself. Is it sufficient for the aforementioned testcases? -- Eric Botcazou