For current mainline and Apple 3.3/4.0, the top pass in the profile is
scheduling : 14.99 (42%) usr 4.32 (75%) sys 19.32 (46%) wall
Note that at -O0, instead, it is
global alloc : 1.06 (30%) usr 0.03 ( 5%) sys 1.09 (26%) wall
but I doubt we can do much about it.
Created attachment 10234 [details]
file used for benchmarking
Top of the profile:
105174 7.2325 cc1 cc1 sched_analyze_insn
98121 6.7475 cc1 cc1 free_deps
89078 6.1256 cc1 cc1 bitmap_set_bit
63000 4.3323 cc1 cc1 free_list
48690 3.3482 cc1 cc1 alloc_INSN_LIST
39632 2.7254 cc1 cc1 compute_global_livein
26382 1.8142 cc1 cc1 free_INSN_LIST_list
25567 1.7582 cc1 cc1 bitmap_bit_p
> For current mainline and Apple 3.3/4.0, the top pass in the profile is
> scheduling : 14.99 (42%) usr 4.32 (75%) sys 19.32 (46%) wall
Is it the first scheduling pass? If so, we have a patch at AdaCore to limit its explosion.
Subject: Re: scheduling takes 40% or more time
>Is it the first scheduling pass? If so, we have a patch at AdaCore to limit
Yes, it is. schedule_insns2 takes nothing.
Created attachment 10236 [details]
Patch (against 3.4.x) for controlling the explosion of the 1st scheduling pass.
* params.def (PARAM_MAX_SCHED_READY_INSNS): New parameter,
defaulting to 100.
* params.h (MAX_SCHED_READY_INSNS): New macro.
* haifa-sched.c: Include param.h.
(queue_to_ready): Re-queue insns past MAX_SCHED_READY_INSNS
for the next cycle during the first scheduling pass.
(schedule_block): Delay insns past MAX_SCHED_READY_INSNS in
the ready list for 1 cycle during the first scheduling pass.
* doc/invoke.texi (--param): New parameter
Sorry, the patch doesn't seem to help at all.