[llvm] [polly] [ConstraintElimination] Use SCEV ranges information for Loop counter (PR #91457)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 07:12:22 PDT 2024


v01dXYZ wrote:

@fhahn I don't have statistics to motivate this change wrt perf regressions, my first goal was to have feature parity with gcc and I didn't take the performance regressions into account as I should have. I will take a look at `llvm-opt-benchmark`.

Also, to better justify which kind of expression where it would be acceptable to perform a range analysis, I'm currently taking a look at gcc. gcc uses the Ranger framework which was already mentioned in the review for `ConstraintSystem`: https://reviews.llvm.org/D84547#2174140. 

With only `O2` level, the analysis is done during Early Variable Range Propagation (evrp). It is able to infer the range if the induction variable is additive, but if we use a multiplicative induction variable the inferred range is too approximated. With a `O3` level, the right range could be nonetheless inferred in the `dom3` pass, which is not present at lower optimisation levels.

I think it will make me busy for two weeks at least before writing a message here with perf stats and good justifications of which sort of variables should be range analysed.

@nikic thanks for pointing out this MR, I made a mistake `continue` should be replaced by `NR.clear(); break;`.

https://github.com/llvm/llvm-project/pull/91457


More information about the llvm-commits mailing list