[PATCH] D154953: [InstSimplify] Remove the remainder loop if we know the mask is always true

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 00:09:37 PDT 2023


nikic added a comment.

> proofs: https://alive2.llvm.org/ce/z/FkTMoy

These proofs are for a different transform (urem x) than what was implemented (and x - 1).



================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:2146
+    }
+  }
+
----------------
I don't think this second fold should be added. This is something that can be handled via simple range propagation. In fact, IPSCCP does handle this already. We could make CVP handle it as well, if we wanted.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154953



More information about the llvm-commits mailing list