Patchwork Optimize in RTL vector AND { -1, -1, ... }, IOR { -1, -1, ... } and XOR { -1, -1, ... } (take 2)

login
register
mail settings
Submitter Bernd Schmidt
Date Nov. 11, 2011, 4:30 p.m.
Message ID <4EBD4D9F.8040008@codesourcery.com>
Download mbox | patch
Permalink /patch/125209/
State New
Headers show

Comments

Bernd Schmidt - Nov. 11, 2011, 4:30 p.m.
On 10/31/11 14:24, Henderson, Stuart wrote:
>> 2011-09-26  Jakub Jelinek  <jakub@redhat.com>
>>
>>       * rtl.h (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE
>>       from 3 x MAX_MACHINE_MODE.
>>       (CONSTM1_RTX): Define.
>>       * emit-rtl.c (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE
>>       from 3 x MAX_MACHINE_MODE.
>>       (gen_rtx_CONST_VECTOR): Use CONSTM1_RTX if all inner constants are
>>       CONSTM1_RTX.
>>       (init_emit_once): Initialize CONSTM1_RTX for MODE_INT and
>>       MODE_VECTOR_INT modes.
>>       * simplify-rtx.c (simplify_binary_operation_1) <case IOR, XOR, AND>:
>>       Optimize if one operand is CONSTM1_RTX.
>>       * config/i386/i386.c (ix86_expand_sse_movcc): Optimize mask ? -1 : x
>>       into mask | x.
> 
> FYI - this patch (179238) breaks the Blackfin compiler build with an internal compiler error during configure of libgcc:
> conftest.c:1:0: internal compiler error: in gen_const_vector, at emit-rtl.c:5491

This fixes it. Looks obvious enough to me; hence will commit Monday if
no objections.


Bernd
* emit-rtl.c (init_emit_once): Initialize const_tiny_rtx[3] for
	partial integer modes.

Patch

Index: emit-rtl.c
===================================================================
--- emit-rtl.c	(revision 181252)
+++ emit-rtl.c	(working copy)
@@ -5706,6 +5706,11 @@  init_emit_once (void)
        mode = GET_MODE_WIDER_MODE (mode))
     const_tiny_rtx[3][(int) mode] = constm1_rtx;
 
+  for (mode = GET_CLASS_NARROWEST_MODE (MODE_PARTIAL_INT);
+       mode != VOIDmode;
+       mode = GET_MODE_WIDER_MODE (mode))
+    const_tiny_rtx[3][(int) mode] = constm1_rtx;
+      
   for (mode = GET_CLASS_NARROWEST_MODE (MODE_COMPLEX_INT);
        mode != VOIDmode;
        mode = GET_MODE_WIDER_MODE (mode))