Re: [PATCH] Improved constant folding for scalar evolution.

2022-02-20 Thread Richard Biener via Gcc-patches
On Sun, Feb 20, 2022 at 2:50 PM Roger Sayle wrote: > > > This patch adds a small (follow-up) optimization to chrec_apply for > linear chrecs to clean-up the final value expressions sometimes generated > by GCC's scalar evolution pass. The transformation of A+(X-1)*A into > A*X is usually unsafe

[PATCH] Improved constant folding for scalar evolution.

2022-02-20 Thread Roger Sayle
This patch adds a small (follow-up) optimization to chrec_apply for linear chrecs to clean-up the final value expressions sometimes generated by GCC's scalar evolution pass. The transformation of A+(X-1)*A into A*X is usually unsafe with respect to overflow (see PR92712), and so can't be