[all-commits] [llvm/llvm-project] 3b5f31: [InstCombine] ror/rol(X, RotAmt) == C --> X == rol...

Dávid Bolvanský via All-commits all-commits at lists.llvm.org
Tue Sep 7 09:05:12 PDT 2021


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

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

  Log Message:
  -----------
  [InstCombine] ror/rol(X, RotAmt) == C --> X == rol/ror(C, RotAmt)   (PR51567)

```
----------------------------------------
define i1 @src(i32 %0) {
%1:
  %2 = fshl i32 %0, i32 %0, i32 25
  %3 = icmp eq i32 %2, 5
  ret i1 %3
}
=>
define i1 @tgt(i32 %0) {
%1:
  %2 = icmp eq i32 %0, 640
  ret i1 %2
}
Transformation seems to be correct!
```

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

Solves PR51567

Reviewed By: spatel

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




More information about the All-commits mailing list