Although there's no fundamental reason why shrink wrapping and speculation tracking...
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 2 Nov 2018 13:36:31 +0000 (13:36 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 2 Nov 2018 13:36:31 +0000 (13:36 +0000)
Although there's no fundamental reason why shrink wrapping and
speculation tracking are incompatible, a phase-ordering requirement
(we need to do speculation tracking before the final basic block
clean-up) means that the shrink wrapping pass can undo some of the
changes the speculation tracking pass makes.  The result is that the
tracking, while still safe is less comprehensive than we really want.

So to keep things simple, and because the tracking code is quite
expensive anyway, it seems best to just disable that pass when we are
tracking speculative execution.

 * config/aarch64/aarch64.c (aarch64_override_options): Disable
 shrink-wrapping when -mtrack-speculation.

From-SVN: r265747

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 6aa860d121d164cbf2ba91aa28abfea1ddf7f316..3ddb1492ede994cc6d9e270ba2baaf52b4e17892 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-02  Richard Earnshaw  <rearnsha@arm.com>
+
+       * config/aarch64/aarch64.c ((aarch64_override_options): Disable
+       shrink-wrapping when -mtrack-speculation.
+
 2018-11-02  Richard Biener  <rguenther@suse.de>
 
        * tree-ssa-coalesce.c (struct coalesce_list): Add obstack member.
index b44ee40115dce526c7cc302b2a47c28ab8b41508..c82c7b6aa2c3f346a551afdd368eff8bd7544d2c 100644 (file)
@@ -11407,6 +11407,12 @@ aarch64_override_options (void)
        || (aarch64_arch_string && valid_arch))
     gcc_assert (explicit_arch != aarch64_no_arch);
 
+  /* The pass to insert speculation tracking runs before
+     shrink-wrapping and the latter does not know how to update the
+     tracking status.  So disable it in this case.  */
+  if (aarch64_track_speculation)
+    flag_shrink_wrap = 0;
+
   aarch64_override_options_internal (&global_options);
 
   /* Save these options as the default ones in case we push and pop them later