diff options
author | Ramkumar Ramachandra <ramkumar.ramachandra@codasip.com> | 2025-06-03 17:12:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-03 17:12:24 +0100 |
commit | b40e4ceaa61c5f14ca261e2952e7f85a066403e2 (patch) | |
tree | 22a01d10255678e3a57fae6fc962c3325bbebd00 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | cb4a407e5c2a8a5972781d2a3be362f437602fae (diff) | |
download | llvm-b40e4ceaa61c5f14ca261e2952e7f85a066403e2.zip llvm-b40e4ceaa61c5f14ca261e2952e7f85a066403e2.tar.gz llvm-b40e4ceaa61c5f14ca261e2952e7f85a066403e2.tar.bz2 |
[ValueTracking] Make Depth last default arg (NFC) (#142384)
Having a finite Depth (or recursion limit) for computeKnownBits is very
limiting, but is currently a load-bearing necessity, as all KnownBits
are recomputed on each call and there is no caching. As a prerequisite
for an effort to remove the recursion limit altogether, either using a
clever caching technique, or writing a easily-invalidable KnownBits
analysis, make the Depth argument in APIs in ValueTracking uniformly the
last argument with a default value. This would aid in removing the
argument when the time comes, as many callers that currently pass 0
explicitly are now updated to omit the argument altogether.
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 3d40eb8..245d0c4 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -5854,13 +5854,13 @@ static bool eliminateDeadSwitchCases(SwitchInst *SI, DomTreeUpdater *DTU, AssumptionCache *AC, const DataLayout &DL) { Value *Cond = SI->getCondition(); - KnownBits Known = computeKnownBits(Cond, DL, 0, AC, SI); + KnownBits Known = computeKnownBits(Cond, DL, AC, SI); // We can also eliminate cases by determining that their values are outside of // the limited range of the condition based on how many significant (non-sign) // bits are in the condition value. unsigned MaxSignificantBitsInCond = - ComputeMaxSignificantBits(Cond, DL, 0, AC, SI); + ComputeMaxSignificantBits(Cond, DL, AC, SI); // Gather dead cases. SmallVector<ConstantInt *, 8> DeadCases; |