[llvm] [DA] Widening SCEV expressions in strong SIV test to prevent overflow (PR #164704)

Ehsan Amiri via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 23 08:23:09 PDT 2025


amehsan wrote:

> > For the cases I provided, where overflows are triggered by large constant values, I don't think they are practical enough to justify the added complexity of using wider integer types.
> 
> What is the concern here, is it compile time or something else? large constant values are very rare in practice, so I don't think that should prevent us from merging this PR.
> 
> While in principle I agree that the primary concern is correctness, and it is ok to give up on accuracy for correctness, if there is an approach that can give us more accurate results while preserving correctness, it should be preferrable.

[EDIT: I haven't checked the code but the complexity of arithmetic operations on the constants should be proportional to the number of bits after dropping all zero bits on the left side. If this is correct, then widening has no impact on complexity when  arithmetic operations on constants do not result in overflow.]

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


More information about the llvm-commits mailing list