[llvm] [HashRecognize] Forbid optz when data.next has exit-block user (PR #165574)

Piotr Fusik via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 08:12:12 PDT 2025


================
@@ -487,6 +487,14 @@ std::variant<PolynomialInfo, StringRef> HashRecognize::recognizeCRC() const {
                    : LHS->getType()->getIntegerBitWidth()))
     return "Loop iterations exceed bitwidth of data";
 
+  // Make sure that the simple recurrence evolution isn't used in the exit
+  // block.
+  if (SimpleRecurrence && any_of(SimpleRecurrence.BO->users(), [Exit](User *U) {
----------------
pfusik wrote:

What if it's used after the exit block? Shouldn't we rather check that the only uses are in the loop, or simply constrain the number of uses?

https://github.com/llvm/llvm-project/pull/165574


More information about the llvm-commits mailing list