From: Vinson Lee Date: Thu, 12 Dec 2019 01:34:30 +0000 (-0800) Subject: swr: Fix build with llvm-10.0. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d20b5cba5760177dbd8500cd8b614e66d5ac9ae;p=mesa.git swr: Fix build with llvm-10.0. Fix build error after llvm-10.0 commit ("1b2842bf902a [Alignment][NFC] CreateMemSet use MaybeAlign"). ../src/gallium/drivers/swr/swr_shader.cpp: In member function ‘void (* BuilderSWR::CompileGS(swr_context*, swr_jit_gs_key&))(HANDLE, HANDLE, SWR_GS_CONTEXT*)’: ../src/gallium/drivers/swr/swr_shader.cpp:738:65: error: no matching function for call to ‘BuilderSWR::MEMSET(llvm::Value*&, llvm::Constant*, int, long unsigned int)’ MEMSET(pStream, C((char)0), VERTEX_COUNT_SIZE + CONTROL_HEADER_SIZE, sizeof(float) * KNOB_SIMD_WIDTH); ^ In file included from ../src/gallium/drivers/swr/rasterizer/jitter/builder.h:163:0, from ../src/gallium/drivers/swr/swr_shader.cpp:43: src/gallium/drivers/swr/rasterizer/jitter/gen_builder.hpp:51:11: note: candidate: llvm::CallInst* SwrJit::Builder::MEMSET(llvm::Value*, llvm::Value*, uint64_t, llvm::MaybeAlign, bool, llvm::MDNode*, llvm::MDNode*, llvm::MDNode*) CallInst* MEMSET(Value *Ptr, Value *Val, uint64_t Size, MaybeAlign Align, bool isVolatile = false, MDNode *TBAATag = nullptr, MDNode *ScopeTag = nullptr, MDNode *NoAliasTag = nullptr) ^ src/gallium/drivers/swr/rasterizer/jitter/gen_builder.hpp:51:11: note: no known conversion for argument 4 from ‘long unsigned int’ to ‘llvm::MaybeAlign’ In file included from ../src/gallium/drivers/swr/rasterizer/jitter/builder.h:163:0, from ../src/gallium/drivers/swr/swr_shader.cpp:43: src/gallium/drivers/swr/rasterizer/jitter/gen_builder.hpp:56:11: note: candidate: llvm::CallInst* SwrJit::Builder::MEMSET(llvm::Value*, llvm::Value*, llvm::Value*, llvm::MaybeAlign, bool, llvm::MDNode*, llvm::MDNode*, llvm::MDNode*) CallInst* MEMSET(Value *Ptr, Value *Val, Value *Size, MaybeAlign Align, bool isVolatile = false, MDNode *TBAATag = nullptr, MDNode *ScopeTag = nullptr, MDNode *NoAliasTag = nullptr) ^ src/gallium/drivers/swr/rasterizer/jitter/gen_builder.hpp:56:11: note: no known conversion for argument 4 from ‘long unsigned int’ to ‘llvm::MaybeAlign’ Signed-off-by: Vinson Lee Reviewed-by: Jan Zielinski --- diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp index 513e5300dd8..f21a6847bc0 100644 --- a/src/gallium/drivers/swr/swr_shader.cpp +++ b/src/gallium/drivers/swr/swr_shader.cpp @@ -735,7 +735,11 @@ BuilderSWR::CompileGS(struct swr_context *ctx, swr_jit_gs_key &key) for (uint32_t lane = 0; lane < mVWidth; ++lane) { Value* pStream = LOAD(pGsCtx, {0, SWR_GS_CONTEXT_pStreams, lane}); +#if LLVM_VERSION_MAJOR >= 10 + MEMSET(pStream, C((char)0), VERTEX_COUNT_SIZE + CONTROL_HEADER_SIZE, MaybeAlign(sizeof(float) * KNOB_SIMD_WIDTH)); +#else MEMSET(pStream, C((char)0), VERTEX_COUNT_SIZE + CONTROL_HEADER_SIZE, sizeof(float) * KNOB_SIMD_WIDTH); +#endif } struct swr_gs_llvm_iface gs_iface;