[PATCH] D85092: [InstSimplify] Peephole optimization for icmp (urem X, Y), X

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 2 07:32:13 PDT 2020


nikic added inline comments.


================
Comment at: llvm/test/Transforms/InstSimplify/compare.ll:731
+  %A = urem i8 %X, %Y
+  %B = icmp ule i8 %A, %Y
+  ret i1 %B
----------------
These tests aren't testing the right fold. You are checking for `(X % Y) <= Y`, which is a fold that already exists. What you add here is `(X % Y) <= X`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85092/new/

https://reviews.llvm.org/D85092



More information about the llvm-commits mailing list