[all-commits] [llvm/llvm-project] ab789b: [DA] Add initial support for monotonicity check (#...
Ryotaro Kasuga via All-commits
all-commits at lists.llvm.org
Tue Oct 21 02:11:32 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ab789beffdf68c65722203250d3094c15466459f
https://github.com/llvm/llvm-project/commit/ab789beffdf68c65722203250d3094c15466459f
Author: Ryotaro Kasuga <kasuga.ryotaro at fujitsu.com>
Date: 2025-10-21 (Tue, 21 Oct 2025)
Changed paths:
M llvm/lib/Analysis/DependenceAnalysis.cpp
A llvm/test/Analysis/DependenceAnalysis/monotonicity-cast.ll
A llvm/test/Analysis/DependenceAnalysis/monotonicity-delinearize.ll
A llvm/test/Analysis/DependenceAnalysis/monotonicity-invariant.ll
A llvm/test/Analysis/DependenceAnalysis/monotonicity-no-wrap-flags.ll
A llvm/test/Analysis/DependenceAnalysis/non-monotonic.ll
Log Message:
-----------
[DA] Add initial support for monotonicity check (#162280)
The dependence testing functions in DA assume that the analyzed AddRec
does not wrap over the entire iteration space. For AddRecs that may
wrap, DA should conservatively return unknown dependence. However, no
validation is currently performed to ensure that this condition holds,
which can lead to incorrect results in some cases.
This patch introduces the notion of *monotonicity* and a validation
logic to check whether a SCEV is monotonic. The monotonicity check
classifies the SCEV into one of the following categories:
- Unknown: Nothing is known about the monotonicity of the SCEV.
- Invariant: The SCEV is loop-invariant.
- MultivariateSignedMonotonic: The SCEV doesn't wrap in a signed sense
for any iteration of the loops in the loop nest.
The current validation logic basically searches an affine AddRec
recursively and checks whether the `nsw` flag is present. Notably, it is
still unclear whether we should also have a category for unsigned
monotonicity.
The monotonicity check is still under development and disabled by
default for now. Since such a check is necessary to make DA sound, it
should be enabled by default once the functionality is sufficient.
Split off from #154527.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list