[all-commits] [llvm/llvm-project] a083f3: [DAG] combineShuffleOfSplatVal - fold shuffle(spla...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Jun 7 08:42:52 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a083f3caa1356ceaec2c250850928c01008f5f58
      https://github.com/llvm/llvm-project/commit/a083f3caa1356ceaec2c250850928c01008f5f58
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-06-07 (Tue, 07 Jun 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/X86/vector-fshl-rot-256.ll
    M llvm/test/CodeGen/X86/vector-fshr-rot-256.ll

  Log Message:
  -----------
  [DAG] combineShuffleOfSplatVal - fold shuffle(splat,undef) -> splat, iff the splat contains no UNDEF elements

As noticed on D127115 - we were missing this fold, instead just having the shuffle(shuffle(x,undef,splatmask),undef) fold. We should be able to merge these into one using SelectionDAG::isSplatValue, but we'll need to match the shuffle's undef handling first.

This also exposed an issue in SelectionDAG::isSplatValue which was incorrectly propagating the undef mask across a bitcast (it was trying to just bail with a APInt::isSubsetOf if it found any undefs but that was actually the wrong way around so didn't fire for partial undef cases).




More information about the All-commits mailing list