Reviewed-by: Alok Hota <alok.h...@intel.com>l > -----Original Message----- > From: Vinson Lee [mailto:v...@freedesktop.org] > Sent: Monday, March 18, 2019 2:11 PM > To: Kyriazis, George <george.kyria...@intel.com>; Hota, Alok > <alok.h...@intel.com> > Cc: Philip Meulengracht <the_meulengra...@hotmail.com>; mesa- > d...@lists.freedesktop.org > Subject: [PATCH] swr: Fix build with llvm-9.0. > > Fix build error after llvm-9.0svn r352827 ("[opaque pointer types] Add a > FunctionCallee wrapper type, and use it."). > > In file included from ./rasterizer/jitter/builder.h:158:0, > from swr_shader.cpp:35: > ./rasterizer/jitter/gen_builder_meta.hpp: In member function ‘llvm::Value* > SwrJit::Builder::VGATHERPD(llvm::Value*, llvm::Value*, llvm::Value*, > llvm::Value*, llvm::Value*, const llvm: > :Twine&)’: > ./rasterizer/jitter/gen_builder_meta.hpp:51:117: error: no matching function > for call to ‘cast(llvm::FunctionCallee)’ > Function* pFunc = cast<Function>(JM()->mpCurrentModule- > >getOrInsertFunction("meta.intrinsic.VGATHERPD", pFuncTy)); > > ^ > > Suggested-by: Philip Meulengracht <the_meulengra...@hotmail.com> > Signed-off-by: Vinson Lee <v...@freedesktop.org> > --- > .../codegen/templates/gen_builder.hpp | 4 ++++ > .../swr/rasterizer/jitter/builder_misc.cpp | 20 +++++++++++++++++++ > 2 files changed, 24 insertions(+) > > diff --git > a/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_builder.hpp > b/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_builder.hpp > index 5182bc4259f0..a59fb10902b9 100644 > --- > a/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_builder.hpp > +++ b/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_builder.h > +++ pp > @@ -50,7 +50,11 @@ ${func['decl']} > %else: > FunctionType* pFuncTy = FunctionType::get(${ func['returnType'] }, {}, > false); > %endif: > +#if LLVM_VERSION_MAJOR >= 9 > + Function* pFunc = > +cast<Function>(JM()->mpCurrentModule- > >getOrInsertFunction("meta.intrins > +ic.${func['name']}", pFuncTy).getCallee()); #else > Function* pFunc = cast<Function>(JM()->mpCurrentModule- > >getOrInsertFunction("meta.intrinsic.${func['name']}", pFuncTy)); > +#endif > return CALL(pFunc, std::initializer_list<Value*>{${argList}}, name); > %elif > isIntrin: > %if len(func['types']) != 0: > diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp > b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp > index 24b733a28ae8..93a30b2cb452 100644 > --- a/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp > +++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_misc.cpp > @@ -445,7 +445,11 @@ namespace SwrJit > args.push_back(PointerType::get(mInt8Ty, 0)); > FunctionType* callPrintTy = FunctionType::get(Type::getVoidTy(JM()- > >mContext), args, true); > Function* callPrintFn = > +#if LLVM_VERSION_MAJOR >= 9 > + > +cast<Function>(JM()->mpCurrentModule->getOrInsertFunction("CallPrint", > +callPrintTy).getCallee()); #else > cast<Function>(JM()->mpCurrentModule- > >getOrInsertFunction("CallPrint", callPrintTy)); > +#endif > > // if we haven't yet added the symbol to the symbol table > if ((sys::DynamicLibrary::SearchForAddressOfSymbol("CallPrint")) == > nullptr) @@ -614,7 +618,11 @@ namespace SwrJit > { > FunctionType* pFuncTy = FunctionType::get(mFP32Ty, mInt16Ty); > Function* pCvtPh2Ps = cast<Function>( > +#if LLVM_VERSION_MAJOR >= 9 > + > +JM()->mpCurrentModule- > >getOrInsertFunction("ConvertFloat16ToFloat32", > +pFuncTy).getCallee()); #else > JM()->mpCurrentModule- > >getOrInsertFunction("ConvertFloat16ToFloat32", pFuncTy)); > +#endif > > if > (sys::DynamicLibrary::SearchForAddressOfSymbol("ConvertFloat16ToFloat32 > ") == nullptr) > { > @@ -650,7 +658,11 @@ namespace SwrJit > // call scalar C function for now > FunctionType* pFuncTy = FunctionType::get(mInt16Ty, mFP32Ty); > Function* pCvtPs2Ph = cast<Function>( > +#if LLVM_VERSION_MAJOR >= 9 > + > +JM()->mpCurrentModule- > >getOrInsertFunction("ConvertFloat32ToFloat16", > +pFuncTy).getCallee()); #else > JM()->mpCurrentModule- > >getOrInsertFunction("ConvertFloat32ToFloat16", pFuncTy)); > +#endif > > if > (sys::DynamicLibrary::SearchForAddressOfSymbol("ConvertFloat32ToFloat16 > ") == nullptr) > { > @@ -928,7 +940,11 @@ namespace SwrJit > > FunctionType* pFuncTy = FunctionType::get(Type::getVoidTy(JM()- > >mContext), args, false); > Function* pFunc = cast<Function>( > +#if LLVM_VERSION_MAJOR >= 9 > + > +JM()->mpCurrentModule- > >getOrInsertFunction("BucketManager_StartBucket", > +pFuncTy).getCallee()); #else > JM()->mpCurrentModule- > >getOrInsertFunction("BucketManager_StartBucket", pFuncTy)); > +#endif > if > (sys::DynamicLibrary::SearchForAddressOfSymbol("BucketManager_StartBu > cket") == > nullptr) > { > @@ -953,7 +969,11 @@ namespace SwrJit > > FunctionType* pFuncTy = FunctionType::get(Type::getVoidTy(JM()- > >mContext), args, false); > Function* pFunc = cast<Function>( > +#if LLVM_VERSION_MAJOR >=9 > + > +JM()->mpCurrentModule- > >getOrInsertFunction("BucketManager_StopBucket", > +pFuncTy).getCallee()); #else > JM()->mpCurrentModule- > >getOrInsertFunction("BucketManager_StopBucket", pFuncTy)); > +#endif > if > (sys::DynamicLibrary::SearchForAddressOfSymbol("BucketManager_StopBuc > ket") == > nullptr) > { > -- > 2.21.0
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev