https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68664

--- Comment #11 from James Greenhalgh <jgreenhalgh at gcc dot gnu.org> ---
Presumably, this check in sched-rgn.c:new_ready is the problem...

      /* For speculative insns, before inserting to ready/queue,
         check live, exception-free, and issue-delay.  */
      if (!IS_VALID (INSN_BB (next))
          || CANT_MOVE (next)
          || (IS_SPECULATIVE_INSN (next)
              && ((recog_memoized (next) >= 0
                   && min_insn_conflict_delay (curr_state, next, next)
                   > PARAM_VALUE (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY))
                  || IS_SPECULATION_CHECK_P (next)
                  || !check_live (next, INSN_BB (next))
                  || (not_ex_free = !is_exception_free (next, INSN_BB (next),
                                                        target_bb)))))

In particular:

                   min_insn_conflict_delay (curr_state, next, next)
                   > PARAM_VALUE (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY))

If I'm reading it right, that says: no matter how expensive the instruction, as
long as we don't have to wait to issue it, then we can use it speculatively.

I'd expect checking the instruction latency to also be part of this cost model,
but I may be misreading something.

Reply via email to