Re: [PATCH 3/9] simplify ((A & M) | B ) & M' even when (M & M') != 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 08, 2018 at 04:35:22PM +0200, Luc Van Oostenryck wrote:
> Currently, in simplify_and_or_mask(), the simplification
> is only done when (M & M') == 0.
> 
> However it can be simplified anytime when (M & M') != M,
> resulting in a smaller mask.
> 
> Allow the mask simplification when (M & M') != M.
> ---
>  simplify.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/simplify.c b/simplify.c
> index 6b813d4f9..6a68ee5b4 100644
> --- a/simplify.c
> +++ b/simplify.c
> @@ -833,9 +833,12 @@ static int simplify_and_or_mask(struct instruction *insn, pseudo_t and, pseudo_t
>  		return 0;
>  	omask = def->src2->value;
>  	nmask = omask & mask;
> +	if (nmask == omask)
> +		return 0;
>  	if (nmask == 0)
>  		return replace_pseudo(insn, &insn->src1, other);
> -	return 0;

There is a
	if (nbr_users(insn->src1) > 1)
		return 0;
missing here.

This make the whole series incorrect.
V2 will be rolled out later.

> +	def->src2 = value_pseudo(nmask);
> +	return REPEAT_CSE;
>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux