On 1/24/25 3:57 AM, Robin Dapp wrote:
So this isn't a regression, but I can also understand the desire to fix
this fairly significant performance issue.

I'd argue it is a regression as the match.pd pattern that merges the permutes
was introduces after GCC 14.
Good point. I hadn't thought about it as resolving the performance regression from that change.


After giving it a bit more thought, I'd still like to send the attached v2
because it excludes fewer cases and, consequently, requires fewer changes to
the test suite.

Regtested on rv64gcv_zvl512b.

Regards
  Robin

[PATCH v2] RISC-V: Disable two-source permutes for now [PR117173].

After testing on the BPI (4.2% improvement for x264 input 1, 4.4% for
input 2) and the discussion in PR117173 I figured it's best to disable
the two-source permutes by default for now.

The patch adds a parameter "riscv-two-source-permutes" which restores
the old behavior.

        PR target/117173

gcc/ChangeLog:

        * config/riscv/riscv-v.cc (shuffle_generic_patterns): Only
        support single-source permutes by default.
        * config/riscv/riscv.opt: New param "riscv-two-source-permutes".

gcc/testsuite/ChangeLog:

        * gcc.dg/fold-perm-2.c: Run with two-source permutes.
        * gcc.dg/pr54346.c: Ditto.
OK
jeff

Reply via email to