[all-commits] [llvm/llvm-project] d3fe1d: [SCEV] Improve handling of divisibility informatio...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Sun Nov 2 06:16:45 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d3fe1df1945a6761e042ea02b7a80154d648601a
https://github.com/llvm/llvm-project/commit/d3fe1df1945a6761e042ea02b7a80154d648601a
Author: Florian Hahn <flo at fhahn.com>
Date: 2025-11-02 (Sun, 02 Nov 2025)
Changed paths:
M llvm/lib/Analysis/ScalarEvolution.cpp
M llvm/test/Transforms/IndVarSimplify/loop-guard-order.ll
Log Message:
-----------
[SCEV] Improve handling of divisibility information from loop guards. (#163021)
At the moment, the effectivness of guards that contain divisibility
information (A % B == 0 ) depends on the order of the conditions.
This patch makes using divisibility information independent of the
order, by collecting and applying the divisibility information
separately.
We first collect all conditions in a vector, then collect the
divisibility information from all guards.
When processing other guards, we apply divisibility info collected
earlier.
After all guards have been processed, we add the divisibility info,
rewriting the existing rewrite. This ensures we apply the divisibility
info to the largest rewrite expression.
This helps to improve results in a few cases, one in
https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2921 and another one
in a different large C/C++ based IR corpus.
PR: https://github.com/llvm/llvm-project/pull/163021
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