[Mesa-dev] [PATCH 1/9] ac: completely remove +auto-waitcnt-before-barrier

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Aug 21 07:02:16 UTC 2018


Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 8/21/18 5:23 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> it causes corruption on several different GPU generations.
> 
> Cc: 18.2 <mesa-stable at lists.freedesktop.org>
> ---
>   src/amd/common/ac_llvm_util.c          | 7 ++-----
>   src/amd/common/ac_llvm_util.h          | 1 -
>   src/gallium/drivers/radeonsi/si_pipe.c | 1 -
>   3 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c
> index 42bc538b4d7..cd3525187a0 100644
> --- a/src/amd/common/ac_llvm_util.c
> +++ b/src/amd/common/ac_llvm_util.c
> @@ -142,30 +142,27 @@ const char *ac_get_llvm_processor_name(enum radeon_family family)
>   
>   static LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family,
>   						     enum ac_target_machine_options tm_options,
>   						     LLVMCodeGenOptLevel level,
>   						     const char **out_triple)
>   {
>   	assert(family >= CHIP_TAHITI);
>   	char features[256];
>   	const char *triple = (tm_options & AC_TM_SUPPORTS_SPILL) ? "amdgcn-mesa-mesa3d" : "amdgcn--";
>   	LLVMTargetRef target = ac_get_llvm_target(triple);
> -	bool barrier_does_waitcnt = (tm_options & AC_TM_AUTO_WAITCNT_BEFORE_BARRIER) &&
> -				    family != CHIP_VEGA20;
>   
>   	snprintf(features, sizeof(features),
> -		 "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s%s%s",
> +		 "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s%s",
>   		 tm_options & AC_TM_SISCHED ? ",+si-scheduler" : "",
>   		 tm_options & AC_TM_FORCE_ENABLE_XNACK ? ",+xnack" : "",
>   		 tm_options & AC_TM_FORCE_DISABLE_XNACK ? ",-xnack" : "",
> -		 tm_options & AC_TM_PROMOTE_ALLOCA_TO_SCRATCH ? ",-promote-alloca" : "",
> -		 barrier_does_waitcnt ? ",+auto-waitcnt-before-barrier" : "");
> +		 tm_options & AC_TM_PROMOTE_ALLOCA_TO_SCRATCH ? ",-promote-alloca" : "");
>   	
>   	LLVMTargetMachineRef tm = LLVMCreateTargetMachine(
>   	                             target,
>   	                             triple,
>   	                             ac_get_llvm_processor_name(family),
>   				     features,
>   	                             level,
>   	                             LLVMRelocDefault,
>   	                             LLVMCodeModelDefault);
>   
> diff --git a/src/amd/common/ac_llvm_util.h b/src/amd/common/ac_llvm_util.h
> index e252bed3bb6..eaf5f21876b 100644
> --- a/src/amd/common/ac_llvm_util.h
> +++ b/src/amd/common/ac_llvm_util.h
> @@ -58,21 +58,20 @@ enum ac_func_attr {
>   
>   enum ac_target_machine_options {
>   	AC_TM_SUPPORTS_SPILL = (1 << 0),
>   	AC_TM_SISCHED = (1 << 1),
>   	AC_TM_FORCE_ENABLE_XNACK = (1 << 2),
>   	AC_TM_FORCE_DISABLE_XNACK = (1 << 3),
>   	AC_TM_PROMOTE_ALLOCA_TO_SCRATCH = (1 << 4),
>   	AC_TM_CHECK_IR = (1 << 5),
>   	AC_TM_ENABLE_GLOBAL_ISEL = (1 << 6),
>   	AC_TM_CREATE_LOW_OPT = (1 << 7),
> -	AC_TM_AUTO_WAITCNT_BEFORE_BARRIER = (1 << 8),
>   };
>   
>   enum ac_float_mode {
>   	AC_FLOAT_MODE_DEFAULT,
>   	AC_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH,
>   	AC_FLOAT_MODE_UNSAFE_FP_MATH,
>   };
>   
>   /* Per-thread persistent LLVM objects. */
>   struct ac_llvm_compiler {
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
> index 4327a3f749b..13fcf1f3aea 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.c
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> @@ -108,21 +108,20 @@ static const struct debug_named_value debug_options[] = {
>   
>   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 <= VI;
>   
>   	enum ac_target_machine_options tm_options =
> -		AC_TM_AUTO_WAITCNT_BEFORE_BARRIER |
>   		(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);
>   
>   	ac_init_llvm_once();
>   	ac_init_llvm_compiler(compiler, true, sscreen->info.family, tm_options);
> 


More information about the mesa-dev mailing list