[llvm] [LVI][SCCP][CVP] Add basic ConstantFPRange support (PR #111544)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 14 19:59:15 PDT 2025


dtcxzyw wrote:

> > Compile-time impact:
> > instructions: http://llvm-compile-time-tracker.com/compare.php?from=a3a253d3c7780977077dd46493917b1949c0166d&to=553fdd7a60c0fc4cf379f284bc226ea427489cbd&stat=instructions:u
> 
> Where does the extra cost come from? I wouldn't have expected this to have such a large impact, as FP optimizations usually don't significantly affect compile-time, and this PR doesn't hook up many things yet.

It is caused by an additional edge in the copy constructor/move constructor/destructor:

3df3102ff9 | 60847M (+0.24%) | 76762M (+0.36%) | 89525M (+0.23%) | 18523M (+0.02%) | 67841M (+0.21%) | 22586M (+0.01%) | 52507M (+0.24%) | 16184M (+0.04%) | 34917145M (+0.14%)
-- | -- | -- | -- | -- | -- | -- | -- | -- | --

https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2930: +0.56%

So it is an unavoidable cost :(

As for the memory usage, I can further reduce the size of ConstantFPRange from 56 bytes to 48 bytes, by storing MayBeQNaN and MayBeSNaN in unused bits of APFloat: https://github.com/llvm/llvm-project/commit/c4198037a84163632bfe3e3dd1f0e6506f4db2b8


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


More information about the llvm-commits mailing list