[all-commits] [llvm/llvm-project] f17e59: [X86] Fold nested VGF2P8AFFINEQB instructions (#19...

Walter via All-commits all-commits at lists.llvm.org
Mon Jun 15 04:13:44 PDT 2026


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

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/combine-gfni.ll
    M llvm/test/CodeGen/X86/gfni-funnel-shifts.ll

  Log Message:
  -----------
  [X86] Fold nested VGF2P8AFFINEQB instructions (#195210)

Given that `vgf2p8affineqb` can perform arbitrary XOR permutations of
the input, all nested affine transformations can be performed with a
single instruction. The matrix for such fold can be calculated by
permuting the sub-matrix by the super-matrix at a byte, rather than bit,
granularity. This patch:

- Folds nested `vgf2p8affineqb` instructions with constant matrix
operands into one.
- Folds the sub-immediate by performing a affine transformation by the
super-matrix.
- Can fold non-splat super-matrices if the sub-immediate is zero.
- Includes test coverage for complex nested affine transformations,
verifying the correctness of the folded matrix and immediate.
- Includes negative test coverage for when the fold isn't possible.

Fixes #179607



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