[all-commits] [llvm/llvm-project] 8a96c1: [InstCombine] move vector select ahead of select-s...

RotateRight via All-commits all-commits at lists.llvm.org
Thu Jun 4 11:29:34 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a96c1f627fe790a9c29483730447ff5b739c131
      https://github.com/llvm/llvm-project/commit/8a96c1f627fe790a9c29483730447ff5b739c131
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-06-04 (Thu, 04 Jun 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/select-select.ll
    M llvm/test/Transforms/InstCombine/vec_demanded_elts.ll

  Log Message:
  -----------
  [InstCombine] move vector select ahead of select-shuffle

select Cond, (shuf_sel X, Y), X --> shuf_sel X, (select Cond, Y, X)

A select of a select-shuffle ("blend" in x86 lingo) can be reversed
so that the select is done first.
This is a more limited version of what I was trying in D80658,
but it enables existing demanded bits transforms to catch some of the
motivating cases. The tricky bit in that seems to be that by moving
the shuffle later, we can always guarantee that poison is correctly
inhibited by the shuffle mask in the final value.

Alive2 checks for the basic tests:
http://volta.cs.utah.edu:8080/z/Qqd3RK
http://volta.cs.utah.edu:8080/z/S4wchM
http://volta.cs.utah.edu:8080/z/wf9zPL
http://volta.cs.utah.edu:8080/z/wJeEGk

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




More information about the All-commits mailing list