On 6/27/2026 1:06 PM, Roger Sayle wrote:
Hi Jeff,
I'd like to ping my "vec_merge simplification" patch from January,
https://gcc.gnu.org/pipermail/gcc-patches/2026-January/706337.html
that you're previously agreed to look at/review here:
https://gcc.gnu.org/pipermail/gcc-patches/2026-January/706398.html

Replacing two vec_merges with one should universally be a win, but
if any platform (I'm thinking riscv's vmerge/vgather) can demonstrate a
slow down, this indicates a latent missed optimization (during RTL
expansion), which I'm happy to investigate once there's sufficient
analysis/information in a Bugzilla PR.  Fingers-crossed that's not an
issue; the new test case shows a clear improvement on x86_64.


This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
and make -k check, both with and without --target_board=unix{-m32}
with no new failures.  Ok for mainline?


2026-06-27  Roger Sayle  <[email protected]>

gcc/ChangeLog
         * simplify-rtx.cc (simplify_context::simplify_ternary_operation)
         <case VEC_MERGE>: Simplify a vec_merge of a vec_merge with a
         repeated operand.

gcc/testsuite/ChangeLog
         * gcc.target/i386/avx2-vpblendd128-3.c: New test case.
Thanks for the reminder.  I'd hoped this would help RISC-V, but it doesn't.  I didn't dig into why, but it has no codegen impact on the trivial test.

THe patch is OK for the trunk.  Again, thanks for pinging, it was definitely lost in the backlog

Jef

Reply via email to