[all-commits] [llvm/llvm-project] 2ff8ed: [VectorCombine] Handle widening/narrowing bitcasts...

AbdallahRashed via All-commits all-commits at lists.llvm.org
Thu Jul 9 09:31:55 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ff8ed77e69c82ab7883369c1477bd3157c1d13c
      https://github.com/llvm/llvm-project/commit/2ff8ed77e69c82ab7883369c1477bd3157c1d13c
  Author: AbdallahRashed <63146988+AbdallahRashed at users.noreply.github.com>
  Date:   2026-07-09 (Thu, 09 Jul 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
    M llvm/test/Transforms/PhaseOrdering/X86/pr67803.ll
    M llvm/test/Transforms/VectorCombine/AArch64/combine-shuffle-ext.ll
    M llvm/test/Transforms/VectorCombine/AArch64/shuffletoidentity.ll
    M llvm/test/Transforms/VectorCombine/X86/shuffle-inseltpoison.ll
    M llvm/test/Transforms/VectorCombine/X86/shuffle.ll
    A llvm/test/Transforms/VectorCombine/X86/shuffletoidentity-bitcast.ll

  Log Message:
  -----------
  [VectorCombine] Handle widening/narrowing bitcasts in foldShuffleToIdentity (#187870)

Track lane indices through vector bitcasts that change element count in
foldShuffleToIdentity. Widening bitcasts (e.g. <2 x i32> -> <4 x i16>)
compress R consecutive destination lanes into one source lane, while
narrowing bitcasts (e.g. <4 x i16> -> <2 x i32>) expand each destination
lane into R source lanes.

Also fix identity check, splat mask, and destination type construction
to use Item.size() instead of Ty->getNumElements(), since the Item
vector changes size when passing through element-count-changing
bitcasts.

Fixes #96884



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