gallivm: remove lp_add_attr_dereferenceable in favor of amd/common
authorMarek Olšák <marek.olsak@amd.com>
Tue, 21 Mar 2017 22:13:46 +0000 (23:13 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 22 Mar 2017 16:54:40 +0000 (17:54 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
src/gallium/auxiliary/gallivm/lp_bld_misc.h
src/gallium/drivers/radeonsi/si_shader.c

index 444686fdc799497d84af72e33cc9810aaa7c35e7..2a388cbfaf2478a9f86d4d9a1c0fe896b05c67f8 100644 (file)
@@ -747,17 +747,6 @@ lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr)
    delete reinterpret_cast<BaseMemoryManager*>(memorymgr);
 }
 
-extern "C" void
-lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)
-{
-#if HAVE_LLVM >= 0x0306
-   llvm::Argument *A = llvm::unwrap<llvm::Argument>(val);
-   llvm::AttrBuilder B;
-   B.addDereferenceableAttr(bytes);
-   A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1,  B));
-#endif
-}
-
 extern "C" LLVMValueRef
 lp_get_called_value(LLVMValueRef call)
 {
index 6abb30d73fa7fd182a4477fe892e3790d81e017c..dafb4cfe06860fb82c3768fc81854d7250474e49 100644 (file)
@@ -73,9 +73,6 @@ lp_get_default_memory_manager();
 extern void
 lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr);
 
-extern void
-lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes);
-
 extern LLVMValueRef
 lp_get_called_value(LLVMValueRef call);
 
index b5cb41d33c35298082917c4b6f6d75c0c325c5af..46c7d4117042dc7e04f1c9e4f3cb6a728367a78a 100644 (file)
@@ -5226,7 +5226,7 @@ static void si_create_function(struct si_shader_context *ctx,
                if (LLVMGetTypeKind(LLVMTypeOf(P)) == LLVMPointerTypeKind) {
                        lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_BYVAL);
                        lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_NOALIAS);
-                       lp_add_attr_dereferenceable(P, UINT64_MAX);
+                       ac_add_attr_dereferenceable(P, UINT64_MAX);
                } else
                        lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_INREG);
        }