[PATCH] D109283: [InstCombine] ror/rol(X, RotAmt) == C --> X == rol/ror(C, RotAmt) (PR51567)
Dávid Bolvanský via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 4 16:31:38 PDT 2021
xbolva00 created this revision.
xbolva00 added a reviewer: 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(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
https://reviews.llvm.org/D109283
Files:
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-rotate.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109283.370771.patch
Type: text/x-patch
Size: 3811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210904/baf15e2a/attachment.bin>
More information about the llvm-commits
mailing list