[all-commits] [llvm/llvm-project] a14cd6: [LoongArch] Support VBIT{CLR, SET, REV}I patterns fo...

hev via All-commits all-commits at lists.llvm.org
Tue Apr 28 01:59:16 PDT 2026


  Branch: refs/heads/users/hev/vbitops
  Home:   https://github.com/llvm/llvm-project
  Commit: a14cd6c718c1f88f031686931852dbd3f61d5138
      https://github.com/llvm/llvm-project/commit/a14cd6c718c1f88f031686931852dbd3f61d5138
  Author: WANG Rui <wangrui at loongson.cn>
  Date:   2026-04-28 (Tue, 28 Apr 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.h
    M llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
    M llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
    M llvm/test/CodeGen/LoongArch/lasx/bitclr.ll
    M llvm/test/CodeGen/LoongArch/lasx/bitrev.ll
    M llvm/test/CodeGen/LoongArch/lasx/bitset.ll
    M llvm/test/CodeGen/LoongArch/lsx/bitclr.ll
    M llvm/test/CodeGen/LoongArch/lsx/bitrev.ll
    M llvm/test/CodeGen/LoongArch/lsx/bitset.ll

  Log Message:
  -----------
  [LoongArch] Support VBIT{CLR,SET,REV}I patterns for non-native element sizes

Extend vsplat_uimm_{pow2,inv_pow2} matching to allow specifying an explicit
element bit width, enabling recognition of splat patterns whose logical
element size differs from the vector's native element type.

Introduce templated selectVSplatUimm{Pow2,InvPow2} helpers with an optional
EltSize parameter, and add corresponding ComplexPattern definitions for
i8/i16/i32 element widths. This allows TableGen patterns to match cases such
as operating on v8i32/v4i64 vectors with masks derived from smaller element
sizes (e.g. i16).

With these changes, AND/OR/XOR operations using inverse power-of-two or
power-of-two splat masks are now correctly selected to VBITCLRI, VBITSETI,
and VBITREVI instructions instead of falling back to vector logical
operations with materialized constants.


  Commit: 095cbdaf5fa7bda30a64a4f99c1df7e7dc03b20e
      https://github.com/llvm/llvm-project/commit/095cbdaf5fa7bda30a64a4f99c1df7e7dc03b20e
  Author: WANG Rui <r at hev.cc>
  Date:   2026-04-28 (Tue, 28 Apr 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td

  Log Message:
  -----------
  Address wanglei's comments


Compare: https://github.com/llvm/llvm-project/compare/72192b8dc8bc...095cbdaf5fa7

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