[7/7] radeonsi: don't use the low-optimizing compiler on LLVM 9

Submitted by Marek Olšák on June 13, 2019, 12:40 a.m.

Details

Message ID 20190613004041.32721-7-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák June 13, 2019, 12:40 a.m.
From: Marek Olšák <marek.olsak@amd.com>

The compilation is faster on LLVM 9.
---
 src/gallium/drivers/radeonsi/si_pipe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 8527999645b..d2fd058f2cd 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -115,21 +115,22 @@  static const struct debug_named_value debug_options[] = {
 
 	DEBUG_NAMED_VALUE_END /* must be last */
 };
 
 static void si_init_compiler(struct si_screen *sscreen,
 			     struct ac_llvm_compiler *compiler)
 {
 	/* Only create the less-optimizing version of the compiler on APUs
 	 * predating Ryzen (Raven). */
 	bool create_low_opt_compiler = !sscreen->info.has_dedicated_vram &&
-				       sscreen->info.chip_class <= GFX8;
+				       sscreen->info.chip_class <= GFX8 &&
+				       HAVE_LLVM < 0x0900;
 
 	enum ac_target_machine_options tm_options =
 		(sscreen->debug_flags & DBG(SI_SCHED) ? AC_TM_SISCHED : 0) |
 		(sscreen->debug_flags & DBG(GISEL) ? AC_TM_ENABLE_GLOBAL_ISEL : 0) |
 		(sscreen->info.chip_class >= GFX9 ? AC_TM_FORCE_ENABLE_XNACK : 0) |
 		(sscreen->info.chip_class < GFX9 ? AC_TM_FORCE_DISABLE_XNACK : 0) |
 		(!sscreen->llvm_has_working_vgpr_indexing ? AC_TM_PROMOTE_ALLOCA_TO_SCRATCH : 0) |
 		(sscreen->debug_flags & DBG(CHECK_IR) ? AC_TM_CHECK_IR : 0) |
 		(create_low_opt_compiler ? AC_TM_CREATE_LOW_OPT : 0);
 

Comments

For the series

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>

on Polaris 20

Have a look here, too.
https://www.phoronix.com/forums/forum/phoronix/latest-phoronix-articles/1106085-linux-kernel-set-to-expose-hidden-nvidia-hda-controllers-helping-laptop-users?p=1106199#post1106199

Dieter

Am 13.06.2019 02:40, schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak@amd.com>
> 
> The compilation is faster on LLVM 9.
> ---
>  src/gallium/drivers/radeonsi/si_pipe.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c
> b/src/gallium/drivers/radeonsi/si_pipe.c
> index 8527999645b..d2fd058f2cd 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.c
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> @@ -115,21 +115,22 @@ static const struct debug_named_value 
> debug_options[] = {
> 
>  	DEBUG_NAMED_VALUE_END /* must be last */
>  };
> 
>  static void si_init_compiler(struct si_screen *sscreen,
>  			     struct ac_llvm_compiler *compiler)
>  {
>  	/* Only create the less-optimizing version of the compiler on APUs
>  	 * predating Ryzen (Raven). */
>  	bool create_low_opt_compiler = !sscreen->info.has_dedicated_vram &&
> -				       sscreen->info.chip_class <= GFX8;
> +				       sscreen->info.chip_class <= GFX8 &&
> +				       HAVE_LLVM < 0x0900;
> 
>  	enum ac_target_machine_options tm_options =
>  		(sscreen->debug_flags & DBG(SI_SCHED) ? AC_TM_SISCHED : 0) |
>  		(sscreen->debug_flags & DBG(GISEL) ? AC_TM_ENABLE_GLOBAL_ISEL : 0) |
>  		(sscreen->info.chip_class >= GFX9 ? AC_TM_FORCE_ENABLE_XNACK : 0) |
>  		(sscreen->info.chip_class < GFX9 ? AC_TM_FORCE_DISABLE_XNACK : 0) |
>  		(!sscreen->llvm_has_working_vgpr_indexing ?
> AC_TM_PROMOTE_ALLOCA_TO_SCRATCH : 0) |
>  		(sscreen->debug_flags & DBG(CHECK_IR) ? AC_TM_CHECK_IR : 0) |
>  		(create_low_opt_compiler ? AC_TM_CREATE_LOW_OPT : 0);
Hello Marek,

is this (#7) obsolete, now?
Kind reminder.

Thanks,
Dieter

Am 13.06.2019 02:40, schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak@amd.com>
> 
> The compilation is faster on LLVM 9.
> ---
>  src/gallium/drivers/radeonsi/si_pipe.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c
> b/src/gallium/drivers/radeonsi/si_pipe.c
> index 8527999645b..d2fd058f2cd 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.c
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> @@ -115,21 +115,22 @@ static const struct debug_named_value 
> debug_options[] = {
> 
>  	DEBUG_NAMED_VALUE_END /* must be last */
>  };
> 
>  static void si_init_compiler(struct si_screen *sscreen,
>  			     struct ac_llvm_compiler *compiler)
>  {
>  	/* Only create the less-optimizing version of the compiler on APUs
>  	 * predating Ryzen (Raven). */
>  	bool create_low_opt_compiler = !sscreen->info.has_dedicated_vram &&
> -				       sscreen->info.chip_class <= GFX8;
> +				       sscreen->info.chip_class <= GFX8 &&
> +				       HAVE_LLVM < 0x0900;
> 
>  	enum ac_target_machine_options tm_options =
>  		(sscreen->debug_flags & DBG(SI_SCHED) ? AC_TM_SISCHED : 0) |
>  		(sscreen->debug_flags & DBG(GISEL) ? AC_TM_ENABLE_GLOBAL_ISEL : 0) |
>  		(sscreen->info.chip_class >= GFX9 ? AC_TM_FORCE_ENABLE_XNACK : 0) |
>  		(sscreen->info.chip_class < GFX9 ? AC_TM_FORCE_DISABLE_XNACK : 0) |
>  		(!sscreen->llvm_has_working_vgpr_indexing ?
> AC_TM_PROMOTE_ALLOCA_TO_SCRATCH : 0) |
>  		(sscreen->debug_flags & DBG(CHECK_IR) ? AC_TM_CHECK_IR : 0) |
>  		(create_low_opt_compiler ? AC_TM_CREATE_LOW_OPT : 0);