[llvm] [AssumptionCache] Fix removeAffectedValues() when value is repeated in AssumeInst (PR #205275)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 08:47:32 PDT 2026


================
@@ -129,12 +145,21 @@ void AssumptionCache::removeAffectedValues(AssumeInst *CI) {
       if (Elem.Assume == CI) {
----------------
thurstond wrote:

It would be less efficient: every iteration of `138 for (auto &AV : Affected)` would nullify exactly one element (vs. currently it's possible that it may potentially nullify multiple elements, and therefore not actually need every iteration of the outer loop, thereby avoiding the expense of the repeated AffectedValues.find_as()).

(N.B. I didn't write line 145, so the above is my guess.)

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


More information about the llvm-commits mailing list