This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improve PR91257, specialize bitmap_ior_and_compl_into


On Tue, Jul 30, 2019 at 12:20:00PM +0200, Richard Biener wrote:
> +      if (compl_p)
> +	for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
> +	  {
> +	    and_elt.bits[ix] = b_elt->bits[ix] & ~c_elt->bits[ix];
> +	    overall |= and_elt.bits[ix];
> +	  }
> +      else
> +	for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
> +	  {
> +	    and_elt.bits[ix] = b_elt->bits[ix] & c_elt->bits[ix];
> +	    overall |= and_elt.bits[ix];
> +	  }

Might be more readable by moving the if (compl_p) into the loop,
just guarding the single statement that is different or even use a
BITMAP_WORD temporary to load c_elt->bits[ix] into it, then conditionally
complement and then use unconditionally in &.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]