swr: [rasterizer jitter] Remove HAVE_LLVM tests supporting llvm < 3.8

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
Tim Rowley 2017-04-07 07:57:11 -05:00
parent 973d38801d
commit af909c0200
4 changed files with 0 additions and 52 deletions

View file

@ -206,12 +206,7 @@ bool JitManager::SetupModuleFromIR(const uint8_t *pIR, size_t length)
return false; return false;
} }
#if HAVE_LLVM == 0x307
// llvm-3.7 has mismatched setDataLyout/getDataLayout APIs
newModule->setDataLayout(*mpExec->getDataLayout());
#else
newModule->setDataLayout(mpExec->getDataLayout()); newModule->setDataLayout(mpExec->getDataLayout());
#endif
mpCurrentModule = newModule.get(); mpCurrentModule = newModule.get();
#if defined(_WIN32) #if defined(_WIN32)
@ -256,12 +251,7 @@ void JitManager::DumpAsm(Function* pFunction, const char* fileName)
sprintf(fName, "%s.%s.asm", funcName, fileName); sprintf(fName, "%s.%s.asm", funcName, fileName);
#endif #endif
#if HAVE_LLVM == 0x306
raw_fd_ostream fd(fName, EC, llvm::sys::fs::F_None);
formatted_raw_ostream filestream(fd);
#else
raw_fd_ostream filestream(fName, EC, llvm::sys::fs::F_None); raw_fd_ostream filestream(fName, EC, llvm::sys::fs::F_None);
#endif
legacy::PassManager* pMPasses = new legacy::PassManager(); legacy::PassManager* pMPasses = new legacy::PassManager();
auto* pTarget = mpExec->getTargetMachine(); auto* pTarget = mpExec->getTargetMachine();

View file

@ -61,15 +61,9 @@
#include "llvm/Analysis/Passes.h" #include "llvm/Analysis/Passes.h"
#if HAVE_LLVM == 0x306
#include "llvm/PassManager.h"
using FunctionPassManager = llvm::FunctionPassManager;
using PassManager = llvm::PassManager;
#else
#include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/LegacyPassManager.h"
using FunctionPassManager = llvm::legacy::FunctionPassManager; using FunctionPassManager = llvm::legacy::FunctionPassManager;
using PassManager = llvm::legacy::PassManager; using PassManager = llvm::legacy::PassManager;
#endif
#include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/Passes.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/ExecutionEngine.h"

View file

@ -236,13 +236,6 @@ namespace SwrJit
return UndefValue::get(VectorType::get(t, mVWidth)); return UndefValue::get(VectorType::get(t, mVWidth));
} }
#if HAVE_LLVM == 0x306
Value *Builder::VINSERT(Value *vec, Value *val, uint64_t index)
{
return VINSERT(vec, val, C((int64_t)index));
}
#endif
Value *Builder::VBROADCAST(Value *src) Value *Builder::VBROADCAST(Value *src)
{ {
// check if src is already a vector // check if src is already a vector
@ -324,7 +317,6 @@ namespace SwrJit
return CALLA(Callee, args); return CALLA(Callee, args);
} }
#if HAVE_LLVM > 0x306
CallInst *Builder::CALL(Value *Callee, Value* arg) CallInst *Builder::CALL(Value *Callee, Value* arg)
{ {
std::vector<Value*> args; std::vector<Value*> args;
@ -348,7 +340,6 @@ namespace SwrJit
args.push_back(arg3); args.push_back(arg3);
return CALLA(Callee, args); return CALLA(Callee, args);
} }
#endif
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
Value *Builder::DEBUGTRAP() Value *Builder::DEBUGTRAP()
@ -504,11 +495,7 @@ namespace SwrJit
// get a pointer to the first character in the constant string array // get a pointer to the first character in the constant string array
std::vector<Constant*> geplist{C(0),C(0)}; std::vector<Constant*> geplist{C(0),C(0)};
#if HAVE_LLVM == 0x306
Constant *strGEP = ConstantExpr::getGetElementPtr(gvPtr,geplist,false);
#else
Constant *strGEP = ConstantExpr::getGetElementPtr(nullptr, gvPtr,geplist,false); Constant *strGEP = ConstantExpr::getGetElementPtr(nullptr, gvPtr,geplist,false);
#endif
// insert the pointer to the format string in the argument vector // insert the pointer to the format string in the argument vector
printCallArgs[0] = strGEP; printCallArgs[0] = strGEP;
@ -1536,11 +1523,7 @@ namespace SwrJit
Value* Builder::STACKSAVE() Value* Builder::STACKSAVE()
{ {
Function* pfnStackSave = Intrinsic::getDeclaration(JM()->mpCurrentModule, Intrinsic::stacksave); Function* pfnStackSave = Intrinsic::getDeclaration(JM()->mpCurrentModule, Intrinsic::stacksave);
#if HAVE_LLVM == 0x306
return CALL(pfnStackSave);
#else
return CALLA(pfnStackSave); return CALLA(pfnStackSave);
#endif
} }
void Builder::STACKRESTORE(Value* pSaved) void Builder::STACKRESTORE(Value* pSaved)
@ -1594,29 +1577,16 @@ namespace SwrJit
Value *Builder::VEXTRACTI128(Value* a, Constant* imm8) Value *Builder::VEXTRACTI128(Value* a, Constant* imm8)
{ {
#if HAVE_LLVM == 0x306
Function *func =
Intrinsic::getDeclaration(JM()->mpCurrentModule,
Intrinsic::x86_avx_vextractf128_si_256);
return CALL(func, {a, imm8});
#else
bool flag = !imm8->isZeroValue(); bool flag = !imm8->isZeroValue();
SmallVector<Constant*,8> idx; SmallVector<Constant*,8> idx;
for (unsigned i = 0; i < mVWidth / 2; i++) { for (unsigned i = 0; i < mVWidth / 2; i++) {
idx.push_back(C(flag ? i + mVWidth / 2 : i)); idx.push_back(C(flag ? i + mVWidth / 2 : i));
} }
return VSHUFFLE(a, VUNDEF_I(), ConstantVector::get(idx)); return VSHUFFLE(a, VUNDEF_I(), ConstantVector::get(idx));
#endif
} }
Value *Builder::VINSERTI128(Value* a, Value* b, Constant* imm8) Value *Builder::VINSERTI128(Value* a, Value* b, Constant* imm8)
{ {
#if HAVE_LLVM == 0x306
Function *func =
Intrinsic::getDeclaration(JM()->mpCurrentModule,
Intrinsic::x86_avx_vinsertf128_si_256);
return CALL(func, {a, b, imm8});
#else
bool flag = !imm8->isZeroValue(); bool flag = !imm8->isZeroValue();
SmallVector<Constant*,8> idx; SmallVector<Constant*,8> idx;
for (unsigned i = 0; i < mVWidth; i++) { for (unsigned i = 0; i < mVWidth; i++) {
@ -1632,7 +1602,6 @@ namespace SwrJit
idx2.push_back(C(flag ? i + mVWidth / 2 : i)); idx2.push_back(C(flag ? i + mVWidth / 2 : i));
} }
return VSHUFFLE(a, inter, ConstantVector::get(idx2)); return VSHUFFLE(a, inter, ConstantVector::get(idx2));
#endif
} }
// rdtsc buckets macros // rdtsc buckets macros

