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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <[email protected]>:

https://gcc.gnu.org/g:21d6148cf38c6aaafaa616b7c153ace35c174971

commit r17-355-g21d6148cf38c6aaafaa616b7c153ace35c174971
Author: Zhongyao Chen <[email protected]>
Date:   Wed May 6 07:04:25 2026 -0600

    [PATCH v4] RISC-V: Apply LMUL cost scaling to vector operations

    This patch introduces multiplicative cost scaling (x2/x4/x8) to model
    the higher latency and register pressure of larger LMULs.  The scaling
    is applied uniformly in adjust_stmt_cost for all vector operations.

    In addition to VLA, VLS should also get the same LMUL cost scaling,
    but doing so causes too many testsuite regressions currently,
    mostly because these tests also need expectation updates.
    This is left for future work.

    All failures displayed in CI should have been fixed. Changes here are
    all expectation updates, except for slp_run-17.c which is pre-existing
    รข I will open a PR for it later.

            PR target/122558

    gcc/ChangeLog:

            * config/riscv/riscv-vector-costs.cc (get_lmul_cost_scaling):
            New function to calculate multiplicative scaling factors.
            (costs::adjust_stmt_cost): Apply LMUL scaling uniformly to all
            vector statements.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/autovec/pr122558.c: New test.
            * gcc.target/riscv/rvv/autovec/dyn-lmul-conv-1.c: Update expected
            dump counts after VLA LMUL cost scaling.
            * gcc.target/riscv/rvv/autovec/dyn-lmul-conv-2.c: Likewise.
            * gcc.target/riscv/rvv/autovec/partial/slp-16.c: Likewise.
            * gcc.target/riscv/rvv/autovec/partial/slp-5.c: Likewise.
            * gcc.dg/vect/costmodel/riscv/rvv/pr113112-4.c: Likewise.

    Signed-off-by: Zhongyao Chen <[email protected]>

Reply via email to