On 2/12/25 9:23 PM, Palmer Dabbelt wrote:


    PR/117974

gcc/ChangeLog:

    * config/riscv/riscv.cc (riscv_sched_can_speculate_insn):
    (TARGET_SCHED_CAN_SPECULATE_INSN): Implement.
Correct me if I'm wrong, there's not anything inherently wrong with the
speculation from a correctness standpoint.  This is "just" a performance
issue, right?

Hopefully, we didn't go into this looking for functional bugs.
Right. The usual looking for one thing and finding something odd along the way...



We kind of just threw this one together as we're still experimenting with this.  The goal was to avoid the VL=0 cases, but I think that's even just sort of a side effect of avoiding speculative scheduling here. So I think we need to go benchmark this before we can really get a feel for what's going on, as it might not be direct enough to catch the interesting cases.
Yea. And it's that vl=0 case that falls into the wildly bad bucket of scenarios.


Other thoughts?

The docs seem to hint TARGET_SCHED_CAN_SPECULATE_INSN is meant for stuff we can't/don't model in the pipeline, but I have no idea how to model the VL=0 case there.
Maybe so, but what Edwin is doing looks sensible enough. It wouldn't be the first time a hook got (ab)used in ways that weren't part of the original intent.

Jeff

Reply via email to