Quoting Dmitry Melnik <d...@ispras.ru>:
Hi,
In cortex-a8.md call cost is set to 32, while in cortex-a9.md it's 0:
== cortex-a8.md ==
;; Call latencies are not predictable. A semi-arbitrary very large
;; number is used as "positive infinity" so that everything should be
;; finished by the time of return.
(define_insn_reservation "cortex_a8_call" 32
(and (eq_attr "tune" "cortexa8")
(eq_attr "type" "call"))
"cortex_a8_issue_branch")
Obviously, if the idea is to tell the scheduler that whatever is in
the pipeline now will be done with when the next instruction is
executed,
the resource usage is wrong.
Compare this with sh4.md:
;; calls introduce a longisch delay that is likely to flush the pipelines
;; of the caller's instructions. Ordinary functions tend to end with a
;; load to restore a register (in the delay slot of rts), while sfuncs
;; tend to end with an EX or MT insn. But that is not actually relevant,
;; since there are no instructions that contend for memory access early.
;; We could, of course, provide exact scheduling information for specific
;; sfuncs, if that should prove useful.
(define_insn_reservation "sh4_call" 16
(and (eq_attr "pipe_model" "sh4")
(eq_attr "type" "call,sfunc"))
"d_lock*16")