[all-commits] [llvm/llvm-project] e1fd6d: [InstCombine] Fix assert condition in `foldSelectS...

Nabeel Omer via All-commits all-commits at lists.llvm.org
Thu Oct 20 05:11:30 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e1fd6d49a3dfa59b4be85102a866a2068fa4760a
      https://github.com/llvm/llvm-project/commit/e1fd6d49a3dfa59b4be85102a866a2068fa4760a
  Author: Nabeel Omer <nabeel.omer at sony.com>
  Date:   2022-10-20 (Thu, 20 Oct 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
    M llvm/test/Transforms/InstCombine/shuffle_select.ll

  Log Message:
  -----------
  [InstCombine] Fix assert condition in `foldSelectShuffleOfSelectShuffle`

Bug introduced in e239198cdbbf.

The assert() is making an assumption that the resulting shuffle mask
will always select elements from both vectors, this is untrue in the
case of two shuffles being folded if the former shuffle has a mask with
undef elements in it. In such a case folding the shuffles might result
in a mask which only selects from one of the vectors because the other
elements (in the mask) are undef.

Differential Revision: https://reviews.llvm.org/D136256




More information about the All-commits mailing list