diff mbox

wide-int, loop

Message ID 8AB27431-687D-4AF0-BB77-A9325DF09301@comcast.net
State New
Headers show

Commit Message

Mike Stump Jan. 2, 2014, 4:27 a.m. UTC
On Nov 26, 2013, at 1:14 AM, Richard Biener <richard.guenther@gmail.com> wrote:
>>> @@ -2662,8 +2661,8 @@ iv_number_of_iterations (struct loop *loop, rtx
>>> insn, rtx condition,
>>>        iv1.step = const0_rtx;
>>>        if (INTVAL (iv0.step) < 0)
>>>         {
>>> -         iv0.step = simplify_gen_unary (NEG, comp_mode, iv0.step, mode);
>>> -         iv1.base = simplify_gen_unary (NEG, comp_mode, iv1.base, mode);
>>> +         iv0.step = simplify_gen_unary (NEG, comp_mode, iv0.step,
>>> comp_mode);
>>> +         iv1.base = simplify_gen_unary (NEG, comp_mode, iv1.base,
>>> comp_mode);
>>>         }
>>>        iv0.step = lowpart_subreg (mode, iv0.step, comp_mode);
>>> 
>>> separate bugfix?
>> 
>> most likely.    i will submit separately.
>> 
>>> @@ -1378,7 +1368,8 @@ decide_peel_simple (struct loop *loop, int flags)
>>>    /* If we have realistic estimate on number of iterations, use it.  */
>>>    if (get_estimated_loop_iterations (loop, &iterations))
>>>      {
>>> -      if (double_int::from_shwi (npeel).ule (iterations))
>>> +      /* TODO: unsigned/signed confusion */
>>> +      if (wi::leu_p (npeel, iterations))
>>>         {
>>>           if (dump_file)
>>>             {
>>> 
>>> what does this refer to?  npeel is unsigned.
>> 
>> 
>> it was the fact that they were doing the from_shwi and then using an
>> unsigned test.
> 
> Ah - probably a typo.  Please just remove the "TODO".

Done:


>>> Otherwise looks good to me.

Kenny hasn't yet integrated the first into trunk, but I'd like to ask anyway:

Ok?

Comments

Richard Biener Jan. 9, 2014, 3:20 p.m. UTC | #1
On Thu, Jan 2, 2014 at 5:27 AM, Mike Stump <mikestump@comcast.net> wrote:
> On Nov 26, 2013, at 1:14 AM, Richard Biener <richard.guenther@gmail.com> wrote:
>>>> @@ -2662,8 +2661,8 @@ iv_number_of_iterations (struct loop *loop, rtx
>>>> insn, rtx condition,
>>>>        iv1.step = const0_rtx;
>>>>        if (INTVAL (iv0.step) < 0)
>>>>         {
>>>> -         iv0.step = simplify_gen_unary (NEG, comp_mode, iv0.step, mode);
>>>> -         iv1.base = simplify_gen_unary (NEG, comp_mode, iv1.base, mode);
>>>> +         iv0.step = simplify_gen_unary (NEG, comp_mode, iv0.step,
>>>> comp_mode);
>>>> +         iv1.base = simplify_gen_unary (NEG, comp_mode, iv1.base,
>>>> comp_mode);
>>>>         }
>>>>        iv0.step = lowpart_subreg (mode, iv0.step, comp_mode);
>>>>
>>>> separate bugfix?
>>>
>>> most likely.    i will submit separately.
>>>
>>>> @@ -1378,7 +1368,8 @@ decide_peel_simple (struct loop *loop, int flags)
>>>>    /* If we have realistic estimate on number of iterations, use it.  */
>>>>    if (get_estimated_loop_iterations (loop, &iterations))
>>>>      {
>>>> -      if (double_int::from_shwi (npeel).ule (iterations))
>>>> +      /* TODO: unsigned/signed confusion */
>>>> +      if (wi::leu_p (npeel, iterations))
>>>>         {
>>>>           if (dump_file)
>>>>             {
>>>>
>>>> what does this refer to?  npeel is unsigned.
>>>
>>>
>>> it was the fact that they were doing the from_shwi and then using an
>>> unsigned test.
>>
>> Ah - probably a typo.  Please just remove the "TODO".
>
> Done:
>
> Index: loop-unroll.c
> ===================================================================
> --- loop-unroll.c       (revision 206183)
> +++ loop-unroll.c       (working copy)
> @@ -1371,7 +1371,6 @@ decide_peel_simple (struct loop *loop, i
>    /* If we have realistic estimate on number of iterations, use it.  */
>    if (get_estimated_loop_iterations (loop, &iterations))
>      {
> -      /* TODO: unsigned/signed confusion */
>        if (wi::leu_p (npeel, iterations))
>         {
>           if (dump_file)
>
>>>> Otherwise looks good to me.
>
> Kenny hasn't yet integrated the first into trunk, but I'd like to ask anyway:
>
> Ok?

Ok.

Richard.
diff mbox

Patch

Index: loop-unroll.c
===================================================================
--- loop-unroll.c	(revision 206183)
+++ loop-unroll.c	(working copy)
@@ -1371,7 +1371,6 @@  decide_peel_simple (struct loop *loop, i
   /* If we have realistic estimate on number of iterations, use it.  */
   if (get_estimated_loop_iterations (loop, &iterations))
     {
-      /* TODO: unsigned/signed confusion */
       if (wi::leu_p (npeel, iterations))
 	{
 	  if (dump_file)