Re: [PATCH V3] RISC-V: Prevent speculative vsetvl insn scheduling

2025-02-15 Thread Palmer Dabbelt
On Sat, 15 Feb 2025 10:30:18 PST (-0800), jeffreya...@gmail.com wrote: On 2/15/25 10:07 AM, Palmer Dabbelt wrote: Since this is purely a performance related patch, gate the target hook with an opt flag to see the fallout. PR 117974 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_sche

Re: [PATCH V3] RISC-V: Prevent speculative vsetvl insn scheduling

2025-02-15 Thread Jeff Law
On 2/15/25 10:07 AM, Palmer Dabbelt wrote: Since this is purely a performance related patch, gate the target hook with an opt flag to see the fallout. PR 117974 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_sched_can_speculate_insn): (TARGET_SCHED_CAN_SPECULATE_INSN): Implement

Re: [PATCH V3] RISC-V: Prevent speculative vsetvl insn scheduling

2025-02-15 Thread Palmer Dabbelt
On Sat, 15 Feb 2025 08:47:16 PST (-0800), jeffreya...@gmail.com wrote: On 2/13/25 3:54 PM, Edwin Lu wrote: The instruction scheduler appears to be speculatively hoisting vsetvl insns outside of their basic block without checking for data dependencies. This resulted in a situation where the fol

Re: [PATCH V3] RISC-V: Prevent speculative vsetvl insn scheduling

2025-02-15 Thread Jeff Law
On 2/13/25 3:54 PM, Edwin Lu wrote: The instruction scheduler appears to be speculatively hoisting vsetvl insns outside of their basic block without checking for data dependencies. This resulted in a situation where the following occurs vsetvli a5,a1,e32,m1,tu,ma vle32.v v2,

[PATCH V3] RISC-V: Prevent speculative vsetvl insn scheduling

2025-02-13 Thread Edwin Lu
The instruction scheduler appears to be speculatively hoisting vsetvl insns outside of their basic block without checking for data dependencies. This resulted in a situation where the following occurs vsetvli a5,a1,e32,m1,tu,ma vle32.v v2,0(a0) sub a1,a1,a5 <-- a1 poten