diff mbox

[rtl] : Mode-switching: Mark block as nontransparent if its exiting mode != no_mode

Message ID CAFULd4YkQkAa3pXJtK9oJpsjhsKkJ5mKTt0VYxrsHdT7VBL93Q@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Nov. 8, 2013, 9:25 a.m. UTC
Hello!

Attached patch fixes an oversight in mode-switching. For blocks
without ANY mode requirements, we have to consider instructions with
MODE_AFTER mode changes. If the exiting mode from the block is
different that no_mode (the mode we start), we have to mark the block
as nontransparent.

2013-11-08  Uros Bizjak  <ubizjak@gmail.com>

    * mode-switching.c (optimize_mode_switching): Mark block as
    nontransparent, if last_mode at block exit is different from no_mode.

Bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}
core-avx-i configured bootstrap.

OK for mainline and branches?

Thanks,
Uros.

Comments

Eric Botcazou Nov. 10, 2013, 4:45 p.m. UTC | #1
> Attached patch fixes an oversight in mode-switching. For blocks
> without ANY mode requirements, we have to consider instructions with
> MODE_AFTER mode changes. If the exiting mode from the block is
> different that no_mode (the mode we start), we have to mark the block
> as nontransparent.
> 
> 2013-11-08  Uros Bizjak  <ubizjak@gmail.com>
> 
>     * mode-switching.c (optimize_mode_switching): Mark block as
>     nontransparent, if last_mode at block exit is different from no_mode.
> 
> Bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}
> core-avx-i configured bootstrap.
> 
> OK for mainline and branches?

OK for mainline and 4.8 branch, if you complete the comment just above, for 
example "from no_mode, in which case we need to..."
Uros Bizjak Nov. 10, 2013, 6:40 p.m. UTC | #2
On Sun, Nov 10, 2013 at 5:45 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Attached patch fixes an oversight in mode-switching. For blocks
>> without ANY mode requirements, we have to consider instructions with
>> MODE_AFTER mode changes. If the exiting mode from the block is
>> different that no_mode (the mode we start), we have to mark the block
>> as nontransparent.
>>
>> 2013-11-08  Uros Bizjak  <ubizjak@gmail.com>
>>
>>     * mode-switching.c (optimize_mode_switching): Mark block as
>>     nontransparent, if last_mode at block exit is different from no_mode.
>>
>> Bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}
>> core-avx-i configured bootstrap.
>>
>> OK for mainline and branches?
>
> OK for mainline and 4.8 branch, if you complete the comment just above, for
> example "from no_mode, in which case we need to..."

Thanks, I have committed attached patch. I will wait a couple of days
to see if the patch causes any problems with other mode-switching
targets before backporting it to 4.8.

Uros.
diff mbox

Patch

Index: mode-switching.c
===================================================================
--- mode-switching.c	(revision 204496)
+++ mode-switching.c	(working copy)
@@ -577,6 +577,8 @@  optimize_mode_switching (void)
 	    {
 	      ptr = new_seginfo (no_mode, BB_END (bb), bb->index, live_now);
 	      add_seginfo (info + bb->index, ptr);
+	      if (last_mode != no_mode)
+		bitmap_clear_bit (transp[bb->index], j);
 	    }
 	}
 #if defined (MODE_ENTRY) && defined (MODE_EXIT)