aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorRamkumar Ramachandra <ramkumar.ramachandra@codasip.com>2025-04-07 21:52:36 +0100
committerGitHub <noreply@github.com>2025-04-07 21:52:36 +0100
commit2ac11daf92531c5de65dd645f4466c709f865a7e (patch)
tree12d6e650f59c10c92ea6e561256b71d7e4815942 /llvm/lib/Analysis/ScalarEvolution.cpp
parentdf28c81f5a2b61a3b5ad1e6274dd27697a9367ac (diff)
downloadllvm-2ac11daf92531c5de65dd645f4466c709f865a7e.zip
llvm-2ac11daf92531c5de65dd645f4466c709f865a7e.tar.gz
llvm-2ac11daf92531c5de65dd645f4466c709f865a7e.tar.bz2
[SCEV] Improve code around constant TC (NFC) (#133261)
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 5f73644..c62ea15 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8253,14 +8253,14 @@ unsigned ScalarEvolution::getSmallConstantTripMultiple(const Loop *L) {
unsigned Multiple = getSmallConstantTripMultiple(L, ExitingBB);
if (!Res)
Res = Multiple;
- Res = (unsigned)std::gcd(*Res, Multiple);
+ Res = std::gcd(*Res, Multiple);
}
return Res.value_or(1);
}
unsigned ScalarEvolution::getSmallConstantTripMultiple(const Loop *L,
const SCEV *ExitCount) {
- if (ExitCount == getCouldNotCompute())
+ if (isa<SCEVCouldNotCompute>(ExitCount))
return 1;
// Get the trip count
@@ -8270,8 +8270,8 @@ unsigned ScalarEvolution::getSmallConstantTripMultiple(const Loop *L,
// If a trip multiple is huge (>=2^32), the trip count is still divisible by
// the greatest power of 2 divisor less than 2^32.
return Multiple.getActiveBits() > 32
- ? 1U << std::min((unsigned)31, Multiple.countTrailingZeros())
- : (unsigned)Multiple.zextOrTrunc(32).getZExtValue();
+ ? 1U << std::min(31U, Multiple.countTrailingZeros())
+ : (unsigned)Multiple.getZExtValue();
}
/// Returns the largest constant divisor of the trip count of this loop as a