mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
swr: [rasterizer jitter] support llvm-svn
This commit is contained in:
parent
ec9d4c4b37
commit
68314b6769
6 changed files with 37 additions and 12 deletions
|
|
@ -53,6 +53,10 @@
|
|||
#include "llvm/Config/config.h"
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LLVM
|
||||
#define HAVE_LLVM (LLVM_VERSION_MAJOR << 8) || LLVM_VERSION_MINOR
|
||||
#endif
|
||||
|
||||
#include "llvm/IR/Verifier.h"
|
||||
#include "llvm/ExecutionEngine/MCJIT.h"
|
||||
#include "llvm/Support/FileSystem.h"
|
||||
|
|
@ -60,11 +64,10 @@
|
|||
|
||||
#include "llvm/Analysis/Passes.h"
|
||||
|
||||
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6
|
||||
#if HAVE_LLVM == 0x306
|
||||
#include "llvm/PassManager.h"
|
||||
#else
|
||||
#include "llvm/IR/LegacyPassManager.h"
|
||||
using namespace llvm::legacy;
|
||||
#endif
|
||||
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
|
|
|
|||
|
|
@ -717,7 +717,13 @@ struct BlendJit : public Builder
|
|||
|
||||
JitManager::DumpToFile(blendFunc, "");
|
||||
|
||||
FunctionPassManager passes(JM()->mpCurrentModule);
|
||||
#if HAVE_LLVM == 0x306
|
||||
FunctionPassManager
|
||||
#else
|
||||
llvm::legacy::FunctionPassManager
|
||||
#endif
|
||||
passes(JM()->mpCurrentModule);
|
||||
|
||||
passes.add(createBreakCriticalEdgesPass());
|
||||
passes.add(createCFGSimplificationPass());
|
||||
passes.add(createEarlyCSEPass());
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ Value *Builder::VUNDEF(Type* t)
|
|||
return UndefValue::get(VectorType::get(t, mVWidth));
|
||||
}
|
||||
|
||||
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6
|
||||
#if HAVE_LLVM == 0x306
|
||||
Value *Builder::VINSERT(Value *vec, Value *val, uint64_t index)
|
||||
{
|
||||
return VINSERT(vec, val, C((int64_t)index));
|
||||
|
|
@ -521,7 +521,7 @@ CallInst *Builder::PRINT(const std::string &printStr,const std::initializer_list
|
|||
|
||||
// get a pointer to the first character in the constant string array
|
||||
std::vector<Constant*> geplist{C(0),C(0)};
|
||||
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6
|
||||
#if HAVE_LLVM == 0x306
|
||||
Constant *strGEP = ConstantExpr::getGetElementPtr(gvPtr,geplist,false);
|
||||
#else
|
||||
Constant *strGEP = ConstantExpr::getGetElementPtr(nullptr, gvPtr,geplist,false);
|
||||
|
|
@ -1409,7 +1409,7 @@ Value *Builder::FCLAMP(Value* src, float low, float high)
|
|||
Value* Builder::STACKSAVE()
|
||||
{
|
||||
Function* pfnStackSave = Intrinsic::getDeclaration(JM()->mpCurrentModule, Intrinsic::stacksave);
|
||||
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6
|
||||
#if HAVE_LLVM == 0x306
|
||||
return CALL(pfnStackSave);
|
||||
#else
|
||||
return CALLA(pfnStackSave);
|
||||
|
|
@ -1467,7 +1467,7 @@ void __cdecl CallPrint(const char* fmt, ...)
|
|||
|
||||
Value *Builder::VEXTRACTI128(Value* a, Constant* imm8)
|
||||
{
|
||||
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6
|
||||
#if HAVE_LLVM == 0x306
|
||||
Function *func =
|
||||
Intrinsic::getDeclaration(JM()->mpCurrentModule,
|
||||
Intrinsic::x86_avx_vextractf128_si_256);
|
||||
|
|
@ -1484,7 +1484,7 @@ Value *Builder::VEXTRACTI128(Value* a, Constant* imm8)
|
|||
|
||||
Value *Builder::VINSERTI128(Value* a, Value* b, Constant* imm8)
|
||||
{
|
||||
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6
|
||||
#if HAVE_LLVM == 0x306
|
||||
Function *func =
|
||||
Intrinsic::getDeclaration(JM()->mpCurrentModule,
|
||||
Intrinsic::x86_avx_vinsertf128_si_256);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ Value *VUNDEF_F();
|
|||
Value *VUNDEF_I();
|
||||
Value *VUNDEF(Type* ty, uint32_t size);
|
||||
Value *VUNDEF_IPTR();
|
||||
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6
|
||||
#if HAVE_LLVM == 0x306
|
||||
Value *VINSERT(Value *vec, Value *val, uint64_t index);
|
||||
#endif
|
||||
Value *VBROADCAST(Value *src);
|
||||
|
|
|
|||
|
|
@ -174,7 +174,12 @@ Function* FetchJit::Create(const FETCH_COMPILE_STATE& fetchState)
|
|||
|
||||
verifyFunction(*fetch);
|
||||
|
||||
FunctionPassManager setupPasses(JM()->mpCurrentModule);
|
||||
#if HAVE_LLVM == 0x306
|
||||
FunctionPassManager
|
||||
#else
|
||||
llvm::legacy::FunctionPassManager
|
||||
#endif
|
||||
setupPasses(JM()->mpCurrentModule);
|
||||
|
||||
///@todo We don't need the CFG passes for fetch. (e.g. BreakCriticalEdges and CFGSimplification)
|
||||
setupPasses.add(createBreakCriticalEdgesPass());
|
||||
|
|
@ -186,7 +191,12 @@ Function* FetchJit::Create(const FETCH_COMPILE_STATE& fetchState)
|
|||
|
||||
JitManager::DumpToFile(fetch, "se");
|
||||
|
||||
FunctionPassManager optPasses(JM()->mpCurrentModule);
|
||||
#if HAVE_LLVM == 0x306
|
||||
FunctionPassManager
|
||||
#else
|
||||
llvm::legacy::FunctionPassManager
|
||||
#endif
|
||||
optPasses(JM()->mpCurrentModule);
|
||||
|
||||
///@todo Haven't touched these either. Need to remove some of these and add others.
|
||||
optPasses.add(createCFGSimplificationPass());
|
||||
|
|
|
|||
|
|
@ -293,7 +293,13 @@ struct StreamOutJit : public Builder
|
|||
|
||||
JitManager::DumpToFile(soFunc, "SoFunc");
|
||||
|
||||
FunctionPassManager passes(JM()->mpCurrentModule);
|
||||
#if HAVE_LLVM == 0x306
|
||||
FunctionPassManager
|
||||
#else
|
||||
llvm::legacy::FunctionPassManager
|
||||
#endif
|
||||
passes(JM()->mpCurrentModule);
|
||||
|
||||
passes.add(createBreakCriticalEdgesPass());
|
||||
passes.add(createCFGSimplificationPass());
|
||||
passes.add(createEarlyCSEPass());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue