Bug 109540 - gen_builder_meta.hpp:51:117: error: no matching function for call to ‘cast(llvm::FunctionCallee)’
Summary: gen_builder_meta.hpp:51:117: error: no matching function for call to ‘cast(ll...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/swr (show other bugs)
Version: git
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-03 22:11 UTC by Vinson Lee
Modified: 2019-03-23 01:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2019-02-03 22:11:13 UTC
Build error with LLVM 9.0.

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));
                                                                                                                     ^
Comment 1 Philip Meulengracht 2019-03-07 08:06:19 UTC
I haven't really had a chance to make a patch. But I've fixed this in my own fork, just add .getCallee() like this:

Function* pFunc = cast<Function>(JM()->mpCurrentModule->getOrInsertFunction("meta.intrinsic.VGATHERPD", pFuncTy).getCallee());

This is due to the fact that the functions now return an opaque pointer instead, wrapped in the FunctionCallee class, the offending commit is here:
https://github.com/llvm-mirror/llvm/commit/9ec60d7d8fa237f19210d325c8c058b89c7b17d2#diff-295d2c56655729b2bd6dc1dfca7c2f0e

The fix is needed several places, also in the codegen template
Comment 2 Vinson Lee 2019-03-23 01:46:10 UTC
commit 93c81ca336f64c45e43f0c40cb5c5f9084745233
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon Mar 18 11:52:48 2019 -0700

    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_meulengracht@hotmail.com>
    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Alok Hota <alok.hota@intel.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.