diff mbox

[1/4] Make SRA scalarize constant-pool loads

Message ID CAGWvny=kHpZ5597FpNeZTGVwpUkxGqVaoNGMrvvWro8r+U1+PQ@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn Jan. 27, 2016, 7:39 p.m. UTC
The new sra-17.c and sra-18.c tests fail on AIX because the regex is
too restrictive -- AIX labels don't have exactly the same format.  On
AIX, the labels in the dumps look like "LC..0" instead of ".LC0".

This patch adds "*" and ".*" so that the "." prepended to LC is
optional and to allow characters between the "LC" and the "0".

I needed extra escapes for the sra-17.c line that matches multiple
times - for no apparent reason.

Okay?

Thanks, David

+/* { dg-final { scan-tree-dump-times "Removing load: a =
\\\*.*LC.*0;" 1 "esra" } } */
+/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*.*LC.*0\\.b\\\[0\\\]\\.f\\\[0\\\]\\.x" 1 "esra" } } */
+/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*.*LC.*0\\.b\\\[0\\\]\\.f\\\[1\\\]\\.x" 1 "esra" } } */
+/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*.*LC.*0\\.b\\\[1\\\]\\.f\\\[0\\\]\\.x" 1 "esra" } } */
+/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*.*LC.*0\\.b\\\[1\\\]\\.f\\\[1\\\]\\.x" 1 "esra" } } */

Comments

Jeff Law Jan. 27, 2016, 11:36 p.m. UTC | #1
On 01/27/2016 12:39 PM, David Edelsohn wrote:
> The new sra-17.c and sra-18.c tests fail on AIX because the regex is
> too restrictive -- AIX labels don't have exactly the same format.  On
> AIX, the labels in the dumps look like "LC..0" instead of ".LC0".
>
> This patch adds "*" and ".*" so that the "." prepended to LC is
> optional and to allow characters between the "LC" and the "0".
>
> I needed extra escapes for the sra-17.c line that matches multiple
> times - for no apparent reason.
The joys of expect/tcl.  I just keep escaping until the regex that I 
developed outside the suite works.  I have been trying to get away from 
using .* though.  The longest match nature sometimes gives surprising 
results.  In theory .*? ought to work better, but I haven't tried using 
it much.

Anyway, the change looks fine to me.

jeff
diff mbox

Patch

Index: sra-17.c
===================================================================
--- sra-17.c    (revision 232872)
+++ sra-17.c    (working copy)
@@ -15,5 +15,5 @@ 
   abort ();
 }

-/* { dg-final { scan-tree-dump-times "Removing load: a = \\\*.LC0;" 1
"esra" } } */
-/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ = \\\*.LC0\\\[" 4
"esra" } } */
+/* { dg-final { scan-tree-dump-times "Removing load: a =
\\\*.*LC.*0;" 1 "esra" } } */
+/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*\\.*LC\\.*0\\\[" 4 "esra" } } */
Index: sra-18.c
===================================================================
--- sra-18.c    (revision 232872)
+++ sra-18.c    (working copy)
@@ -21,8 +21,8 @@ 
   abort ();
 }

-/* { dg-final { scan-tree-dump-times "Removing load: a = \\\*.LC0;" 1
"esra" } } */
-/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*.LC0\\.b\\\[0\\\]\\.f\\\[0\\\]\\.x" 1 "esra" } } */
-/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*.LC0\\.b\\\[0\\\]\\.f\\\[1\\\]\\.x" 1 "esra" } } */
-/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*.LC0\\.b\\\[1\\\]\\.f\\\[0\\\]\\.x" 1 "esra" } } */
-/* { dg-final { scan-tree-dump-times "SR.\[0-9_\]+ =
\\\*.LC0\\.b\\\[1\\\]\\.f\\\[1\\\]\\.x" 1 "esra" } } */