[Mesa-dev] [PATCH] gallivm: set LLVMNoUnwindAttribute on all intrinsics

Tom Stellard tom at stellard.net
Tue Jul 5 16:26:54 UTC 2016


On Tue, Jul 05, 2016 at 11:36:03AM +0200, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> RadeonSI stats: Mostly 0% difference, but Valley shows a small improvement:
> 

Do you know which intrinsic this made a difference for?  I'm guessing
this is required for all the intrinsics defined in the backend (e.g. in
SIIntrinsiscs.td), and is a good reason why we should move those into
include/llvm/IR/IntrinsicsAMDGPUt.td.

-Tom

>  Application            Files    SGPRs     VGPRs   SpillSGPR SpillVGPR Code Size    LDS    Max Waves   Waits
>  unigine_valley           278    0.00 %   -0.29 %    0.00 %    0.00 %    0.01 %    0.00 %    0.17 %    0.00 %
> ---
>  src/gallium/auxiliary/gallivm/lp_bld_intr.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_intr.c b/src/gallium/auxiliary/gallivm/lp_bld_intr.c
> index 0a8f996..f12e735 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_intr.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_intr.c
> @@ -145,8 +145,10 @@ lp_build_intrinsic(LLVMBuilderRef builder,
>  
>        function = lp_declare_intrinsic(module, name, ret_type, arg_types, num_args);
>  
> -      if (attr)
> -          LLVMAddFunctionAttr(function, attr);
> +      /* NoUnwind indicates that the intrinsic never raises a C++ exception.
> +       * Set it for all intrinsics.
> +       */
> +      LLVMAddFunctionAttr(function, attr | LLVMNoUnwindAttribute);
>  
>        if (gallivm_debug & GALLIVM_DEBUG_IR) {
>           lp_debug_dump_value(function);
> -- 
> 2.7.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list