[llvm] [HashRecognize] Strip ValueEvolution (PR #148620)
Piotr Fusik via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 2 06:20:05 PDT 2025
================
@@ -320,6 +149,60 @@ struct RecurrenceInfo {
Instruction::BinaryOps BOWithConstOpToMatch = Instruction::BinaryOpsEnd);
};
+/// Check the well-formedness of the (most|least) significant bit check given \p
+/// ConditionalRecurrence, \p SimpleRecurrence, depending on \p
+/// ByteOrderSwapped. We check that ConditionalRecurrence.Step is a
+/// Select(Cmp()) where the compare is `>= 0` in the big-endian case, and `== 0`
+/// in the little-endian case (or the inverse, in which case the branches of the
+/// compare are swapped). We check that the LHS is (ConditionalRecurrence.Phi
+/// [xor SimpleRecurrence.Phi]) in the big-endian case, and additionally check
+/// for an AND with one in the little-endian case. We then check AllowedByR
+/// against CheckAllowedByR, which is [0, smin) in the big-endian case, and [0,
+/// 1) in the little-endian case: CheckAllowedByR checks for
+/// significant-bit-clear, and this must be equal to ConditionalRecurrence.BO
+/// (which is the bit-shift, as already checked by isBigEndianBitShift) for
+/// well-formedness.
+static bool
+isSignificantBitCheckWellFormed(const RecurrenceInfo &ConditionalRecurrence,
+ const RecurrenceInfo &SimpleRecurrence,
+ bool ByteOrderSwapped) {
+ auto *SI = cast<SelectInst>(ConditionalRecurrence.Step);
+ DataLayout DL = SI->getParent()->getDataLayout();
----------------
pfusik wrote:
Unused variable `DL`.
https://github.com/llvm/llvm-project/pull/148620
More information about the llvm-commits
mailing list