On Wed, 25 Nov 2015, Marc Glisse wrote: > On Wed, 25 Nov 2015, Jakub Jelinek wrote: > > > > The same is true whether we write it b > a or (a - b) > a (I don't think > > > PRE > > > + SCCVN avoid increasing register pressure). > > > > > > > So, I'd really prefer doing x-y>x to y>x only for single use. > > > > > > Ok (for now). > > > > Do you plan to work on that (my match.pd experience is smaller than yours), > > or should I add to my todo list? > > Are we talking stage 3 or next stage 1? If you want something for stage 3, I > think you'll have to do it, it shouldn't be much longer than > > (for cmp (gt le) > (simplify > (cmp (minus:s @0 @1) @0) > (if (TYPE_UNSIGNED (TREE_TYPE (@0))) > (cmp @1 @0)))) > > and a similar one for x<y-x. (I don't think TYPE_UNSIGNED needs protection > against floats or whatever, but I could be wrong)
floats should be fine here. But eventually saturating types need to be excluded? Note that the :s on the minus has no effect as the result is a single operation. If you want to restrict this nevertheless you need a && single_use (@2) and capture the minus with (minus@2 @0 @1) instead. Richard.