[clang] [llvm] [ValueTracking] Extend computeConstantRange for add/sub, sext/zext/trunc (PR #181110)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 04:50:51 PDT 2026


nikic wrote:

> @nikic Doubling the analysis depth for binary operations seems to solve the compile-time regression: https://llvm-compile-time-tracker.com/compare.php?from=d852c040c510fb452284a8d04fb8bc0d45013f61&to=c69dce81a3bb663078009ed9b102213c2c6f2625&stat=instructions:u
> 
> And even slightly better when the depth is set to `Max - 1`: https://llvm-compile-time-tracker.com/compare.php?from=c69dce81a3bb663078009ed9b102213c2c6f2625&to=761207338c54d90e193873107da61b5f5efae7cb&stat=instructions:u
> 
> Do you think the current approach converges or should I refactor the users nonetheless?

I was a bit confused by these results, but apparently those are just the differences to the baseline regression. All the commits combined together are: https://llvm-compile-time-tracker.com/compare.php?from=3bd7dc3d65d3a690721d9ec11d2af02f87323840&to=761207338c54d90e193873107da61b5f5efae7cb&stat=instructions%3Au

So this remains a significant regression.

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


More information about the cfe-commits mailing list