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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 4 05:50:39 PDT 2021


xbolva00 created this revision.
xbolva00 added reviewers: RKSimon, spatel.
Herald added a subscriber: hiraditya.
xbolva00 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

  ----------------------------------------
  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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109271

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/icmp-rotate.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109271.370734.patch
Type: text/x-patch
Size: 6680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210904/43ac189c/attachment.bin>


More information about the llvm-commits mailing list