https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118042

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
Comment on attachment 59875
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59875
Proposed patch

>diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
>index ca763e1eb33..530e7e4fb54 100644
>--- a/gcc/config/i386/i386.cc
>+++ b/gcc/config/i386/i386.cc
>@@ -21274,12 +21270,13 @@ ix86_tieable_integer_mode_p (machine_mode mode)
>     {
>     case E_HImode:
>     case E_SImode:
>+    case E_DImode:
>       return true;
> 
>     case E_QImode:
>       return TARGET_64BIT || !TARGET_PARTIAL_REG_STALL;
> 
>-    case E_DImode:
>+    case E_TImode:
>       return TARGET_64BIT;
> 
>     default:

No, the above change is not beneficial. The compiler extends double-mode
register life time, resulting in failed fwprop. This can be seen with
gcc.target/i386/pr111267.c testcase:

in _.276r.cse1, (insn 19) in the following sequence is changed from:

    9: r109:TI=zero_extend(r110:DI)
      REG_DEAD r110:DI
   10: r109:TI=r109:TI&<0,0xffffffffffffffff>|zero_extend(r111:DI)<<0x40
      REG_DEAD r111:DI
   57: r131:DI=r109:TI#0
   58: r132:DI=r109:TI#8
      REG_DEAD r109:TI
   12: NOTE_INSN_FUNCTION_BEG
   16: r112:DI=r105:TI#0
      REG_DEAD r129:DI
   17: {r113:DI=r129:DI>>0x20;clobber flags:CC;}
      REG_DEAD r112:DI
      REG_UNUSED flags:CC
   18: r114:SI=r113:DI#0
      REG_DEAD r113:DI
   19: r115:DI=r132:DI
      REG_DEAD r132:DI

to:

   19: r115:DI=r109:TI#8
      REG_DEAD r132:DI

killing the profitability of fwprop of (insn 9) and (insn 10) results into
their uses.

Reply via email to