[all-commits] [llvm/llvm-project] 87f631: [InstCombine] canonicalize splat shuffle after cmp

RotateRight via All-commits all-commits at lists.llvm.org
Wed Jan 29 05:49:03 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 87f6314f8cd1fd5bb0ce04eff6c5843529c6ab53
      https://github.com/llvm/llvm-project/commit/87f6314f8cd1fd5bb0ce04eff6c5843529c6ab53
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/gep-inbounds-null.ll
    M llvm/test/Transforms/InstCombine/getelementptr.ll
    M llvm/test/Transforms/InstCombine/icmp-vec.ll

  Log Message:
  -----------
  [InstCombine] canonicalize splat shuffle after cmp

cmp (splat V1, M), SplatC --> splat (cmp V1, SplatC'), M

As discussed in PR44588:
https://bugs.llvm.org/show_bug.cgi?id=44588
...we try harder to push shuffles after binops than after compares.

This patch handles the special (but presumably most common case) of
splat shuffles. If both operands are splats, then we can do the
comparison on the non-splat inputs followed by splat of the compare.
That should take care of the regression noted in D73411.

There's another potential fold requested in PR37463 to scalarize the
compare, but that's another patch (and it's not clear if we can do
that without the ability to undo it later):
https://bugs.llvm.org/show_bug.cgi?id=37463

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




More information about the All-commits mailing list