[llvm] [HashRecognize] Check TC against bitwidth of LHSAux (PR #144881)
Piotr Fusik via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 23 01:55:06 PDT 2025
================
@@ -583,6 +577,13 @@ HashRecognize::recognizeCRC() const {
return "Recurrences not intertwined with XOR";
}
+ // Make sure that the TC doesn't exceed the bitwidth of LHSAux, or LHS.
+ Value *LHS = ConditionalRecurrence.Start;
+ Value *LHSAux = SimpleRecurrence ? SimpleRecurrence.Start : nullptr;
+ if (TC > (LHSAux ? LHSAux->getType()->getIntegerBitWidth()
+ : LHS->getType()->getIntegerBitWidth()))
----------------
pfusik wrote:
I would expect at least two tests to cover this: one for `LHSAux`, the other for `LHS`.
https://github.com/llvm/llvm-project/pull/144881
More information about the llvm-commits
mailing list