View file

@ -59,9 +59,6 @@ Value *VUNDEF_F();
Value *VUNDEF_I(); Value *VUNDEF_I();
Value *VUNDEF(Type* ty, uint32_t size); Value *VUNDEF(Type* ty, uint32_t size);
Value *VUNDEF_IPTR(); Value *VUNDEF_IPTR();
#if HAVE_LLVM == 0x306
Value *VINSERT(Value *vec, Value *val, uint64_t index);
#endif
Value *VBROADCAST(Value *src); Value *VBROADCAST(Value *src);
Value *VRCP(Value *va); Value *VRCP(Value *va);
Value *VPLANEPS(Value* vA, Value* vB, Value* vC, Value* &vX, Value* &vY); Value *VPLANEPS(Value* vA, Value* vB, Value* vC, Value* &vX, Value* &vY);
@ -72,12 +69,10 @@ int32_t S_IMMED(Value* i);
Value *GEP(Value* ptr, const std::initializer_list<Value*> &indexList); Value *GEP(Value* ptr, const std::initializer_list<Value*> &indexList);
Value *GEP(Value* ptr, const std::initializer_list<uint32_t> &indexList); Value *GEP(Value* ptr, const std::initializer_list<uint32_t> &indexList);
CallInst *CALL(Value *Callee, const std::initializer_list<Value*> &args); CallInst *CALL(Value *Callee, const std::initializer_list<Value*> &args);
#if HAVE_LLVM > 0x306
CallInst *CALL(Value *Callee) { return CALLA(Callee); } CallInst *CALL(Value *Callee) { return CALLA(Callee); }
CallInst *CALL(Value *Callee, Value* arg); CallInst *CALL(Value *Callee, Value* arg);
CallInst *CALL2(Value *Callee, Value* arg1, Value* arg2); CallInst *CALL2(Value *Callee, Value* arg1, Value* arg2);
CallInst *CALL3(Value *Callee, Value* arg1, Value* arg2, Value* arg3); CallInst *CALL3(Value *Callee, Value* arg1, Value* arg2, Value* arg3);
#endif
LoadInst *LOAD(Value *BasePtr, const std::initializer_list<uint32_t> &offset, const llvm::Twine& name = ""); LoadInst *LOAD(Value *BasePtr, const std::initializer_list<uint32_t> &offset, const llvm::Twine& name = "");
LoadInst *LOADV(Value *BasePtr, const std::initializer_list<Value*> &offset, const llvm::Twine& name = ""); LoadInst *LOADV(Value *BasePtr, const std::initializer_list<Value*> &offset, const llvm::Twine& name = "");