This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81953] Code sinking increases register pressure
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 24 Aug 2017 10:33:21 +0000
- Subject: [Bug tree-optimization/81953] Code sinking increases register pressure
- Auto-submitted: auto-generated
- References: <bug-81953-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81953
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
TER doesn't cross calls these days, it's really sinking doing this.
I think given the schedule of instructions inside a BB on GIMPLE is somewhat
arbitrary sinking should always sink to the beginning of the basic block.
Note sinking also pushes things downward to post-dominating blocks, so for
the slightly modified testcase:
void bar();
int j, x;
void foo(int a, int b, int c, int d, int e, int f)
{
int l;
l = a + b + c + d +e + f;
if (a != 5)
{
bar();
if (b != 3)
x = 3;
else
x = 5;
j = l;
}
}
the trick with the start of the BB wouldn't work as it crosses the if (b != 3)
diamond as well.
I suppose it should get some register pressure modeling here (sinking a
load with no SSA dependencies as far as possible is good, but when SSA
dependencies are involved the live-in of the sunk stmt group matters).
The interesting part is also why RTL scheduling doesn't rectify things
here?