Skip to content

Conversation

@ivanradanov
Copy link
Contributor

No description provided.

@ivanradanov ivanradanov requested a review from artagnon June 13, 2025 04:45
@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Jun 13, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 13, 2025

@llvm/pr-subscribers-llvm-analysis

Author: Ivan R. Ivanov (ivanradanov)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/144014.diff

1 Files Affected:

  • (modified) llvm/include/llvm/Analysis/IVDescriptors.h (+2-5)
diff --git a/llvm/include/llvm/Analysis/IVDescriptors.h b/llvm/include/llvm/Analysis/IVDescriptors.h
index 3b627a5140854..099b19c9cec94 100644
--- a/llvm/include/llvm/Analysis/IVDescriptors.h
+++ b/llvm/include/llvm/Analysis/IVDescriptors.h
@@ -53,13 +53,10 @@ enum class RecurKind {
   FMaximumNum, ///< FP max with llvm.maximumnum semantics
   FMulAdd,  ///< Sum of float products with llvm.fmuladd(a * b + sum).
   AnyOf,    ///< AnyOf reduction with select(cmp(),x,y) where one of (x,y) is
-            ///< loop invariant, and both x and y are integer type.
+            ///< loop invariant.
   FindLastIV, ///< FindLast reduction with select(cmp(),x,y) where one of
-              ///< (x,y) is increasing loop induction, and both x and y are
-              ///< integer type.
+              ///< (x,y) is increasing loop induction.
   // clang-format on
-  // TODO: Any_of and FindLast reduction need not be restricted to integer type
-  // only.
 };
 
 /// The RecurrenceDescriptor is used to identify recurrences variables in a

@artagnon artagnon requested review from Mel-Chen and fhahn June 14, 2025 10:54
Copy link
Contributor

@artagnon artagnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mel-Chen I'm currently traveling, and away from the keyboard: could you kindly confirm that this is indeed outdated?

Copy link
Contributor

@artagnon artagnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct: see the 'select_const_f32_from_icmp' in select-cmp.ll and 'not_vectorized_select_float_induction_icmp' test in iv-select-cmp.ll.

@ivanradanov
Copy link
Contributor Author

ivanradanov commented Jun 15, 2025

Sorry, I was going off of these two commits which say they unify the int and float kinds, am I misunderstanding this?

commit 0240129218eebcc5b6b5d31f9458c2f827163c9e
Author: Ramkumar Ramachandra <[email protected]>
Date:   Fri May 23 11:57:30 2025 +0100

    [IVDesc] Unify RecurKinds [I|F]AnyOf (#118393)
    
    Co-authored-by: Mel Chen <[email protected]>

commit b81170ecffb5f53d52eab5d3424ba6f1c8ef97d3
Author: Ramkumar Ramachandra <[email protected]>
Date:   Thu May 22 22:48:01 2025 +0100

    [IVDesc] Unify RecurKinds [I|F]FindLastIV (NFC) (#141082)

@artagnon
Copy link
Contributor

Sorry, I was going off of these two commits which say they unify the int and float kinds, am I misunderstanding this?

Yeah, they unify select(icmp(), x, y) and select(fcmp(), x, y). The comparison can be integer or float type, but the select operands (and the reduction op) are still restricted to be integer type, unfortunately.

@ivanradanov
Copy link
Contributor Author

I see, I am sorry for the noise...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:analysis Includes value tracking, cost tables and constant folding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants