[all-commits] [llvm/llvm-project] 285328: [VectorCombine] foldShuffleOfShuffles - replace IR...

mbhade-amd via All-commits all-commits at lists.llvm.org
Sat Jun 6 07:12:22 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2853284556509da5de1b52cba488e053dcf2ffc5
      https://github.com/llvm/llvm-project/commit/2853284556509da5de1b52cba488e053dcf2ffc5
  Author: mbhade-amd <mbhade at amd.com>
  Date:   2026-06-06 (Sat, 06 Jun 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
    M llvm/test/Transforms/VectorCombine/X86/shuffle-of-shuffles.ll

  Log Message:
  -----------
  [VectorCombine] foldShuffleOfShuffles - replace IR with poison on the !NewX path (#201826)

The function returns bool. The early return `return
PoisonValue::get(ShuffleDstTy);` relies on implicit pointer-to-bool
conversion of a non-null PoisonValue*, so the caller records a change
and invalidates non-CFG analyses while the original shuffle is never
replaced.

Call replaceValue(I, *PoisonValue::get(ShuffleDstTy)) and return true so
the fold actually fires. Downstream InstCombine usually cleans up the
residual shuffle via simplifyShuffleVectorInst, which masks the bug at
-O2 but leaves vector-combine producing the wrong result on its own.

Adds a regression test covering the case where both inner shuffles have
all-poison masks, so the merge loop never assigns NewX.

This was found as part of jlebar's X86 LLVM bug hunt / FuzzX effort:
https://github.com/SemiAnalysisAI/FuzzX/tree/master/x86 :
[024-foldshuffleofshuffles-poison-bool-cast](https://github.com/SemiAnalysisAI/FuzzX/tree/master/x86/bugs/024-foldshuffleofshuffles-poison-bool-cast)



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