[llvm] [ValueTracking] Use dominating conditions in computeConstantRange (PR #210412)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 18 05:45:26 PDT 2026


https://github.com/dtcxzyw commented:

`computeConstantRange` was designed to be lightweight (it even avoids recursion on binops). We typically rely on SCCP/CVP/ConstraintElim to leverage context-sensitive information from dominating conditions. All your positive test cases have been handled by SCCP: https://godbolt.org/z/7954vdovY

> the fully flattened -O3 form in that report, where SimplifyCFG has merged the guards into a single and before the compare, needs separate work and is not addressed here.

Yes, this should be the root cause.

@nikic Can you measure the compile-time impact of this patch?

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


More information about the llvm-commits mailing list