[llvm] [IVDescriptors] Implement MonotonicDescriptor (PR #214490)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 12 02:03:37 PDT 2026
================
@@ -482,6 +482,68 @@ class InductionDescriptor {
SmallVector<const SCEVPredicate *, 2> NoWrapPredicates;
};
+/// A struct for saving information about monotonic variables.
+/// Monotonic variable can be considered as a "conditional" induction variable:
+/// its update happens only on loop iterations for which a certain predicate is
+/// satisfied. The step of the monotonic variable must be loop-invariant.
+class MonotonicDescriptor {
+public:
+ MonotonicDescriptor() = default;
+
+ /// Returns true if \p PN is a monotonic variable in the loop \p L. If \p PN
+ /// is monotonic, the monotonic descriptor \p D will contain the data
----------------
fhahn wrote:
```suggestion
/// is monotonic, the monotonic descriptor \p Desc will contain the data
```
https://github.com/llvm/llvm-project/pull/214490
More information about the llvm-commits
mailing list