[llvm] [SCEV] Skip invalidation with empty ValueExprMap (NFC). (PR #226845)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 15:25:27 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: Florian Hahn (fhahn)

<details>
<summary>Changes</summary>

forgetLoop, forgetValue and forgetValues walk the def-use chains from the forgotten instructions and erase each visited value's SCEV. This can be expensive.

If ValueExprMap is empty, there's nothing to forget and skipping the walk reduces compile-time a bit:
stage1-O3: -0.05%
stage1-ReleaseThinLTO: -0.05%
stage1-ReleaseLTO-g: -0.03%
stage1-aarch64-O3: -0.04%
stage2-O3: -0.05%
stage2-clang: -0.01%

https://llvm-compile-time-tracker.com/compare.php?from=899d817c7950c997402cd229935cd822acf45b08&to=c43f92b9840b62f75ab8a45b7379188d78d81135&stat=instructions:u

---
Full diff: https://github.com/llvm/llvm-project/pull/226845.diff


1 Files Affected:

- (modified) llvm/lib/Analysis/ScalarEvolution.cpp (+5) 


``````````diff
The server is unavailable at this time. Please wait a few minutes before you try again.
``````````

</details>


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


More information about the llvm-commits mailing list