« Return to Thread: [PATCH] Fix PR37053: Move tweaks of commutative precedence to target hook

Re: [PATCH] Fix PR37053: Move tweaks of commutative precedence to target hook

by Maxim Kuvyrkov-2 :: Rate this Message:

Reply to Author | View in Thread

Peter Bergner wrote:

> On Fri, 2009-06-26 at 20:04 +0400, Maxim Kuvyrkov wrote:
>> Peter Bergner wrote:
>>
>>> In the mean time, I have asked Luis to test your patch on POWER6 to ensure
>>> there are no performance degradations.  It doesn't look like there should
>>> be, but...
>> The assembler should be exactly the same.  If it isn't, then there's a
>> bug in the patch.
>
> That's exactly what we're testing for.  With your patch, we'll always
> decrement the precedence value if we have a pointer.  With the old code,
> that occurred only for RTX_OBJ.  Maybe that's the only case were we'll
> see pointers, but I personally don't know that for sure.

I tried to avoid any differences from the current behavior ...

+static int
+rs6000_commutative_operand_precedence (const_rtx op, int value)
+{
+  /* Prefer pointer objects over non pointer objects.
+     For rationale see PR28690.  */
+  if (GET_RTX_CLASS (GET_CODE (op)) == RTX_OBJ

... and the patch decrements the value only for RTX_OBJs.

+      && ((REG_P (op) && REG_POINTER (op))
+  || (MEM_P (op) && MEM_POINTER (op))))
+    --value;
+
+  return value;
+}

Peter and Luis,

In any case, thanks for testing the patch on PowerPC.

--
Maxim

 « Return to Thread: [PATCH] Fix PR37053: Move tweaks of commutative precedence to target hook