diff mbox

[AArch64] Always register fma_steering pass but gate it on the target option instead

Message ID 556F2538.5080902@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov June 3, 2015, 4:03 p.m. UTC
Hi all,

This patch is part of a few prerequisites to get target attribute support in AArch64.
This registers the fma steering pass unconditionally but gates its execution instead.
This way the pass will be available if during the compilation of a file the user
specifies cortex-a57 tuning using a target attribute or pragma, or whatever.

Bootstrapped and tested on aarch64. Confirmed that the pass runs only when expected.

Ok for trunk?

Thanks,
Kyrill

2015-06-03  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/aarch64/aarch64.c (aarch64_override_options): Unconditionally
     register fma steering pass.
     * config/aarch64/cortex-a57-fma-steering.c (gate): Add gating on
     AARCH64_TUNE_FMA_STEERING.

Comments

Richard Earnshaw June 4, 2015, 8:25 a.m. UTC | #1
On 03/06/15 17:03, Kyrill Tkachov wrote:
> Hi all,
> 
> This patch is part of a few prerequisites to get target attribute support in AArch64.
> This registers the fma steering pass unconditionally but gates its execution instead.
> This way the pass will be available if during the compilation of a file the user
> specifies cortex-a57 tuning using a target attribute or pragma, or whatever.
> 
> Bootstrapped and tested on aarch64. Confirmed that the pass runs only when expected.
> 
> Ok for trunk?
> 
> Thanks,
> Kyrill
> 
> 2015-06-03  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>      * config/aarch64/aarch64.c (aarch64_override_options): Unconditionally
>      register fma steering pass.
>      * config/aarch64/cortex-a57-fma-steering.c (gate): Add gating on
>      AARCH64_TUNE_FMA_STEERING.
> 
> 

OK.

R.

> aarch64-register-fma-steering.patch
> 
> 
> commit 58e5b728ae7f4cf4d00b732492b455bd6ca7feb6
> Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
> Date:   Fri May 8 17:16:51 2015 +0100
> 
>     [AArch64] Always register fma_steering pass but gate it on the target option instead
> 
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index 53aa4a8..1301e8b 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -7255,8 +7255,7 @@ aarch64_override_options (void)
>  #endif
>      }
>  
> -  if (AARCH64_TUNE_FMA_STEERING)
> -    aarch64_register_fma_steering ();
> +  aarch64_register_fma_steering ();
>  
>    aarch64_override_options_after_change ();
>  }
> diff --git a/gcc/config/aarch64/cortex-a57-fma-steering.c b/gcc/config/aarch64/cortex-a57-fma-steering.c
> index 3d7557a..5228b57 100644
> --- a/gcc/config/aarch64/cortex-a57-fma-steering.c
> +++ b/gcc/config/aarch64/cortex-a57-fma-steering.c
> @@ -1053,7 +1053,7 @@ public:
>    /* opt_pass methods: */
>    virtual bool gate (function *)
>      {
> -      return optimize >= 2;
> +      return AARCH64_TUNE_FMA_STEERING && optimize >= 2;
>      }
>  
>    virtual unsigned int execute (function *)
>
diff mbox

Patch

commit 58e5b728ae7f4cf4d00b732492b455bd6ca7feb6
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Fri May 8 17:16:51 2015 +0100

    [AArch64] Always register fma_steering pass but gate it on the target option instead

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 53aa4a8..1301e8b 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -7255,8 +7255,7 @@  aarch64_override_options (void)
 #endif
     }
 
-  if (AARCH64_TUNE_FMA_STEERING)
-    aarch64_register_fma_steering ();
+  aarch64_register_fma_steering ();
 
   aarch64_override_options_after_change ();
 }
diff --git a/gcc/config/aarch64/cortex-a57-fma-steering.c b/gcc/config/aarch64/cortex-a57-fma-steering.c
index 3d7557a..5228b57 100644
--- a/gcc/config/aarch64/cortex-a57-fma-steering.c
+++ b/gcc/config/aarch64/cortex-a57-fma-steering.c
@@ -1053,7 +1053,7 @@  public:
   /* opt_pass methods: */
   virtual bool gate (function *)
     {
-      return optimize >= 2;
+      return AARCH64_TUNE_FMA_STEERING && optimize >= 2;
     }
 
   virtual unsigned int execute (function *)