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: pr26026: udiv and umod optimization


Alan Modra <amodra@bigpond.net.au> writes:

> @@ -9121,8 +9121,27 @@ fold_binary (enum tree_code code, tree t
>        return NULL_TREE;
>  
>      case TRUNC_DIV_EXPR:
> -    case ROUND_DIV_EXPR:
>      case FLOOR_DIV_EXPR:
> +      /* Simplify A / (B << N) where A and B are positive and B is
> +	 a power of 2, to A >> (N + log2(B)).  */
[...]
> +      /* Fall thru */
> +
> +    case ROUND_DIV_EXPR:
>      case CEIL_DIV_EXPR:
>      case EXACT_DIV_EXPR:
>        if (integer_onep (arg1))

Shouldn't this optimization also be applicable to EXACT_DIV_EXPR?

-- 
	Falk


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