[llvm] [ConstraintElim] Add min/max bounds from KnownBits (PR #176607)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 23 03:48:50 PST 2026
fhahn wrote:
> So, the current status is that is I've implemented a [semilattice](https://github.com/llvm/llvm-project/blob/d454c24532adb7893fbbc50f7e1930e274670c28/llvm/include/llvm/Analysis/Semilattice.h) to keep the KnownBits. Using this structure [in ConstraintElimination](https://github.com/llvm/llvm-project/commit/f37c79dbd0134855caf2f1d1f484478b63df2036) yields a [very low](https://llvm-compile-time-tracker.com/compare.php?from=f37c79dbd0134855caf2f1d1f484478b63df2036&to=79f28f899b23595d4623b43bfb9092665c61c638&stat=instructions:u) computeKnownBits overhead (results are inverted). Unfortunately, constructing the structure itself has a [very high](https://llvm-compile-time-tracker.com/compare.php?from=d454c24532adb7893fbbc50f7e1930e274670c28&to=f37c79dbd0134855caf2f1d1f484478b63df2036&stat=instructions:u) overhead, and I'm currently looking into this. Sounds like a promising direction?
Hmm, I am not sure. Would the plan be to amoritze the cost of the initial construction by then sharing it between multiple passes to reduce the cost of computeKnownBits? This would be good in theory, although I would expect this to be quite a challenging transition.
https://github.com/llvm/llvm-project/pull/176607
More information about the llvm-commits
mailing list