[all-commits] [llvm/llvm-project] a4e48b: [LoopFusion] Simplify the logic of checking trip c...
Ehsan Amiri via All-commits
all-commits at lists.llvm.org
Fri Jun 5 10:30:28 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a4e48b5d1a5dc7af00c4adb4076145afd9846739
https://github.com/llvm/llvm-project/commit/a4e48b5d1a5dc7af00c4adb4076145afd9846739
Author: Ehsan Amiri <ehsan.amiri at huawei.com>
Date: 2026-06-05 (Fri, 05 Jun 2026)
Changed paths:
M llvm/lib/Transforms/Scalar/LoopFuse.cpp
M llvm/test/Transforms/LoopFusion/cannot_fuse.ll
Log Message:
-----------
[LoopFusion] Simplify the logic of checking trip count equality (NFCI). (#201446)
Currently `haveIdenticalTripCounts` has a clunky return value, which
makes it very easy to make a mistake. The returned pair doesn't provide
much value and can be replaced with an optional integer. Also the
function `haveIdenticalTripCounts` does more than what its name
suggests. It checks whether peeling is supported for the pair of loops
or not. Interestingly this is not the only place where we check whether
peeling for this pair is supported!
This patch changes the function and renames it to
`calculateTripCountDiff`. It does exactly what the names says. It tries
to calculate the difference of the trip counts of the two loops and if
it fails it returns an empty optional. It is up to the caller to decide
whether it wants to do fusion/peeling based on this result. The patch
changes some debug output but no functional change is intended.
Datatypes has been modified with explicit specification of size and
signedness to avoid any bug due to overflow in subtraction or comparison
of different integer types.
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