[all-commits] [llvm/llvm-project] fdb2f1: [X86] Fold splat XOR on VGF2P8AFFINEQB source (#20...

Walter via All-commits all-commits at lists.llvm.org
Thu Jun 25 04:46:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fdb2f1bbd916cdf41957d68958ff459954f3c630
      https://github.com/llvm/llvm-project/commit/fdb2f1bbd916cdf41957d68958ff459954f3c630
  Author: Walter <90877047+WalterKruger at users.noreply.github.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/gfni-xor-fold-avx512.ll
    M llvm/test/CodeGen/X86/gfni-xor-fold.ll

  Log Message:
  -----------
  [X86] Fold splat XOR on VGF2P8AFFINEQB source (#204508)

Given that XORs are associative, a XOR on `vgf2p8affineqb`'s source can
be reassociated to occur after by first permuting by the matrix. If the
XOR operand is a 8-bit splat, it can be applied for free by combining it
with the immediate. This patch:

- Folds XOR by splat on `vgf2p8affineqb`'s source into its immediate.
- Only occurs when the matrix is both constant and splat across each
64-bit lane.
- Can occur when the XOR is multi-use, as it can still reduce the
dependency chain.
- Includes test coverage for a variety of matrices and negative cases
for when the fold isn't possible.

Fixes #179606



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list