[all-commits] [llvm/llvm-project] 3a696f: [InstCombine] rotate(X, Z) eq/ne rotate(Y, Z) ---> X...

Dávid Bolvanský via All-commits all-commits at lists.llvm.org
Sat Sep 4 09:58:58 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3a696f6092effe6513b85f51510e51090e205715
      https://github.com/llvm/llvm-project/commit/3a696f6092effe6513b85f51510e51090e205715
  Author: Dávid Bolvanský <david.bolvansky at gmail.com>
  Date:   2021-09-04 (Sat, 04 Sep 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp-rotate.ll

  Log Message:
  -----------
  [InstCombine] rotate(X,Z) eq/ne rotate(Y,Z) ---> X eq/ne Y (PR51565)

```

----------------------------------------
define i1 @src(i8 %x, i8 %y, i8 %z) {
%0:
  %f = fshl i8 %x, i8 %x, i8 %z
  %f2 = fshl i8 %y, i8 %y, i8 %z
  %r = icmp eq i8 %f, %f2
  ret i1 %r
}
=>
define i1 @tgt(i8 %x, i8 %y, i8 %z) {
%0:
  %r = icmp eq i8 %x, %y
  ret i1 %r
}
Transformation seems to be correct!

```

https://alive2.llvm.org/ce/z/qAZp8f

Solves PR51565

Reviewed By: spatel

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




More information about the All-commits mailing list