[all-commits] [llvm/llvm-project] 2b9ded: [VectorCombine] Support nary operands and intrinsi...

Luke Lau via All-commits all-commits at lists.llvm.org
Wed May 28 01:46:16 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b9ded64b0221f4159ab603518c5f88edb8bf958
      https://github.com/llvm/llvm-project/commit/2b9ded64b0221f4159ab603518c5f88edb8bf958
  Author: Luke Lau <luke at igalia.com>
  Date:   2025-05-28 (Wed, 28 May 2025)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
    M llvm/test/Transforms/VectorCombine/intrinsic-scalarize.ll
    A llvm/test/Transforms/VectorCombine/unary-op-scalarize.ll

  Log Message:
  -----------
  [VectorCombine] Support nary operands and intrinsics in scalarizeOpOrCmp  (#138406)

This adds support for unary operands, and unary + ternary intrinsics in
scalarizeOpOrCmp (FKA scalarizeBinOpOrCmp).

The motivation behind this is to scalarize more intrinsics in
VectorCombine rather than in DAGCombine, so we can sink splats across
basic blocks: see https://github.com/llvm/llvm-project/pull/137786

The main change required is to generalize the existing VecC0/VecC1 rules
across n-ary ops:

- An operand can either be a constant vector or an insert of a scalar
into a constant vector
- If it's an insert, the index needs to be static and in bounds
- If it's an insert, all indices need to be the same across all operands
- If all the operands are constant vectors, bail as it will get constant
folded anyway



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