> Date: Thu, 10 May 2018 07:23:05 -0500 > From: Segher Boessenkool <seg...@kernel.crashing.org>
> On Thu, May 10, 2018 at 10:33:39AM +0200, Marc Glisse wrote: > > int x, y; > > void f(int n){ > > int c = 3 << 20; > > x = n / c; > > y = x / c; > > } > Without the replacement we have two dependent divisions; with the > replacement we have two independent divisions, and that is much faster > on some (many?) systems (that can do two fixed-point divisions in parallel), > even if things do not simplify further. Sometimes the case is that way, sometimes yet another: your case can also increase register pressure, which is bad for some (many?) systems. brgds, H-P