[llvm] [SCCP] Extend `visitBinaryOperator` to overflowing binary ops (PR #84470)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 9 00:57:41 PST 2024


nikic wrote:

> > Some compile-time overhead, but probably acceptable: https://llvm-compile-time-tracker.com/compare.php?from=eb8f379567e8d014194faefe02ce92813e237afc&to=52f204492d88fad02ef9d510e23be3ceee63671c&stat=instructions:u Wonder whether there is any optimization potential in the ConstantRange implementation.
> 
> Out of curiosity, I'm wondering why such minor modification on SCCP brings obivous overhead on compile-time. From my perspective, this patch only replaces `add/sub` with `NoWrap` implementation.

Basically yes, but the NoWrap implementations are just more expensive. add() on ConstantRange is just two additions. With nowrap flags, you take a normal add() and combine it with multiple saturating additions and range intersections.

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


More information about the llvm-commits mailing list