From 6e2b9fd07171bf9b082c3b0cd218b35034d8ec15 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 21 Mar 2017 23:13:46 +0100 Subject: [PATCH] gallivm: remove lp_add_attr_dereferenceable in favor of amd/common MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle Reviewed-by: Dave Airlie --- src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 11 ----------- src/gallium/auxiliary/gallivm/lp_bld_misc.h | 3 --- src/gallium/drivers/radeonsi/si_shader.c | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index 444686fdc79..2a388cbfaf2 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -747,17 +747,6 @@ lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr) delete reinterpret_cast(memorymgr); } -extern "C" void -lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes) -{ -#if HAVE_LLVM >= 0x0306 - llvm::Argument *A = llvm::unwrap(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) { diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h b/src/gallium/auxiliary/gallivm/lp_bld_misc.h index 6abb30d73fa..dafb4cfe068 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.h @@ -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); diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index b5cb41d33c3..46c7d411704 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -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); } -- 2.30.2