On Fri, Dec 4, 2020 at 6:42 PM Uros Bizjak <ubiz...@gmail.com> wrote: > > On Fri, Dec 4, 2020 at 6:41 PM Jakub Jelinek <ja...@redhat.com> wrote: > > > > On Fri, Dec 04, 2020 at 06:37:02PM +0100, Uros Bizjak wrote: > > > > + "(INTVAL (operands[3]) & (GET_MODE_BITSIZE (<MODE>mode) - 1)) > > > > + == GET_MODE_BITSIZE (<MODE>mode) - 1" > > > > + [(set (match_dup 4) (match_dup 1)) > > > > + (set (match_dup 0) > > > > + (any_rotate:SWI48 (match_dup 4) > > > > + (subreg:QI > > > > + (and:SI (match_dup 2) (match_dup 3)) 0)))] > > > > > > Don't we need > > > > > > (clobber (reg:CC FLAGS_REG))] > > > > > > here? (or is this one of the combine splitter peculiarities?) > > > > I was trying that first, but it didn't work. Without the > > clobber it actually works right, we don't have the rotate insn with the > > masking and no clobber, so in the end combiner does add the clobber there > > (or would fail it the clobber couldn't be added). > > I was not aware of that detail ...
That said, IMO, it would be better to rewrite other _mask and _mask_1 patterns that remove useless masking to combine splitter. Unfortunately, the combine splitter expects exactly two output instructions for some reason, but these patterns split to one instruction. Perhaps it is possible to relax this limitation of combine splitters and also allow one output instruction. Uros.