On 3/22/24 2:47 AM, Richard Biener wrote:
On Thu, Mar 21, 2024 at 8:56 PM Jeff Law <jeffreya...@gmail.com> wrote:
On 3/21/24 11:19 AM, Vineet Gupta wrote:
So if we go back to Robin's observation that scheduling dramatically
increases the instruction count, perhaps we try a run with
-fno-schedule-insns -fno-schedule-insns2 and see how the instruction
counts compare.
Oh yeah ! Robin hinted to this in Tues patchworks meeting too
default : 2,565,319,368,591
128 : 2,509,741,035,068
256 : 2,527,817,813,612
no-sched{,2}: 1,295,520,567,376
Now we're getting somewhere. That's in line with expectations.
I would strongly suspect it's -fno-schedule-insns rather than
-fno-schedule-insns2. The former turns off scheduling before register
allocation, the second turns it off after register allocation. So if
our theory about spilling is correct, then it must be the first since
the second won't affect register allocation. While I can speculate
about other potential scheduler impacts, spilling due to sched1's
actions is by far the most likely.
Another option is to enable -fsched-pressure which should help with
this issue.
In theory we're already using that by default -- it's part of what makes
me so curious to understand what's going on.
jeff