ac/nir: set the noalias attribute on input pointers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 24 Jan 2018 22:26:18 +0000 (23:26 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 26 Jan 2018 11:14:28 +0000 (12:14 +0100)
This attribute is similar to the definition of restrict in
C99 and it might help LLVM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 5b8c346d0053dfe8cfc685557480f19fd2ad508e..6833439cc12cf75b33419cb71b1d87175a31cdd0 100644 (file)
@@ -326,6 +326,7 @@ create_llvm_function(LLVMContextRef ctx, LLVMModuleRef module,
                if (args->array_params_mask & (1 << i)) {
                        LLVMValueRef P = LLVMGetParam(main_function, i);
                        ac_add_function_attr(ctx, main_function, i + 1, AC_FUNC_ATTR_BYVAL);
+                       ac_add_function_attr(ctx, main_function, i + 1, AC_FUNC_ATTR_NOALIAS);
                        ac_add_attr_dereferenceable(P, UINT64_MAX);
                }
                else {