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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 29 08:50:53 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) {
----------------
artagnon wrote:

Due to LCSSA form, the exit block would have a LCSSA Phi in this case. Constraining number of uses is a better idea though!

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


More information about the llvm-commits mailing list