[Mesa-dev] [PATCH] gallium/swr: explicity use llvm legacy FunctionPassManager

Rowley, Timothy O timothy.o.rowley at intel.com
Thu Mar 3 19:38:29 UTC 2016


> On Mar 3, 2016, at 11:54 AM, Kai Wasserbäch <kai at dev.carbon-project.org> wrote:
> 
> Tim Rowley wrote on 03.03.2016 18:20:
>> swr uses the legacy FunctionPassManager for llvm-3.6 compatibility,
>> but a change to llvm headers in 3.9 includes the new version as well.
>> Explicity use the legacy version to prevent ambiguity.
>> ---
>> src/gallium/drivers/swr/rasterizer/jitter/JitManager.h     |  1 -
>> src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp    |  8 +++++++-
>> src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp    | 14 ++++++++++++--
>> .../drivers/swr/rasterizer/jitter/streamout_jit.cpp        |  8 +++++++-
>> 4 files changed, 26 insertions(+), 5 deletions(-)
>> 
>> --- a/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp
>> +++ b/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp
>> @@ -717,7 +717,13 @@ struct BlendJit : public Builder
>> 
>>         JitManager::DumpToFile(blendFunc, "");
>> 
>> -        FunctionPassManager passes(JM()->mpCurrentModule);
>> +#if LLVM_VERISON_MAJOR == 3 && LLVM_VERSION_MINOR == 6
> 
> Why not something like
> 
> #IF HAVE_LLVM == 0x0306
> 
> like radeonsi is using? (Same applies below.)

I like the cleanness of that method of version checking, but the internal customer of the swr rasterizer has a build system which doesn’t create a HAVE_LLVM, so we end up using only what’s provided by llvm’s llvm-config.h.

-Tim



More information about the mesa-dev mailing list