beignet: remove package
no updates for a long time, problematic llvm patches
This commit is contained in:
parent
8404c13f2c
commit
7c1bbedcb1
|
@ -1,22 +0,0 @@
|
||||||
--- a/src/cl_api_kernel.c 2017-09-22 10:05:22.000000000 +0200
|
|
||||||
+++ b/src/cl_api_kernel.c 2020-03-24 18:27:40.186485887 +0100
|
|
||||||
@@ -151,7 +151,7 @@
|
|
||||||
fixed_local_sz[0] = 16;
|
|
||||||
fixed_local_sz[1] = 1;
|
|
||||||
} else {
|
|
||||||
- uint j, maxDimSize = 64 /* from 64? */, maxGroupSize = 256; //MAX_WORK_GROUP_SIZE may too large
|
|
||||||
+ cl_uint j, maxDimSize = 64 /* from 64? */, maxGroupSize = 256; //MAX_WORK_GROUP_SIZE may too large
|
|
||||||
size_t realGroupSize = 1;
|
|
||||||
for (i = 0; i < work_dim; i++) {
|
|
||||||
for (j = maxDimSize; j > 1; j--) {
|
|
||||||
--- a/src/cl_enqueue.c 2017-09-22 10:05:22.000000000 +0200
|
|
||||||
+++ b/src/cl_enqueue.c 2020-03-24 18:30:12.031479833 +0100
|
|
||||||
@@ -494,7 +494,7 @@
|
|
||||||
cl_int cl_enqueue_svm_free(enqueue_data *data, cl_int status) {
|
|
||||||
int i;
|
|
||||||
void **pointers = data->pointers;
|
|
||||||
- uint num_svm_ptrs = data->size;
|
|
||||||
+ cl_uint num_svm_ptrs = data->size;
|
|
||||||
cl_int err = CL_SUCCESS;
|
|
||||||
|
|
||||||
if (status != CL_COMPLETE)
|
|
|
@ -1,134 +0,0 @@
|
||||||
From e1b2419a0008e38ef2d9d255d9e9c74e9fba084b Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Rebecca N. Palmer" <rebecca_palmer@zoho.com>
|
|
||||||
Date: Sat, 21 Jul 2018 20:05:54 +0100
|
|
||||||
Subject: Add preliminary LLVM 7 support
|
|
||||||
|
|
||||||
This is preliminary because LLVM 7 has not been released yet:
|
|
||||||
it was tested with the snapshot from Debian experimental (svn336894).
|
|
||||||
|
|
||||||
1.Change linking order, as clangCodeGen now links to clangFrontend
|
|
||||||
2.Pass references not pointers to WriteBitcodeToFile and CloneModule
|
|
||||||
3.Add the headers that LoopSimplifyID, LCSSAID and
|
|
||||||
some create*Pass have moved to
|
|
||||||
4.Define our DEBUG whether or not we just undefined LLVM's
|
|
||||||
(theirs is now LLVM_DEBUG, but we never actually use it)
|
|
||||||
|
|
||||||
Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com>
|
|
||||||
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
|
|
||||||
---
|
|
||||||
CMake/FindLLVM.cmake | 2 +-
|
|
||||||
backend/src/backend/gen_program.cpp | 8 ++++++++
|
|
||||||
backend/src/backend/program.cpp | 4 ++++
|
|
||||||
backend/src/llvm/ExpandLargeIntegers.cpp | 2 +-
|
|
||||||
backend/src/llvm/llvm_bitcode_link.cpp | 4 ++++
|
|
||||||
backend/src/llvm/llvm_includes.hpp | 4 ++++
|
|
||||||
6 files changed, 22 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake
|
|
||||||
index 5457f24..f882589 100644
|
|
||||||
--- a/CMake/FindLLVM.cmake
|
|
||||||
+++ b/CMake/FindLLVM.cmake
|
|
||||||
@@ -113,10 +113,10 @@ macro(add_one_lib name)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
#Assume clang lib path same as llvm lib path
|
|
||||||
+add_one_lib("clangCodeGen")
|
|
||||||
add_one_lib("clangFrontend")
|
|
||||||
add_one_lib("clangSerialization")
|
|
||||||
add_one_lib("clangDriver")
|
|
||||||
-add_one_lib("clangCodeGen")
|
|
||||||
add_one_lib("clangSema")
|
|
||||||
add_one_lib("clangStaticAnalyzerFrontend")
|
|
||||||
add_one_lib("clangStaticAnalyzerCheckers")
|
|
||||||
diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
|
|
||||||
index 274c99c..4159234 100644
|
|
||||||
--- a/backend/src/backend/gen_program.cpp
|
|
||||||
+++ b/backend/src/backend/gen_program.cpp
|
|
||||||
@@ -454,7 +454,11 @@ namespace gbe {
|
|
||||||
#ifdef GBE_COMPILER_AVAILABLE
|
|
||||||
std::string str;
|
|
||||||
llvm::raw_string_ostream OS(str);
|
|
||||||
+#if LLVM_VERSION_MAJOR >= 7
|
|
||||||
+ llvm::WriteBitcodeToFile(*((llvm::Module*)prog->module), OS);
|
|
||||||
+#else
|
|
||||||
llvm::WriteBitcodeToFile((llvm::Module*)prog->module, OS);
|
|
||||||
+#endif
|
|
||||||
std::string& bin_str = OS.str();
|
|
||||||
int llsz = bin_str.size();
|
|
||||||
*binary = (char *)malloc(sizeof(char) * (llsz+1) );
|
|
||||||
@@ -545,7 +549,11 @@ namespace gbe {
|
|
||||||
&modRef);
|
|
||||||
src = llvm::unwrap(modRef);
|
|
||||||
}
|
|
||||||
+#if LLVM_VERSION_MAJOR >= 7
|
|
||||||
+ llvm::Module* clone = llvm::CloneModule(*src).release();
|
|
||||||
+#else
|
|
||||||
llvm::Module* clone = llvm::CloneModule(src).release();
|
|
||||||
+#endif
|
|
||||||
if (LLVMLinkModules2(wrap(dst), wrap(clone))) {
|
|
||||||
#elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
|
|
||||||
if (LLVMLinkModules(wrap(dst), wrap(src), LLVMLinkerPreserveSource_Removed, &errMsg)) {
|
|
||||||
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
|
|
||||||
index c37c595..b36f7b4 100644
|
|
||||||
--- a/backend/src/backend/program.cpp
|
|
||||||
+++ b/backend/src/backend/program.cpp
|
|
||||||
@@ -794,7 +794,11 @@ namespace gbe {
|
|
||||||
llvm::raw_fd_ostream ostream (dumpSPIRBinaryName.c_str(),
|
|
||||||
err, llvm::sys::fs::F_None);
|
|
||||||
if (!err)
|
|
||||||
+#if LLVM_VERSION_MAJOR<7
|
|
||||||
llvm::WriteBitcodeToFile(*out_module, ostream);
|
|
||||||
+#else
|
|
||||||
+ llvm::WriteBitcodeToFile(**out_module, ostream);
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
diff --git a/backend/src/llvm/ExpandLargeIntegers.cpp b/backend/src/llvm/ExpandLargeIntegers.cpp
|
|
||||||
index 8515dc1..4aec44e 100644
|
|
||||||
--- a/backend/src/llvm/ExpandLargeIntegers.cpp
|
|
||||||
+++ b/backend/src/llvm/ExpandLargeIntegers.cpp
|
|
||||||
@@ -99,8 +99,8 @@ using namespace llvm;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
#undef DEBUG
|
|
||||||
- #define DEBUG(...)
|
|
||||||
#endif
|
|
||||||
+#define DEBUG(...)
|
|
||||||
// Break instructions up into no larger than 64-bit chunks.
|
|
||||||
static const unsigned kChunkBits = 64;
|
|
||||||
static const unsigned kChunkBytes = kChunkBits / CHAR_BIT;
|
|
||||||
diff --git a/backend/src/llvm/llvm_bitcode_link.cpp b/backend/src/llvm/llvm_bitcode_link.cpp
|
|
||||||
index ef56e4c..4c3e20e 100644
|
|
||||||
--- a/backend/src/llvm/llvm_bitcode_link.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_bitcode_link.cpp
|
|
||||||
@@ -340,7 +340,11 @@ namespace gbe
|
|
||||||
/* We use beignet's bitcode as dst because it will have a lot of
|
|
||||||
lazy functions which will not be loaded. */
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 39
|
|
||||||
+#if LLVM_VERSION_MAJOR >= 7
|
|
||||||
+ llvm::Module * linked_module = llvm::CloneModule(*(llvm::Module*)mod).release();
|
|
||||||
+#else
|
|
||||||
llvm::Module * linked_module = llvm::CloneModule((llvm::Module*)mod).release();
|
|
||||||
+#endif
|
|
||||||
if(LLVMLinkModules2(wrap(clonedLib), wrap(linked_module))) {
|
|
||||||
#else
|
|
||||||
char* errorMsg;
|
|
||||||
diff --git a/backend/src/llvm/llvm_includes.hpp b/backend/src/llvm/llvm_includes.hpp
|
|
||||||
index 184553a..ffccf02 100644
|
|
||||||
--- a/backend/src/llvm/llvm_includes.hpp
|
|
||||||
+++ b/backend/src/llvm/llvm_includes.hpp
|
|
||||||
@@ -89,6 +89,10 @@
|
|
||||||
#include "llvm/CodeGen/IntrinsicLowering.h"
|
|
||||||
|
|
||||||
#include "llvm/Transforms/Scalar.h"
|
|
||||||
+#if LLVM_VERSION_MAJOR >= 7
|
|
||||||
+#include "llvm/Transforms/Utils.h"
|
|
||||||
+#include "llvm/Transforms/InstCombine/InstCombine.h"
|
|
||||||
+#endif
|
|
||||||
#include "llvm/MC/MCAsmInfo.h"
|
|
||||||
#include "llvm/MC/MCContext.h"
|
|
||||||
#include "llvm/MC/MCInstrInfo.h"
|
|
||||||
--
|
|
||||||
cgit v1.1
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
Source: Arch Linux
|
|
||||||
Upstream: unknown
|
|
||||||
Reason: fixes llvm6 compilation
|
|
||||||
|
|
||||||
--- a/backend/src/llvm/llvm_to_gen.cpp 2017-10-24 09:04:48.000000000 +0300
|
|
||||||
+++ b/backend/src/llvm/llvm_to_gen.cpp 2018-03-16 16:08:54.669963824 +0200
|
|
||||||
@@ -322,7 +322,11 @@ namespace gbe
|
|
||||||
DataLayout DL(&mod);
|
|
||||||
|
|
||||||
gbeDiagnosticContext dc;
|
|
||||||
+#if LLVM_VERSION_MAJOR >= 6
|
|
||||||
+ mod.getContext().setDiagnosticHandlerCallBack(&gbeDiagnosticHandler,&dc);
|
|
||||||
+#else
|
|
||||||
mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler,&dc);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
|
|
||||||
mod.setDataLayout(DL);
|
|
||||||
--- a/backend/src/llvm/llvm_unroll.cpp 2017-10-24 09:04:48.000000000 +0300
|
|
||||||
+++ b/backend/src/llvm/llvm_unroll.cpp 2018-03-16 16:09:47.736403557 +0200
|
|
||||||
@@ -205,7 +205,9 @@ namespace gbe {
|
|
||||||
if (parentTripCount != 0 && currTripCount * parentTripCount > 32) {
|
|
||||||
//Don't change the unrollID if doesn't force unroll.
|
|
||||||
//setUnrollID(parentL, false);
|
|
||||||
-#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
|
|
||||||
+#if LLVM_VERSION_MAJOR >= 6
|
|
||||||
+ loopInfo.erase(parentL);
|
|
||||||
+#elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
|
|
||||||
loopInfo.markAsRemoved(parentL);
|
|
||||||
#else
|
|
||||||
LPM.deleteLoopFromQueue(parentL);
|
|
||||||
Only in Beignet-1.3.2-Source: build
|
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
From 75c152599a7c1739e6dadcdb9b377acf7e44d9cf Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jan Beich <jbeich@FreeBSD.org>
|
|
||||||
Date: Wed, 30 Jan 2019 12:42:34 +0000
|
|
||||||
Subject: [PATCH] lang/beignet: unbreak with llvm80
|
|
||||||
|
|
||||||
Regressed by https://github.com/llvm/llvm-project/commit/721d95713a9e
|
|
||||||
|
|
||||||
unable to load /usr/local/lib/beignet//libgbeinterp.so which is part of the driver, please check!
|
|
||||||
ld-elf.so.1: /usr/local/lib/beignet//libgbeinterp.so: Undefined symbol "_ZN4llvm24DisableABIBreakingChecksE"
|
|
||||||
|
|
||||||
Regressed by https://github.com/llvm/llvm-project/commit/4a2d58e16acc
|
|
||||||
|
|
||||||
backend/src/llvm/llvm_gen_backend.cpp:3076:5: error:
|
|
||||||
unknown type name 'TerminatorInst'
|
|
||||||
TerminatorInst *term = bb->getTerminator();
|
|
||||||
^
|
|
||||||
backend/src/llvm/llvm_gen_backend.cpp:3083:5: error:
|
|
||||||
unknown type name 'TerminatorInst'
|
|
||||||
TerminatorInst *term = bb->getTerminator();
|
|
||||||
^
|
|
||||||
|
|
||||||
--- a/backend/src/CMakeLists.txt 2017-09-22 08:05:22 UTC
|
|
||||||
+++ b/backend/src/CMakeLists.txt
|
|
||||||
@@ -168,6 +168,7 @@ add_dependencies(gbe beignet_bitcode)
|
|
||||||
endif (NOT (USE_STANDALONE_GBE_COMPILER STREQUAL "true"))
|
|
||||||
|
|
||||||
add_library(gbeinterp SHARED gbe_bin_interpreter.cpp)
|
|
||||||
+target_link_libraries(gbeinterp ${LLVM_MODULE_LIBS})
|
|
||||||
|
|
||||||
if (LLVM_VERSION_NODOT VERSION_EQUAL 34)
|
|
||||||
find_library(TERMINFO NAMES tinfo ncurses)
|
|
||||||
--- a/backend/src/llvm/llvm_gen_backend.cpp 2017-10-24 06:04:48 UTC
|
|
||||||
+++ b/backend/src/llvm/llvm_gen_backend.cpp
|
|
||||||
@@ -3073,14 +3073,22 @@ namespace gbe
|
|
||||||
|
|
||||||
|
|
||||||
static unsigned getChildNo(BasicBlock *bb) {
|
|
||||||
+#if LLVM_VERSION_MAJOR < 8
|
|
||||||
TerminatorInst *term = bb->getTerminator();
|
|
||||||
+#else
|
|
||||||
+ Instruction *term = bb->getTerminator();
|
|
||||||
+#endif
|
|
||||||
return term->getNumSuccessors();
|
|
||||||
}
|
|
||||||
|
|
||||||
// return NULL if index out-range of children number
|
|
||||||
static BasicBlock *getChildPossible(BasicBlock *bb, unsigned index) {
|
|
||||||
|
|
||||||
+#if LLVM_VERSION_MAJOR < 8
|
|
||||||
TerminatorInst *term = bb->getTerminator();
|
|
||||||
+#else
|
|
||||||
+ Instruction *term = bb->getTerminator();
|
|
||||||
+#endif
|
|
||||||
unsigned childNo = term->getNumSuccessors();
|
|
||||||
BasicBlock *child = NULL;
|
|
||||||
if(index < childNo) {
|
|
|
@ -1,111 +0,0 @@
|
||||||
Source: FreeBSD + q66
|
|
||||||
|
|
||||||
Mostly FreeBSD other than FindLLVM.cmake changes.
|
|
||||||
Linking against clang-cpp does not work for us.
|
|
||||||
|
|
||||||
--- a/CMake/FindLLVM.cmake
|
|
||||||
+++ b/CMake/FindLLVM.cmake
|
|
||||||
@@ -140,6 +140,7 @@ add_one_lib("clangStaticAnalyzerCore")
|
|
||||||
add_one_lib("clangAnalysis")
|
|
||||||
add_one_lib("clangEdit")
|
|
||||||
add_one_lib("clangAST")
|
|
||||||
+add_one_lib("clangASTMatchers")
|
|
||||||
add_one_lib("clangParse")
|
|
||||||
add_one_lib("clangSema")
|
|
||||||
add_one_lib("clangLex")
|
|
||||||
--- a/backend/src/llvm/llvm_intrinsic_lowering.cpp 2017-10-24 06:04:48 UTC
|
|
||||||
+++ b/backend/src/llvm/llvm_intrinsic_lowering.cpp
|
|
||||||
@@ -77,7 +77,11 @@ namespace gbe {
|
|
||||||
std::vector<Type *> ParamTys;
|
|
||||||
for (Value** I = ArgBegin; I != ArgEnd; ++I)
|
|
||||||
ParamTys.push_back((*I)->getType());
|
|
||||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
|
||||||
+ FunctionCallee FCache = M->getOrInsertFunction(NewFn,
|
|
||||||
+#else
|
|
||||||
Constant* FCache = M->getOrInsertFunction(NewFn,
|
|
||||||
+#endif
|
|
||||||
FunctionType::get(RetTy, ParamTys, false));
|
|
||||||
|
|
||||||
IRBuilder<> Builder(CI->getParent(), BasicBlock::iterator(CI));
|
|
||||||
--- a/backend/src/llvm/llvm_sampler_fix.cpp 2017-10-24 06:04:48 UTC
|
|
||||||
+++ b/backend/src/llvm/llvm_sampler_fix.cpp
|
|
||||||
@@ -82,7 +82,11 @@ namespace gbe {
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
|
|
||||||
Module *M = I->getParent()->getParent()->getParent();
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
|
|
||||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
|
||||||
+ FunctionCallee samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
|
|
||||||
+#else
|
|
||||||
Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
|
|
||||||
+#endif
|
|
||||||
#else
|
|
||||||
Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType(), nullptr);
|
|
||||||
#endif
|
|
||||||
@@ -124,7 +128,11 @@ namespace gbe {
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
|
|
||||||
Module *M = I->getParent()->getParent()->getParent();
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
|
|
||||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
|
||||||
+ FunctionCallee samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
|
|
||||||
+#else
|
|
||||||
Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
|
|
||||||
+#endif
|
|
||||||
#else
|
|
||||||
Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType(), nullptr);
|
|
||||||
#endif
|
|
||||||
--- a/backend/src/llvm/llvm_profiling.cpp 2017-10-24 06:04:48 UTC
|
|
||||||
+++ b/backend/src/llvm/llvm_profiling.cpp
|
|
||||||
@@ -163,10 +163,18 @@ namespace gbe
|
|
||||||
// __gen_ocl_store_timestamp(int nth, int type);
|
|
||||||
Value *Args[2] = {ConstantInt::get(intTy, pointNum++), ConstantInt::get(intTy, profilingType)};
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
|
|
||||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
|
||||||
+ builder->CreateCall(module->getOrInsertFunction(
|
|
||||||
+#else
|
|
||||||
builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
|
|
||||||
+#endif
|
|
||||||
"__gen_ocl_calc_timestamp", Type::getVoidTy(module->getContext()),
|
|
||||||
IntegerType::getInt32Ty(module->getContext()),
|
|
||||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
|
||||||
+ IntegerType::getInt32Ty(module->getContext())),
|
|
||||||
+#else
|
|
||||||
IntegerType::getInt32Ty(module->getContext()))),
|
|
||||||
+#endif
|
|
||||||
ArrayRef<Value*>(Args));
|
|
||||||
#else
|
|
||||||
builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
|
|
||||||
@@ -185,10 +193,18 @@ namespace gbe
|
|
||||||
Value *Args2[2] = {profilingBuf, ConstantInt::get(intTy, profilingType)};
|
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
|
|
||||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
|
||||||
+ builder->CreateCall(module->getOrInsertFunction(
|
|
||||||
+#else
|
|
||||||
builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
|
|
||||||
+#endif
|
|
||||||
"__gen_ocl_store_profiling", Type::getVoidTy(module->getContext()),
|
|
||||||
ptrTy,
|
|
||||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
|
||||||
+ IntegerType::getInt32Ty(module->getContext())),
|
|
||||||
+#else
|
|
||||||
IntegerType::getInt32Ty(module->getContext()))),
|
|
||||||
+#endif
|
|
||||||
ArrayRef<Value*>(Args2));
|
|
||||||
#else
|
|
||||||
builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
|
|
||||||
--- a/backend/src/llvm/llvm_device_enqueue.cpp 2017-10-24 06:04:48 UTC
|
|
||||||
+++ b/backend/src/llvm/llvm_device_enqueue.cpp
|
|
||||||
@@ -398,8 +398,13 @@ namespace gbe {
|
|
||||||
std::vector<Type *> ParamTys;
|
|
||||||
for (Value** iter = args.begin(); iter != args.end(); ++iter)
|
|
||||||
ParamTys.push_back((*iter)->getType());
|
|
||||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
|
||||||
+ CallInst* newCI = builder.CreateCall(mod->getOrInsertFunction(
|
|
||||||
+ "__gen_enqueue_kernel_slm", FunctionType::get(intTy, ParamTys, false)), args);
|
|
||||||
+#else
|
|
||||||
CallInst* newCI = builder.CreateCall(cast<llvm::Function>(mod->getOrInsertFunction(
|
|
||||||
"__gen_enqueue_kernel_slm", FunctionType::get(intTy, ParamTys, false))), args);
|
|
||||||
+#endif
|
|
||||||
CI->replaceAllUsesWith(newCI);
|
|
||||||
deadInsnSet.insert(CI);
|
|
||||||
}
|
|
|
@ -1,347 +0,0 @@
|
||||||
diff --git CMake/FindLLVM.cmake CMake/FindLLVM.cmake
|
|
||||||
index 0a59e47..6e90923 100644
|
|
||||||
--- a/CMake/FindLLVM.cmake
|
|
||||||
+++ b/CMake/FindLLVM.cmake
|
|
||||||
@@ -104,28 +104,16 @@ string(REGEX REPLACE " *\n" "" LLVM_SYSTEM_LIBS ${LLVM_SYSTEM_LIBS_ORIG})
|
|
||||||
endif (LLVM_SYSTEM_LIBS_ORIG)
|
|
||||||
endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
|
|
||||||
|
|
||||||
+#something harmless because whitespace at start is an error
|
|
||||||
+set(CLANG_LIBRARIES "-ldl")
|
|
||||||
macro(add_one_lib name)
|
|
||||||
FIND_LIBRARY(CLANG_LIB
|
|
||||||
NAMES ${name}
|
|
||||||
PATHS ${LLVM_LIBRARY_DIR} NO_DEFAULT_PATH)
|
|
||||||
- set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_LIB})
|
|
||||||
+ set(CLANG_LIBRARIES "${CLANG_LIBRARIES} ${CLANG_LIB}")
|
|
||||||
+ message(STATUS "clanglibs name ${name} this ${CLANG_LIB} all ${CLANG_LIBRARIES} ")
|
|
||||||
unset(CLANG_LIB CACHE)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
#Assume clang lib path same as llvm lib path
|
|
||||||
-add_one_lib("clangCodeGen")
|
|
||||||
-add_one_lib("clangFrontend")
|
|
||||||
-add_one_lib("clangSerialization")
|
|
||||||
-add_one_lib("clangDriver")
|
|
||||||
-add_one_lib("clangSema")
|
|
||||||
-add_one_lib("clangStaticAnalyzerFrontend")
|
|
||||||
-add_one_lib("clangStaticAnalyzerCheckers")
|
|
||||||
-add_one_lib("clangStaticAnalyzerCore")
|
|
||||||
-add_one_lib("clangAnalysis")
|
|
||||||
-add_one_lib("clangEdit")
|
|
||||||
-add_one_lib("clangAST")
|
|
||||||
-add_one_lib("clangASTMatchers")
|
|
||||||
-add_one_lib("clangParse")
|
|
||||||
-add_one_lib("clangSema")
|
|
||||||
-add_one_lib("clangLex")
|
|
||||||
-add_one_lib("clangBasic")
|
|
||||||
+add_one_lib("clang-cpp")
|
|
||||||
diff --git CMakeLists.txt CMakeLists.txt
|
|
||||||
index c11acbb..08f427d 100644
|
|
||||||
--- a/CMakeLists.txt
|
|
||||||
+++ b/CMakeLists.txt
|
|
||||||
@@ -79,7 +79,7 @@ elseif (COMPILER STREQUAL "CLANG")
|
|
||||||
elseif (COMPILER STREQUAL "ICC")
|
|
||||||
set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -wd2928 -Wall -fPIC -fstrict-aliasing -fp-model fast -msse4.1 -Wl,-E")
|
|
||||||
endif ()
|
|
||||||
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS} -std=c++0x -Wno-invalid-offsetof")
|
|
||||||
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS} -Wno-invalid-offsetof")
|
|
||||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_CXX_FLAGS}")
|
|
||||||
set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DGBE_DEBUG=1")
|
|
||||||
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
|
|
||||||
diff --git backend/src/backend/program.cpp backend/src/backend/program.cpp
|
|
||||||
index b36f7b4..e666031 100644
|
|
||||||
--- a/backend/src/backend/program.cpp
|
|
||||||
+++ b/backend/src/backend/program.cpp
|
|
||||||
@@ -694,9 +694,9 @@ namespace gbe {
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
+ llvm::cl::ResetAllOptionOccurrences();
|
|
||||||
clang::CompilerInvocation::CreateFromArgs(*CI,
|
|
||||||
- &args[0],
|
|
||||||
- &args[0] + args.size(),
|
|
||||||
+ clang::ArrayRef<const char*>(args),
|
|
||||||
Diags);
|
|
||||||
// Create the compiler instance
|
|
||||||
clang::CompilerInstance Clang;
|
|
||||||
@@ -1242,8 +1242,7 @@ EXTEND_QUOTE:
|
|
||||||
// Create the compiler invocation
|
|
||||||
std::unique_ptr<clang::CompilerInvocation> CI(new clang::CompilerInvocation);
|
|
||||||
return clang::CompilerInvocation::CreateFromArgs(*CI,
|
|
||||||
- &args[0],
|
|
||||||
- &args[0] + args.size(),
|
|
||||||
+ clang::ArrayRef<const char*>(args),
|
|
||||||
Diags);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
diff --git backend/src/llvm/llvm_gen_backend.cpp backend/src/llvm/llvm_gen_backend.cpp
|
|
||||||
index c6fc30d..82441d8 100644
|
|
||||||
--- a/backend/src/llvm/llvm_gen_backend.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_gen_backend.cpp
|
|
||||||
@@ -575,10 +575,12 @@ namespace gbe
|
|
||||||
has_errors(false),
|
|
||||||
legacyMode(true)
|
|
||||||
{
|
|
||||||
+#if LLVM_VERSION_MAJOR < 10
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
|
|
||||||
initializeLoopInfoWrapperPassPass(*PassRegistry::getPassRegistry());
|
|
||||||
#else
|
|
||||||
initializeLoopInfoPass(*PassRegistry::getPassRegistry());
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
pass = PASS_EMIT_REGISTERS;
|
|
||||||
}
|
|
||||||
diff --git backend/src/llvm/llvm_gen_backend.hpp backend/src/llvm/llvm_gen_backend.hpp
|
|
||||||
index b4715b1..8e74f7a 100644
|
|
||||||
--- a/backend/src/llvm/llvm_gen_backend.hpp
|
|
||||||
+++ b/backend/src/llvm/llvm_gen_backend.hpp
|
|
||||||
@@ -130,10 +130,10 @@ namespace gbe
|
|
||||||
llvm::FunctionPass *createGenPass(ir::Unit &unit);
|
|
||||||
|
|
||||||
/*! Remove the GEP instructions */
|
|
||||||
- llvm::BasicBlockPass *createRemoveGEPPass(const ir::Unit &unit);
|
|
||||||
+ llvm::FunctionPass *createRemoveGEPPass(const ir::Unit &unit);
|
|
||||||
|
|
||||||
/*! Merge load/store if possible */
|
|
||||||
- llvm::BasicBlockPass *createLoadStoreOptimizationPass();
|
|
||||||
+ llvm::FunctionPass *createLoadStoreOptimizationPass();
|
|
||||||
|
|
||||||
/*! Scalarize all vector op instructions */
|
|
||||||
llvm::FunctionPass* createScalarizePass();
|
|
||||||
@@ -141,7 +141,7 @@ namespace gbe
|
|
||||||
llvm::ModulePass* createBarrierNodupPass(bool);
|
|
||||||
|
|
||||||
/*! Convert the Intrinsic call to gen function */
|
|
||||||
- llvm::BasicBlockPass *createIntrinsicLoweringPass();
|
|
||||||
+ llvm::FunctionPass *createIntrinsicLoweringPass();
|
|
||||||
|
|
||||||
/*! Passer the printf function call. */
|
|
||||||
llvm::FunctionPass* createPrintfParserPass(ir::Unit &unit);
|
|
||||||
diff --git backend/src/llvm/llvm_intrinsic_lowering.cpp backend/src/llvm/llvm_intrinsic_lowering.cpp
|
|
||||||
index 94f0ce6..b5539e9 100644
|
|
||||||
--- a/backend/src/llvm/llvm_intrinsic_lowering.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_intrinsic_lowering.cpp
|
|
||||||
@@ -29,12 +29,12 @@
|
|
||||||
using namespace llvm;
|
|
||||||
|
|
||||||
namespace gbe {
|
|
||||||
- class InstrinsicLowering : public BasicBlockPass
|
|
||||||
+ class InstrinsicLowering : public FunctionPass
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static char ID;
|
|
||||||
InstrinsicLowering() :
|
|
||||||
- BasicBlockPass(ID) {}
|
|
||||||
+ FunctionPass(ID) {}
|
|
||||||
|
|
||||||
void getAnalysisUsage(AnalysisUsage &AU) const {
|
|
||||||
|
|
||||||
@@ -93,9 +93,9 @@ namespace gbe {
|
|
||||||
CI->eraseFromParent();
|
|
||||||
return NewCI;
|
|
||||||
}
|
|
||||||
- virtual bool runOnBasicBlock(BasicBlock &BB)
|
|
||||||
+ virtual bool runOnFunction(Function &F)
|
|
||||||
{
|
|
||||||
- bool changedBlock = false;
|
|
||||||
+ for (BasicBlock &BB : F) {
|
|
||||||
Module *M = BB.getParent()->getParent();
|
|
||||||
|
|
||||||
DataLayout TD(M);
|
|
||||||
@@ -159,13 +159,14 @@ namespace gbe {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- return changedBlock;
|
|
||||||
+ }
|
|
||||||
+ return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
char InstrinsicLowering::ID = 0;
|
|
||||||
|
|
||||||
- BasicBlockPass *createIntrinsicLoweringPass() {
|
|
||||||
+ FunctionPass *createIntrinsicLoweringPass() {
|
|
||||||
return new InstrinsicLowering();
|
|
||||||
}
|
|
||||||
} // end namespace
|
|
||||||
diff --git backend/src/llvm/llvm_loadstore_optimization.cpp backend/src/llvm/llvm_loadstore_optimization.cpp
|
|
||||||
index 5aa38be..e314302 100644
|
|
||||||
--- a/backend/src/llvm/llvm_loadstore_optimization.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_loadstore_optimization.cpp
|
|
||||||
@@ -26,13 +26,13 @@
|
|
||||||
|
|
||||||
using namespace llvm;
|
|
||||||
namespace gbe {
|
|
||||||
- class GenLoadStoreOptimization : public BasicBlockPass {
|
|
||||||
+ class GenLoadStoreOptimization : public FunctionPass {
|
|
||||||
|
|
||||||
public:
|
|
||||||
static char ID;
|
|
||||||
ScalarEvolution *SE;
|
|
||||||
const DataLayout *TD;
|
|
||||||
- GenLoadStoreOptimization() : BasicBlockPass(ID) {}
|
|
||||||
+ GenLoadStoreOptimization() : FunctionPass(ID) {}
|
|
||||||
|
|
||||||
void getAnalysisUsage(AnalysisUsage &AU) const {
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
|
|
||||||
@@ -45,7 +45,9 @@ namespace gbe {
|
|
||||||
AU.setPreservesCFG();
|
|
||||||
}
|
|
||||||
|
|
||||||
- virtual bool runOnBasicBlock(BasicBlock &BB) {
|
|
||||||
+ virtual bool runOnFunction(Function &F) {
|
|
||||||
+ bool changedAnyBlock = false;
|
|
||||||
+ for (BasicBlock &BB : F) {
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
|
|
||||||
SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
|
|
||||||
#else
|
|
||||||
@@ -59,7 +61,9 @@ namespace gbe {
|
|
||||||
#else
|
|
||||||
TD = getAnalysisIfAvailable<DataLayout>();
|
|
||||||
#endif
|
|
||||||
- return optimizeLoadStore(BB);
|
|
||||||
+ changedAnyBlock = optimizeLoadStore(BB) | changedAnyBlock;
|
|
||||||
+ }
|
|
||||||
+ return changedAnyBlock;
|
|
||||||
}
|
|
||||||
Type *getValueType(Value *insn);
|
|
||||||
Value *getPointerOperand(Value *I);
|
|
||||||
@@ -148,7 +152,7 @@ namespace gbe {
|
|
||||||
values.push_back(merged[i]);
|
|
||||||
}
|
|
||||||
LoadInst *ld = cast<LoadInst>(merged[0]);
|
|
||||||
- unsigned align = ld->getAlignment();
|
|
||||||
+ MaybeAlign align = ld->getAlign();
|
|
||||||
unsigned addrSpace = ld->getPointerAddressSpace();
|
|
||||||
// insert before first load
|
|
||||||
Builder.SetInsertPoint(ld);
|
|
||||||
@@ -231,7 +235,7 @@ namespace gbe {
|
|
||||||
|
|
||||||
unsigned addrSpace = st->getPointerAddressSpace();
|
|
||||||
|
|
||||||
- unsigned align = st->getAlignment();
|
|
||||||
+ MaybeAlign align = st->getAlign();
|
|
||||||
// insert before the last store
|
|
||||||
Builder.SetInsertPoint(merged[size-1]);
|
|
||||||
|
|
||||||
@@ -325,7 +329,7 @@ namespace gbe {
|
|
||||||
return changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
- BasicBlockPass *createLoadStoreOptimizationPass() {
|
|
||||||
+ FunctionPass *createLoadStoreOptimizationPass() {
|
|
||||||
return new GenLoadStoreOptimization();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
diff --git backend/src/llvm/llvm_passes.cpp backend/src/llvm/llvm_passes.cpp
|
|
||||||
index 10752a3..b8f2282 100644
|
|
||||||
--- a/backend/src/llvm/llvm_passes.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_passes.cpp
|
|
||||||
@@ -37,7 +37,7 @@
|
|
||||||
#include "sys/map.hpp"
|
|
||||||
|
|
||||||
using namespace llvm;
|
|
||||||
-
|
|
||||||
+template class cfg::Update<BasicBlock *>;
|
|
||||||
namespace gbe
|
|
||||||
{
|
|
||||||
bool isKernelFunction(const llvm::Function &F) {
|
|
||||||
@@ -219,13 +219,13 @@ namespace gbe
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
- class GenRemoveGEPPasss : public BasicBlockPass
|
|
||||||
+ class GenRemoveGEPPasss : public FunctionPass
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
static char ID;
|
|
||||||
GenRemoveGEPPasss(const ir::Unit &unit) :
|
|
||||||
- BasicBlockPass(ID),
|
|
||||||
+ FunctionPass(ID),
|
|
||||||
unit(unit) {}
|
|
||||||
const ir::Unit &unit;
|
|
||||||
void getAnalysisUsage(AnalysisUsage &AU) const {
|
|
||||||
@@ -242,16 +242,18 @@ namespace gbe
|
|
||||||
|
|
||||||
bool simplifyGEPInstructions(GetElementPtrInst* GEPInst);
|
|
||||||
|
|
||||||
- virtual bool runOnBasicBlock(BasicBlock &BB)
|
|
||||||
+ virtual bool runOnFunction(Function &F)
|
|
||||||
{
|
|
||||||
- bool changedBlock = false;
|
|
||||||
+ bool changedAnyBlock = false;
|
|
||||||
+ for (BasicBlock &BB : F) {
|
|
||||||
iplist<Instruction>::iterator I = BB.getInstList().begin();
|
|
||||||
for (auto nextI = I, E = --BB.getInstList().end(); I != E; I = nextI) {
|
|
||||||
iplist<Instruction>::iterator I = nextI++;
|
|
||||||
if(GetElementPtrInst* gep = dyn_cast<GetElementPtrInst>(&*I))
|
|
||||||
- changedBlock = (simplifyGEPInstructions(gep) || changedBlock);
|
|
||||||
+ changedAnyBlock = (simplifyGEPInstructions(gep) | changedAnyBlock);
|
|
||||||
}
|
|
||||||
- return changedBlock;
|
|
||||||
+ }
|
|
||||||
+ return changedAnyBlock;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -367,7 +369,7 @@ namespace gbe
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
- BasicBlockPass *createRemoveGEPPass(const ir::Unit &unit) {
|
|
||||||
+ FunctionPass *createRemoveGEPPass(const ir::Unit &unit) {
|
|
||||||
return new GenRemoveGEPPasss(unit);
|
|
||||||
}
|
|
||||||
} /* namespace gbe */
|
|
||||||
diff --git backend/src/llvm/llvm_sampler_fix.cpp backend/src/llvm/llvm_sampler_fix.cpp
|
|
||||||
index 2a097c8..863be6d 100644
|
|
||||||
--- a/backend/src/llvm/llvm_sampler_fix.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_sampler_fix.cpp
|
|
||||||
@@ -33,10 +33,12 @@ namespace gbe {
|
|
||||||
class SamplerFix : public FunctionPass {
|
|
||||||
public:
|
|
||||||
SamplerFix() : FunctionPass(ID) {
|
|
||||||
+#if LLVM_VERSION_MAJOR < 10
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 35
|
|
||||||
initializeDominatorTreeWrapperPassPass(*PassRegistry::getPassRegistry());
|
|
||||||
#else
|
|
||||||
initializeDominatorTreePass(*PassRegistry::getPassRegistry());
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git backend/src/llvm/llvm_scalarize.cpp backend/src/llvm/llvm_scalarize.cpp
|
|
||||||
index e9a2a66..e9d2ee4 100644
|
|
||||||
--- a/backend/src/llvm/llvm_scalarize.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_scalarize.cpp
|
|
||||||
@@ -96,10 +96,12 @@ namespace gbe {
|
|
||||||
|
|
||||||
Scalarize() : FunctionPass(ID)
|
|
||||||
{
|
|
||||||
+#if LLVM_VERSION_MAJOR < 10
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 35
|
|
||||||
initializeDominatorTreeWrapperPassPass(*PassRegistry::getPassRegistry());
|
|
||||||
#else
|
|
||||||
initializeDominatorTreePass(*PassRegistry::getPassRegistry());
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git utests/CMakeLists.txt utests/CMakeLists.txt
|
|
||||||
index 300d87a..64179c7 100644
|
|
||||||
--- a/utests/CMakeLists.txt
|
|
||||||
+++ b/utests/CMakeLists.txt
|
|
||||||
@@ -26,8 +26,8 @@ if (NOT NOT_BUILD_STAND_ALONE_UTEST)
|
|
||||||
# Threads
|
|
||||||
Find_Package(Threads)
|
|
||||||
|
|
||||||
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS} -std=c++0x -Wno-invalid-offsetof")
|
|
||||||
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_CXX_FLAGS}")
|
|
||||||
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS} -Wno-invalid-offsetof -ffloat-store -fno-strict-aliasing")
|
|
||||||
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_CXX_FLAGS} -ffloat-store -fno-strict-aliasing") #compiler_{degrees,radians,function_argument2} use equality comparison of floats, compiler_long_bitcast uses aliasing
|
|
||||||
set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DGBE_DEBUG=1")
|
|
||||||
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
|
|
||||||
set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0")
|
|
|
@ -1,937 +0,0 @@
|
||||||
Source: Snektron
|
|
||||||
|
|
||||||
There were a few changes required for LLVM 11:
|
|
||||||
* llvm::StringRef requires .str(), implicit conversion was removed
|
|
||||||
* llvm::CallSite was removed, but the required methods are available on llvm::CallInst
|
|
||||||
* VectorTyID was split into FixedVectorTyID and ScalableVectorTyID, FixedVectorTyID was used
|
|
||||||
* CallInst::getCalledValue() was renamed to CallInst::getCalledOperand()
|
|
||||||
* Implicit conversion from MaybeAlign to Align was removed, so MaybeAlign::valueOrOne was used instead.
|
|
||||||
|
|
||||||
--- a/backend/src/llvm/StripAttributes.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/StripAttributes.cpp 2020-11-09 19:04:19.641897141 +0100
|
|
||||||
@@ -107,9 +107,8 @@
|
|
||||||
BB != E; ++BB) {
|
|
||||||
for (BasicBlock::iterator Inst = BB->begin(), E = BB->end();
|
|
||||||
Inst != E; ++Inst) {
|
|
||||||
- CallSite Call(&*Inst);
|
|
||||||
- if (Call)
|
|
||||||
- Call.setCallingConv(CallingConv::C);
|
|
||||||
+ if (CallInst* callInst = dyn_cast<CallInst>(&*Inst))
|
|
||||||
+ callInst->setCallingConv(CallingConv::C);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
--- a/backend/src/llvm/llvm_bitcode_link.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_bitcode_link.cpp 2020-11-09 17:04:09.633753428 +0100
|
|
||||||
@@ -98,7 +98,7 @@
|
|
||||||
if (callFunc && callFunc->getIntrinsicID() != 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
- std::string fnName = call->getCalledValue()->stripPointerCasts()->getName();
|
|
||||||
+ std::string fnName = call->getCalledOperand()->stripPointerCasts()->getName().str();
|
|
||||||
|
|
||||||
if (!MFS.insert(fnName).second) {
|
|
||||||
continue;
|
|
||||||
--- a/backend/src/llvm/llvm_device_enqueue.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_device_enqueue.cpp 2020-11-09 19:01:49.201915008 +0100
|
|
||||||
@@ -45,7 +45,7 @@
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* This is a fake, to check the function bitcast is for block or not */
|
|
||||||
- std::string fnName = Fn->getName();
|
|
||||||
+ std::string fnName = Fn->getName().str();
|
|
||||||
if(fnName.find("_invoke") == std::string::npos)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
@@ -119,18 +119,18 @@
|
|
||||||
ParamTys.push_back(ty);
|
|
||||||
}
|
|
||||||
FunctionType* NewFT = FunctionType::get(Fn->getReturnType(), ParamTys, false);
|
|
||||||
- Function* NewFn = Function::Create(NewFT, Function::ExternalLinkage, Fn->getName());
|
|
||||||
+ Function* NewFn = Function::Create(NewFT, Function::ExternalLinkage, Fn->getName().str());
|
|
||||||
SmallVector<ReturnInst*, 8> Returns;
|
|
||||||
|
|
||||||
Function::arg_iterator NewFnArgIt = NewFn->arg_begin();
|
|
||||||
for (Function::arg_iterator I = Fn->arg_begin(), E = Fn->arg_end(); I != E; ++I) {
|
|
||||||
- std::string ArgName = I->getName();
|
|
||||||
+ std::string ArgName = I->getName().str();
|
|
||||||
NewFnArgIt->setName(ArgName);
|
|
||||||
VMap[&*I] = &(*NewFnArgIt++);
|
|
||||||
}
|
|
||||||
CloneFunctionInto(NewFn, Fn, VMap, /*ModuleLevelChanges=*/true, Returns);
|
|
||||||
|
|
||||||
- Fn->setName("__d" + Fn->getName());
|
|
||||||
+ Fn->setName("__d" + Fn->getName().str());
|
|
||||||
mod->getFunctionList().push_back(NewFn);
|
|
||||||
//mod->getOrInsertFunction(NewFn->getName(), NewFn->getFunctionType(),
|
|
||||||
// NewFn->getAttributes());
|
|
||||||
@@ -147,7 +147,7 @@
|
|
||||||
argTypeNames.push_back(llvm::MDString::get(Context, "char*"));
|
|
||||||
argBaseTypeNames.push_back(llvm::MDString::get(Context, "char*"));
|
|
||||||
argTypeQuals.push_back(llvm::MDString::get(Context, ""));
|
|
||||||
- argNames.push_back(llvm::MDString::get(Context, I->getName()));
|
|
||||||
+ argNames.push_back(llvm::MDString::get(Context, I->getName().str()));
|
|
||||||
}
|
|
||||||
|
|
||||||
//If run to here, llvm version always > 3.9, add the version check just for build.
|
|
||||||
@@ -198,7 +198,7 @@
|
|
||||||
* invoke pointer to store the index in the unit's block functions index.*/
|
|
||||||
Function *Fn = dyn_cast<Function>(bt->getOperand(0));
|
|
||||||
|
|
||||||
- std::string fnName = Fn->getName();
|
|
||||||
+ std::string fnName = Fn->getName().str();
|
|
||||||
int index = -1;
|
|
||||||
for(size_t i=0; i<unit.blockFuncs.size(); i++) {
|
|
||||||
if(unit.blockFuncs[i] == fnName) {
|
|
||||||
@@ -241,7 +241,7 @@
|
|
||||||
//unnamed call function, parse the use to find the define of called function
|
|
||||||
SmallVector<Value*, 16> args(CI->op_begin(), CI->op_end()-1);
|
|
||||||
|
|
||||||
- Value *v = CI->getCalledValue();
|
|
||||||
+ Value *v = CI->getCalledOperand();
|
|
||||||
BitCastInst* bt = dyn_cast<BitCastInst>(v);
|
|
||||||
if(bt == NULL)
|
|
||||||
continue;
|
|
||||||
@@ -316,7 +316,7 @@
|
|
||||||
ConstantExpr *expr = dyn_cast<ConstantExpr>(c->getOperand(3));
|
|
||||||
BitCastInst *bt = dyn_cast<BitCastInst>(expr->getAsInstruction());
|
|
||||||
Function* f = dyn_cast<Function>(bt->getOperand(0));
|
|
||||||
- blocks[v] = f->getName();
|
|
||||||
+ blocks[v] = f->getName().str();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@
|
|
||||||
} else {
|
|
||||||
//handle enqueue_kernel function call
|
|
||||||
Function *fn = CI->getCalledFunction();
|
|
||||||
- if (fn->getName().find("enqueue_kernel") == std::string::npos)
|
|
||||||
+ if (fn->getName().str().find("enqueue_kernel") == std::string::npos)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
//block parameter's index, 3 or 6
|
|
||||||
@@ -361,7 +361,7 @@
|
|
||||||
ConstantExpr *expr = dyn_cast<ConstantExpr>(c->getOperand(3));
|
|
||||||
BitCastInst *bt = dyn_cast<BitCastInst>(expr->getAsInstruction());
|
|
||||||
Function* f = dyn_cast<Function>(bt->getOperand(0));
|
|
||||||
- blocks[v] = f->getName();
|
|
||||||
+ blocks[v] = f->getName().str();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if(isa<AllocaInst>(block)) {
|
|
||||||
--- a/backend/src/llvm/llvm_gen_backend.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_gen_backend.cpp 2020-11-09 18:33:50.919114327 +0100
|
|
||||||
@@ -376,7 +376,7 @@
|
|
||||||
GBE_ASSERT(index == 0);
|
|
||||||
return this->_newScalar(value, key, type, index, uniform);
|
|
||||||
break;
|
|
||||||
- case Type::VectorTyID:
|
|
||||||
+ case Type::FixedVectorTyID:
|
|
||||||
{
|
|
||||||
auto vectorType = cast<VectorType>(type);
|
|
||||||
auto elementType = vectorType->getElementType();
|
|
||||||
@@ -743,20 +743,20 @@
|
|
||||||
#undef DECL_VISIT_FN
|
|
||||||
|
|
||||||
// Emit rounding instructions from gen native function
|
|
||||||
- void emitRoundingCallInst(CallInst &I, CallSite &CS, ir::Opcode opcode);
|
|
||||||
+ void emitRoundingCallInst(CallInst &I, ir::Opcode opcode);
|
|
||||||
// Emit unary instructions from gen native function
|
|
||||||
- void emitUnaryCallInst(CallInst &I, CallSite &CS, ir::Opcode opcode, ir::Type = ir::TYPE_FLOAT);
|
|
||||||
+ void emitUnaryCallInst(CallInst &I, ir::Opcode opcode, ir::Type = ir::TYPE_FLOAT);
|
|
||||||
// Emit unary instructions from gen native function
|
|
||||||
- void emitAtomicInst(CallInst &I, CallSite &CS, ir::AtomicOps opcode);
|
|
||||||
+ void emitAtomicInst(CallInst &I, ir::AtomicOps opcode);
|
|
||||||
// Emit workgroup instructions
|
|
||||||
- void emitWorkGroupInst(CallInst &I, CallSite &CS, ir::WorkGroupOps opcode);
|
|
||||||
+ void emitWorkGroupInst(CallInst &I, ir::WorkGroupOps opcode);
|
|
||||||
// Emit subgroup instructions
|
|
||||||
- void emitSubGroupInst(CallInst &I, CallSite &CS, ir::WorkGroupOps opcode);
|
|
||||||
+ void emitSubGroupInst(CallInst &I, ir::WorkGroupOps opcode);
|
|
||||||
// Emit subgroup instructions
|
|
||||||
- void emitBlockReadWriteMemInst(CallInst &I, CallSite &CS, bool isWrite, uint8_t vec_size, ir::Type = ir::TYPE_U32);
|
|
||||||
- void emitBlockReadWriteImageInst(CallInst &I, CallSite &CS, bool isWrite, uint8_t vec_size, ir::Type = ir::TYPE_U32);
|
|
||||||
+ void emitBlockReadWriteMemInst(CallInst &I, bool isWrite, uint8_t vec_size, ir::Type = ir::TYPE_U32);
|
|
||||||
+ void emitBlockReadWriteImageInst(CallInst &I, bool isWrite, uint8_t vec_size, ir::Type = ir::TYPE_U32);
|
|
||||||
|
|
||||||
- uint8_t appendSampler(CallSite::arg_iterator AI);
|
|
||||||
+ uint8_t appendSampler(User::op_iterator AI);
|
|
||||||
uint8_t getImageID(CallInst &I);
|
|
||||||
|
|
||||||
// These instructions are not supported at all
|
|
||||||
@@ -1320,13 +1320,13 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(typeNameNode) {
|
|
||||||
- llvmInfo.typeName= (cast<MDString>(typeNameNode->getOperand(opID)))->getString();
|
|
||||||
+ llvmInfo.typeName= (cast<MDString>(typeNameNode->getOperand(opID)))->getString().str();
|
|
||||||
}
|
|
||||||
if(typeBaseNameNode) {
|
|
||||||
- llvmInfo.typeBaseName= (cast<MDString>(typeBaseNameNode->getOperand(opID)))->getString();
|
|
||||||
+ llvmInfo.typeBaseName= (cast<MDString>(typeBaseNameNode->getOperand(opID)))->getString().str();
|
|
||||||
}
|
|
||||||
- llvmInfo.typeName= (cast<MDString>(typeNameNode->getOperand(opID)))->getString();
|
|
||||||
- llvmInfo.typeQual = (cast<MDString>(typeQualNode->getOperand(opID)))->getString();
|
|
||||||
+ llvmInfo.typeName= (cast<MDString>(typeNameNode->getOperand(opID)))->getString().str();
|
|
||||||
+ llvmInfo.typeQual = (cast<MDString>(typeQualNode->getOperand(opID)))->getString().str();
|
|
||||||
bool isImage = llvmInfo.isImageType();
|
|
||||||
bool isPipe = llvmInfo.isPipeType();
|
|
||||||
if (I->getType()->isPointerTy() || isImage || isPipe) {
|
|
||||||
@@ -1531,7 +1531,7 @@
|
|
||||||
EltTy = getEltType(EltTy, TypeIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
- ir::Constant cc = unit.getConstantSet().getConstant(pointer->getName());
|
|
||||||
+ ir::Constant cc = unit.getConstantSet().getConstant(pointer->getName().str());
|
|
||||||
unsigned int defOffset = cc.getOffset();
|
|
||||||
relocs.push_back(ir::RelocEntry(offset, defOffset + constantOffset));
|
|
||||||
|
|
||||||
@@ -1546,7 +1546,7 @@
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (isa<GlobalVariable>(c)) {
|
|
||||||
- ir::Constant cc = unit.getConstantSet().getConstant(c->getName());
|
|
||||||
+ ir::Constant cc = unit.getConstantSet().getConstant(c->getName().str());
|
|
||||||
unsigned int defOffset = cc.getOffset();
|
|
||||||
|
|
||||||
relocs.push_back(ir::RelocEntry(offset, defOffset));
|
|
||||||
@@ -1609,7 +1609,7 @@
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
- case Type::TypeID::VectorTyID:
|
|
||||||
+ case Type::TypeID::FixedVectorTyID:
|
|
||||||
{
|
|
||||||
const ConstantDataSequential *cds = dyn_cast<ConstantDataSequential>(c);
|
|
||||||
const VectorType *vecTy = cast<VectorType>(type);
|
|
||||||
@@ -1936,7 +1936,7 @@
|
|
||||||
case Type::PointerTyID:
|
|
||||||
regTranslator.newScalar(value, key, 0, uniform);
|
|
||||||
break;
|
|
||||||
- case Type::VectorTyID:
|
|
||||||
+ case Type::FixedVectorTyID:
|
|
||||||
{
|
|
||||||
auto vectorType = cast<VectorType>(type);
|
|
||||||
const uint32_t elemNum = vectorType->getNumElements();
|
|
||||||
@@ -2395,7 +2395,7 @@
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if(typeNameNode) {
|
|
||||||
- llvmInfo.typeName = (cast<MDString>(typeNameNode->getOperand(opID)))->getString();
|
|
||||||
+ llvmInfo.typeName = (cast<MDString>(typeNameNode->getOperand(opID)))->getString().str();
|
|
||||||
//LLVM 3.9 image's type name include access qual, don't match OpenCL spec, erase them.
|
|
||||||
std::vector<std::string> filters = {"__read_only ", "__write_only "};
|
|
||||||
for (uint32_t i = 0; i < filters.size(); i++) {
|
|
||||||
@@ -2406,16 +2406,16 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(typeBaseNameNode){
|
|
||||||
- llvmInfo.typeBaseName = (cast<MDString>(typeBaseNameNode->getOperand(opID)))->getString();
|
|
||||||
+ llvmInfo.typeBaseName = (cast<MDString>(typeBaseNameNode->getOperand(opID)))->getString().str();
|
|
||||||
}
|
|
||||||
if(accessQualNode) {
|
|
||||||
- llvmInfo.accessQual = (cast<MDString>(accessQualNode->getOperand(opID)))->getString();
|
|
||||||
+ llvmInfo.accessQual = (cast<MDString>(accessQualNode->getOperand(opID)))->getString().str();
|
|
||||||
}
|
|
||||||
if(typeQualNode) {
|
|
||||||
- llvmInfo.typeQual = (cast<MDString>(typeQualNode->getOperand(opID)))->getString();
|
|
||||||
+ llvmInfo.typeQual = (cast<MDString>(typeQualNode->getOperand(opID)))->getString().str();
|
|
||||||
}
|
|
||||||
if(argNameNode){
|
|
||||||
- llvmInfo.argName = (cast<MDString>(argNameNode->getOperand(opID)))->getString();
|
|
||||||
+ llvmInfo.argName = (cast<MDString>(argNameNode->getOperand(opID)))->getString().str();
|
|
||||||
}
|
|
||||||
|
|
||||||
// function arguments are uniform values.
|
|
||||||
@@ -3010,7 +3010,7 @@
|
|
||||||
} else {
|
|
||||||
this->newRegister(const_cast<GlobalVariable*>(&v));
|
|
||||||
ir::Register reg = regTranslator.getScalar(const_cast<GlobalVariable*>(&v), 0);
|
|
||||||
- ir::Constant &con = unit.getConstantSet().getConstant(v.getName());
|
|
||||||
+ ir::Constant &con = unit.getConstantSet().getConstant(v.getName().str());
|
|
||||||
if (!legacyMode) {
|
|
||||||
ir::Register regload = ctx.reg(getFamily(getType(ctx, v.getType())));
|
|
||||||
ctx.LOADI(getType(ctx, v.getType()), regload, ctx.newIntegerImmediate(con.getOffset(), getType(ctx, v.getType())));
|
|
||||||
@@ -3212,7 +3212,7 @@
|
|
||||||
GBE_ASSERTM(false, "Unsupported calling convention");
|
|
||||||
}
|
|
||||||
|
|
||||||
- ctx.startFunction(F.getName());
|
|
||||||
+ ctx.startFunction(F.getName().str());
|
|
||||||
|
|
||||||
ir::Function &fn = ctx.getFunction();
|
|
||||||
this->regTranslator.clear();
|
|
||||||
@@ -3810,9 +3810,9 @@
|
|
||||||
|
|
||||||
void GenWriter::regAllocateCallInst(CallInst &I) {
|
|
||||||
Value *dst = &I;
|
|
||||||
- Value *Callee = I.getCalledValue();
|
|
||||||
+ Value *Callee = I.getCalledOperand();
|
|
||||||
GBE_ASSERT(ctx.getFunction().getProfile() == ir::PROFILE_OCL);
|
|
||||||
- GBE_ASSERT(isa<InlineAsm>(I.getCalledValue()) == false);
|
|
||||||
+ GBE_ASSERT(isa<InlineAsm>(I.getCalledOperand()) == false);
|
|
||||||
if(I.getNumArgOperands()) GBE_ASSERT(I.hasStructRetAttr() == false);
|
|
||||||
|
|
||||||
// We only support a small number of intrinsics right now
|
|
||||||
@@ -3870,7 +3870,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Get the name of the called function and handle it
|
|
||||||
- const std::string fnName = Callee->stripPointerCasts()->getName();
|
|
||||||
+ const std::string fnName = Callee->stripPointerCasts()->getName().str();
|
|
||||||
auto genIntrinsicID = intrinsicMap.find(fnName);
|
|
||||||
switch (genIntrinsicID) {
|
|
||||||
case GEN_OCL_GET_GROUP_ID0:
|
|
||||||
@@ -4166,7 +4166,7 @@
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
- void GenWriter::emitRoundingCallInst(CallInst &I, CallSite &CS, ir::Opcode opcode) {
|
|
||||||
+ void GenWriter::emitRoundingCallInst(CallInst &I, ir::Opcode opcode) {
|
|
||||||
if (I.getType()->isHalfTy()) {
|
|
||||||
const ir::Register src = this->getRegister(I.getOperand(0));
|
|
||||||
const ir::Register srcFloat = ctx.reg(ir::FAMILY_DWORD);
|
|
||||||
@@ -4177,14 +4177,14 @@
|
|
||||||
ctx.F32TO16(ir::TYPE_U16, ir::TYPE_FLOAT, dst, dstFloat);
|
|
||||||
} else {
|
|
||||||
GBE_ASSERT(I.getType()->isFloatTy());
|
|
||||||
- this->emitUnaryCallInst(I,CS,opcode);
|
|
||||||
+ this->emitUnaryCallInst(I,opcode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- void GenWriter::emitUnaryCallInst(CallInst &I, CallSite &CS, ir::Opcode opcode, ir::Type type) {
|
|
||||||
- CallSite::arg_iterator AI = CS.arg_begin();
|
|
||||||
+ void GenWriter::emitUnaryCallInst(CallInst &I, ir::Opcode opcode, ir::Type type) {
|
|
||||||
+ User::op_iterator AI = I.arg_begin();
|
|
||||||
#if GBE_DEBUG
|
|
||||||
- CallSite::arg_iterator AE = CS.arg_end();
|
|
||||||
+ User::op_iterator AE = I.arg_end();
|
|
||||||
#endif /* GBE_DEBUG */
|
|
||||||
GBE_ASSERT(AI != AE);
|
|
||||||
const ir::Register src = this->getRegister(*AI);
|
|
||||||
@@ -4293,9 +4293,9 @@
|
|
||||||
this->emitAtomicInstHelper(opcode, type, dst, llvmPtr, payloadTuple);
|
|
||||||
}
|
|
||||||
|
|
||||||
- void GenWriter::emitAtomicInst(CallInst &I, CallSite &CS, ir::AtomicOps opcode) {
|
|
||||||
- CallSite::arg_iterator AI = CS.arg_begin();
|
|
||||||
- CallSite::arg_iterator AE = CS.arg_end();
|
|
||||||
+ void GenWriter::emitAtomicInst(CallInst &I, ir::AtomicOps opcode) {
|
|
||||||
+ User::op_iterator AI = I.arg_begin();
|
|
||||||
+ User::op_iterator AE = I.arg_end();
|
|
||||||
GBE_ASSERT(AI != AE);
|
|
||||||
Value *llvmPtr = *AI;
|
|
||||||
ir::AddressSpace addrSpace = addressSpaceLLVMToGen(llvmPtr->getType()->getPointerAddressSpace());
|
|
||||||
@@ -4348,7 +4348,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- void GenWriter::emitWorkGroupInst(CallInst &I, CallSite &CS, ir::WorkGroupOps opcode) {
|
|
||||||
+ void GenWriter::emitWorkGroupInst(CallInst &I, ir::WorkGroupOps opcode) {
|
|
||||||
ir::Function &f = ctx.getFunction();
|
|
||||||
|
|
||||||
if (f.getwgBroadcastSLM() < 0 && opcode == ir::WORKGROUP_OP_BROADCAST) {
|
|
||||||
@@ -4378,8 +4378,8 @@
|
|
||||||
GBE_ASSERT(f.gettidMapSLM() >= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
- CallSite::arg_iterator AI = CS.arg_begin();
|
|
||||||
- CallSite::arg_iterator AE = CS.arg_end();
|
|
||||||
+ User::op_iterator AI = I.arg_begin();
|
|
||||||
+ User::op_iterator AE = I.arg_end();
|
|
||||||
GBE_ASSERT(AI != AE);
|
|
||||||
|
|
||||||
if (opcode == ir::WORKGROUP_OP_ALL || opcode == ir::WORKGROUP_OP_ANY) {
|
|
||||||
@@ -4391,14 +4391,14 @@
|
|
||||||
const ir::Tuple srcTuple = ctx.arrayTuple(&src[0], 3);
|
|
||||||
ctx.WORKGROUP(opcode, (uint32_t)f.gettidMapSLM(), getRegister(&I), srcTuple, 3, ir::TYPE_S32);
|
|
||||||
} else if (opcode == ir::WORKGROUP_OP_BROADCAST) {
|
|
||||||
- int argNum = CS.arg_size();
|
|
||||||
+ int argNum = I.arg_size();
|
|
||||||
std::vector<ir::Register> src(argNum);
|
|
||||||
for (int i = 0; i < argNum; i++) {
|
|
||||||
src[i] = this->getRegister(*(AI++));
|
|
||||||
}
|
|
||||||
const ir::Tuple srcTuple = ctx.arrayTuple(&src[0], argNum);
|
|
||||||
ctx.WORKGROUP(ir::WORKGROUP_OP_BROADCAST, (uint32_t)f.getwgBroadcastSLM(), getRegister(&I), srcTuple, argNum,
|
|
||||||
- getType(ctx, (*CS.arg_begin())->getType()));
|
|
||||||
+ getType(ctx, (*I.arg_begin())->getType()));
|
|
||||||
} else {
|
|
||||||
ConstantInt *sign = dyn_cast<ConstantInt>(AI);
|
|
||||||
GBE_ASSERT(sign);
|
|
||||||
@@ -4423,9 +4423,9 @@
|
|
||||||
GBE_ASSERT(AI == AE);
|
|
||||||
}
|
|
||||||
|
|
||||||
- void GenWriter::emitSubGroupInst(CallInst &I, CallSite &CS, ir::WorkGroupOps opcode) {
|
|
||||||
- CallSite::arg_iterator AI = CS.arg_begin();
|
|
||||||
- CallSite::arg_iterator AE = CS.arg_end();
|
|
||||||
+ void GenWriter::emitSubGroupInst(CallInst &I, ir::WorkGroupOps opcode) {
|
|
||||||
+ User::op_iterator AI = I.arg_begin();
|
|
||||||
+ User::op_iterator AE = I.arg_end();
|
|
||||||
GBE_ASSERT(AI != AE);
|
|
||||||
|
|
||||||
if (opcode == ir::WORKGROUP_OP_ALL || opcode == ir::WORKGROUP_OP_ANY) {
|
|
||||||
@@ -4435,7 +4435,7 @@
|
|
||||||
const ir::Tuple srcTuple = ctx.arrayTuple(&src[0], 1);
|
|
||||||
ctx.SUBGROUP(opcode, getRegister(&I), srcTuple, 1, ir::TYPE_S32);
|
|
||||||
} else if (opcode == ir::WORKGROUP_OP_BROADCAST) {
|
|
||||||
- int argNum = CS.arg_size();
|
|
||||||
+ int argNum = I.arg_size();
|
|
||||||
GBE_ASSERT(argNum == 2);
|
|
||||||
std::vector<ir::Register> src(argNum);
|
|
||||||
for (int i = 0; i < argNum; i++) {
|
|
||||||
@@ -4443,7 +4443,7 @@
|
|
||||||
}
|
|
||||||
const ir::Tuple srcTuple = ctx.arrayTuple(&src[0], argNum);
|
|
||||||
ctx.SUBGROUP(ir::WORKGROUP_OP_BROADCAST, getRegister(&I), srcTuple, argNum,
|
|
||||||
- getType(ctx, (*CS.arg_begin())->getType()));
|
|
||||||
+ getType(ctx, (*I.arg_begin())->getType()));
|
|
||||||
} else {
|
|
||||||
ConstantInt *sign = dyn_cast<ConstantInt>(AI);
|
|
||||||
GBE_ASSERT(sign);
|
|
||||||
@@ -4466,9 +4466,9 @@
|
|
||||||
GBE_ASSERT(AI == AE);
|
|
||||||
}
|
|
||||||
|
|
||||||
- void GenWriter::emitBlockReadWriteMemInst(CallInst &I, CallSite &CS, bool isWrite, uint8_t vec_size, ir::Type type) {
|
|
||||||
- CallSite::arg_iterator AI = CS.arg_begin();
|
|
||||||
- CallSite::arg_iterator AE = CS.arg_end();
|
|
||||||
+ void GenWriter::emitBlockReadWriteMemInst(CallInst &I, bool isWrite, uint8_t vec_size, ir::Type type) {
|
|
||||||
+ User::op_iterator AI = I.arg_begin();
|
|
||||||
+ User::op_iterator AE = I.arg_end();
|
|
||||||
GBE_ASSERT(AI != AE);
|
|
||||||
|
|
||||||
Value *llvmPtr = *(AI++);
|
|
||||||
@@ -4522,9 +4522,9 @@
|
|
||||||
GBE_ASSERT(AI == AE);
|
|
||||||
}
|
|
||||||
|
|
||||||
- void GenWriter::emitBlockReadWriteImageInst(CallInst &I, CallSite &CS, bool isWrite, uint8_t vec_size, ir::Type type) {
|
|
||||||
- CallSite::arg_iterator AI = CS.arg_begin();
|
|
||||||
- CallSite::arg_iterator AE = CS.arg_end();
|
|
||||||
+ void GenWriter::emitBlockReadWriteImageInst(CallInst &I, bool isWrite, uint8_t vec_size, ir::Type type) {
|
|
||||||
+ User::op_iterator AI = I.arg_begin();
|
|
||||||
+ User::op_iterator AE = I.arg_end();
|
|
||||||
GBE_ASSERT(AI != AE);
|
|
||||||
|
|
||||||
const uint8_t imageID = getImageID(I);
|
|
||||||
@@ -4557,7 +4557,7 @@
|
|
||||||
|
|
||||||
/* append a new sampler. should be called before any reference to
|
|
||||||
* a sampler_t value. */
|
|
||||||
- uint8_t GenWriter::appendSampler(CallSite::arg_iterator AI) {
|
|
||||||
+ uint8_t GenWriter::appendSampler(User::op_iterator AI) {
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
|
|
||||||
CallInst *TC = dyn_cast<CallInst>(*AI);
|
|
||||||
Constant *CPV = TC ? dyn_cast<Constant>(TC->getOperand(0)) : NULL;
|
|
||||||
@@ -4595,10 +4595,9 @@
|
|
||||||
const ir::Function &fn = ctx.getFunction();
|
|
||||||
|
|
||||||
// Get the function arguments
|
|
||||||
- CallSite CS(&I);
|
|
||||||
- CallSite::arg_iterator AI = CS.arg_begin();
|
|
||||||
+ User::op_iterator AI = I.arg_begin();
|
|
||||||
#if GBE_DEBUG
|
|
||||||
- CallSite::arg_iterator AE = CS.arg_end();
|
|
||||||
+ User::op_iterator AE = I.arg_end();
|
|
||||||
#endif /* GBE_DEBUG */
|
|
||||||
switch (F->getIntrinsicID()) {
|
|
||||||
case Intrinsic::stacksave:
|
|
||||||
@@ -4764,17 +4763,17 @@
|
|
||||||
ctx.MAD(srcType, dst, src0, src1, src2);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
- case Intrinsic::sqrt: this->emitUnaryCallInst(I,CS,ir::OP_SQR); break;
|
|
||||||
- case Intrinsic::ceil: this->emitRoundingCallInst(I,CS,ir::OP_RNDU); break;
|
|
||||||
- case Intrinsic::trunc: this->emitRoundingCallInst(I,CS,ir::OP_RNDZ); break;
|
|
||||||
- case Intrinsic::rint: this->emitRoundingCallInst(I,CS,ir::OP_RNDE); break;
|
|
||||||
- case Intrinsic::floor: this->emitRoundingCallInst(I,CS,ir::OP_RNDD); break;
|
|
||||||
- case Intrinsic::sin: this->emitUnaryCallInst(I,CS,ir::OP_SIN); break;
|
|
||||||
- case Intrinsic::cos: this->emitUnaryCallInst(I,CS,ir::OP_COS); break;
|
|
||||||
- case Intrinsic::log2: this->emitUnaryCallInst(I,CS,ir::OP_LOG); break;
|
|
||||||
- case Intrinsic::exp2: this->emitUnaryCallInst(I,CS,ir::OP_EXP); break;
|
|
||||||
+ case Intrinsic::sqrt: this->emitUnaryCallInst(I,ir::OP_SQR); break;
|
|
||||||
+ case Intrinsic::ceil: this->emitRoundingCallInst(I,ir::OP_RNDU); break;
|
|
||||||
+ case Intrinsic::trunc: this->emitRoundingCallInst(I,ir::OP_RNDZ); break;
|
|
||||||
+ case Intrinsic::rint: this->emitRoundingCallInst(I,ir::OP_RNDE); break;
|
|
||||||
+ case Intrinsic::floor: this->emitRoundingCallInst(I,ir::OP_RNDD); break;
|
|
||||||
+ case Intrinsic::sin: this->emitUnaryCallInst(I,ir::OP_SIN); break;
|
|
||||||
+ case Intrinsic::cos: this->emitUnaryCallInst(I,ir::OP_COS); break;
|
|
||||||
+ case Intrinsic::log2: this->emitUnaryCallInst(I,ir::OP_LOG); break;
|
|
||||||
+ case Intrinsic::exp2: this->emitUnaryCallInst(I,ir::OP_EXP); break;
|
|
||||||
case Intrinsic::bswap:
|
|
||||||
- this->emitUnaryCallInst(I,CS,ir::OP_BSWAP, getUnsignedType(ctx, I.getType())); break;
|
|
||||||
+ this->emitUnaryCallInst(I,ir::OP_BSWAP, getUnsignedType(ctx, I.getType())); break;
|
|
||||||
case Intrinsic::pow:
|
|
||||||
{
|
|
||||||
const ir::Register src0 = this->getRegister(*AI); ++AI;
|
|
||||||
@@ -4794,21 +4793,20 @@
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Get the name of the called function and handle it
|
|
||||||
- Value *Callee = I.getCalledValue();
|
|
||||||
- const std::string fnName = Callee->stripPointerCasts()->getName();
|
|
||||||
+ Value *Callee = I.getCalledOperand();
|
|
||||||
+ const std::string fnName = Callee->stripPointerCasts()->getName().str();
|
|
||||||
auto genIntrinsicID = intrinsicMap.find(fnName);
|
|
||||||
|
|
||||||
// Get the function arguments
|
|
||||||
- CallSite CS(&I);
|
|
||||||
- CallSite::arg_iterator AI = CS.arg_begin();
|
|
||||||
+ User::op_iterator AI = I.arg_begin();
|
|
||||||
#if GBE_DEBUG
|
|
||||||
- CallSite::arg_iterator AE = CS.arg_end();
|
|
||||||
+ User::op_iterator AE = I.arg_end();
|
|
||||||
#endif /* GBE_DEBUG */
|
|
||||||
|
|
||||||
switch (genIntrinsicID) {
|
|
||||||
- case GEN_OCL_FBH: this->emitUnaryCallInst(I,CS,ir::OP_FBH, ir::TYPE_U32); break;
|
|
||||||
- case GEN_OCL_FBL: this->emitUnaryCallInst(I,CS,ir::OP_FBL, ir::TYPE_U32); break;
|
|
||||||
- case GEN_OCL_CBIT: this->emitUnaryCallInst(I,CS,ir::OP_CBIT, getUnsignedType(ctx, (*AI)->getType())); break;
|
|
||||||
+ case GEN_OCL_FBH: this->emitUnaryCallInst(I,ir::OP_FBH, ir::TYPE_U32); break;
|
|
||||||
+ case GEN_OCL_FBL: this->emitUnaryCallInst(I,ir::OP_FBL, ir::TYPE_U32); break;
|
|
||||||
+ case GEN_OCL_CBIT: this->emitUnaryCallInst(I,ir::OP_CBIT, getUnsignedType(ctx, (*AI)->getType())); break;
|
|
||||||
case GEN_OCL_ABS:
|
|
||||||
{
|
|
||||||
const ir::Register src = this->getRegister(*AI);
|
|
||||||
@@ -4915,8 +4913,8 @@
|
|
||||||
ctx.REGION(dst, src, x.getIntegerValue());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
- case GEN_OCL_RSQ: this->emitUnaryCallInst(I,CS,ir::OP_RSQ); break;
|
|
||||||
- case GEN_OCL_RCP: this->emitUnaryCallInst(I,CS,ir::OP_RCP); break;
|
|
||||||
+ case GEN_OCL_RSQ: this->emitUnaryCallInst(I,ir::OP_RSQ); break;
|
|
||||||
+ case GEN_OCL_RCP: this->emitUnaryCallInst(I,ir::OP_RCP); break;
|
|
||||||
case GEN_OCL_FORCE_SIMD8: ctx.setSimdWidth(8); break;
|
|
||||||
case GEN_OCL_FORCE_SIMD16: ctx.setSimdWidth(16); break;
|
|
||||||
case GEN_OCL_LBARRIER: ctx.SYNC(ir::syncLocalBarrier); break;
|
|
||||||
@@ -4947,31 +4945,31 @@
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GEN_OCL_ATOMIC_ADD0:
|
|
||||||
- case GEN_OCL_ATOMIC_ADD1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_ADD); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_ADD1: this->emitAtomicInst(I,ir::ATOMIC_OP_ADD); break;
|
|
||||||
case GEN_OCL_ATOMIC_SUB0:
|
|
||||||
- case GEN_OCL_ATOMIC_SUB1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_SUB); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_SUB1: this->emitAtomicInst(I,ir::ATOMIC_OP_SUB); break;
|
|
||||||
case GEN_OCL_ATOMIC_AND0:
|
|
||||||
- case GEN_OCL_ATOMIC_AND1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_AND); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_AND1: this->emitAtomicInst(I,ir::ATOMIC_OP_AND); break;
|
|
||||||
case GEN_OCL_ATOMIC_OR0:
|
|
||||||
- case GEN_OCL_ATOMIC_OR1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_OR); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_OR1: this->emitAtomicInst(I,ir::ATOMIC_OP_OR); break;
|
|
||||||
case GEN_OCL_ATOMIC_XOR0:
|
|
||||||
- case GEN_OCL_ATOMIC_XOR1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_XOR); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_XOR1: this->emitAtomicInst(I,ir::ATOMIC_OP_XOR); break;
|
|
||||||
case GEN_OCL_ATOMIC_XCHG0:
|
|
||||||
- case GEN_OCL_ATOMIC_XCHG1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_XCHG); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_XCHG1: this->emitAtomicInst(I,ir::ATOMIC_OP_XCHG); break;
|
|
||||||
case GEN_OCL_ATOMIC_INC0:
|
|
||||||
- case GEN_OCL_ATOMIC_INC1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_INC); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_INC1: this->emitAtomicInst(I,ir::ATOMIC_OP_INC); break;
|
|
||||||
case GEN_OCL_ATOMIC_DEC0:
|
|
||||||
- case GEN_OCL_ATOMIC_DEC1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_DEC); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_DEC1: this->emitAtomicInst(I,ir::ATOMIC_OP_DEC); break;
|
|
||||||
case GEN_OCL_ATOMIC_UMIN0:
|
|
||||||
- case GEN_OCL_ATOMIC_UMIN1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_UMIN); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_UMIN1: this->emitAtomicInst(I,ir::ATOMIC_OP_UMIN); break;
|
|
||||||
case GEN_OCL_ATOMIC_UMAX0:
|
|
||||||
- case GEN_OCL_ATOMIC_UMAX1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_UMAX); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_UMAX1: this->emitAtomicInst(I,ir::ATOMIC_OP_UMAX); break;
|
|
||||||
case GEN_OCL_ATOMIC_IMIN0:
|
|
||||||
- case GEN_OCL_ATOMIC_IMIN1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_IMIN); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_IMIN1: this->emitAtomicInst(I,ir::ATOMIC_OP_IMIN); break;
|
|
||||||
case GEN_OCL_ATOMIC_IMAX0:
|
|
||||||
- case GEN_OCL_ATOMIC_IMAX1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_IMAX); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_IMAX1: this->emitAtomicInst(I,ir::ATOMIC_OP_IMAX); break;
|
|
||||||
case GEN_OCL_ATOMIC_CMPXCHG0:
|
|
||||||
- case GEN_OCL_ATOMIC_CMPXCHG1: this->emitAtomicInst(I,CS,ir::ATOMIC_OP_CMPXCHG); break;
|
|
||||||
+ case GEN_OCL_ATOMIC_CMPXCHG1: this->emitAtomicInst(I,ir::ATOMIC_OP_CMPXCHG); break;
|
|
||||||
case GEN_OCL_GET_IMAGE_WIDTH:
|
|
||||||
case GEN_OCL_GET_IMAGE_HEIGHT:
|
|
||||||
case GEN_OCL_GET_IMAGE_DEPTH:
|
|
||||||
@@ -5429,48 +5427,48 @@
|
|
||||||
ctx.WAIT();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
- case GEN_OCL_WORK_GROUP_ALL: this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_ALL); break;
|
|
||||||
- case GEN_OCL_WORK_GROUP_ANY: this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_ANY); break;
|
|
||||||
+ case GEN_OCL_WORK_GROUP_ALL: this->emitWorkGroupInst(I, ir::WORKGROUP_OP_ALL); break;
|
|
||||||
+ case GEN_OCL_WORK_GROUP_ANY: this->emitWorkGroupInst(I, ir::WORKGROUP_OP_ANY); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_BROADCAST:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_BROADCAST); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_BROADCAST); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_REDUCE_ADD:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_REDUCE_ADD); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_REDUCE_ADD); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_REDUCE_MAX:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_REDUCE_MAX); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_REDUCE_MAX); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_REDUCE_MIN:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_REDUCE_MIN); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_REDUCE_MIN); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_SCAN_EXCLUSIVE_ADD:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_EXCLUSIVE_ADD); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_EXCLUSIVE_ADD); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_SCAN_EXCLUSIVE_MAX:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_EXCLUSIVE_MAX); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_EXCLUSIVE_MAX); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_SCAN_EXCLUSIVE_MIN:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_EXCLUSIVE_MIN); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_EXCLUSIVE_MIN); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_SCAN_INCLUSIVE_ADD:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_INCLUSIVE_ADD); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_INCLUSIVE_ADD); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_SCAN_INCLUSIVE_MAX:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_INCLUSIVE_MAX); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_INCLUSIVE_MAX); break;
|
|
||||||
case GEN_OCL_WORK_GROUP_SCAN_INCLUSIVE_MIN:
|
|
||||||
- this->emitWorkGroupInst(I, CS, ir::WORKGROUP_OP_INCLUSIVE_MIN); break;
|
|
||||||
+ this->emitWorkGroupInst(I, ir::WORKGROUP_OP_INCLUSIVE_MIN); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BROADCAST:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_BROADCAST); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_BROADCAST); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_REDUCE_ADD:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_REDUCE_ADD); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_REDUCE_ADD); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_REDUCE_MAX:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_REDUCE_MAX); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_REDUCE_MAX); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_REDUCE_MIN:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_REDUCE_MIN); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_REDUCE_MIN); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_SCAN_EXCLUSIVE_ADD:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_EXCLUSIVE_ADD); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_EXCLUSIVE_ADD); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_SCAN_EXCLUSIVE_MAX:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_EXCLUSIVE_MAX); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_EXCLUSIVE_MAX); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_SCAN_EXCLUSIVE_MIN:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_EXCLUSIVE_MIN); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_EXCLUSIVE_MIN); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_SCAN_INCLUSIVE_ADD:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_INCLUSIVE_ADD); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_INCLUSIVE_ADD); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_SCAN_INCLUSIVE_MAX:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_INCLUSIVE_MAX); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_INCLUSIVE_MAX); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_SCAN_INCLUSIVE_MIN:
|
|
||||||
- this->emitSubGroupInst(I, CS, ir::WORKGROUP_OP_INCLUSIVE_MIN); break;
|
|
||||||
+ this->emitSubGroupInst(I, ir::WORKGROUP_OP_INCLUSIVE_MIN); break;
|
|
||||||
case GEN_OCL_LRP:
|
|
||||||
{
|
|
||||||
const ir::Register dst = this->getRegister(&I);
|
|
||||||
@@ -5484,69 +5482,69 @@
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_UI_MEM:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, false, 1); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, false, 1); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_UI_MEM2:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, false, 2); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, false, 2); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_UI_MEM4:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, false, 4); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, false, 4); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_UI_MEM8:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, false, 8); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, false, 8); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_UI_MEM:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, true, 1); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, true, 1); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_UI_MEM2:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, true, 2); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, true, 2); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_UI_MEM4:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, true, 4); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, true, 4); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_UI_MEM8:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, true, 8); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, true, 8); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_UI_IMAGE:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, false, 1); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, false, 1); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_UI_IMAGE2:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, false, 2); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, false, 2); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_UI_IMAGE4:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, false, 4); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, false, 4); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_UI_IMAGE8:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, false, 8); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, false, 8); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_UI_IMAGE:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, true, 1); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, true, 1); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_UI_IMAGE2:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, true, 2); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, true, 2); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_UI_IMAGE4:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, true, 4); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, true, 4); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_UI_IMAGE8:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, true, 8); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, true, 8); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_US_MEM:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, false, 1, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, false, 1, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_US_MEM2:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, false, 2, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, false, 2, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_US_MEM4:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, false, 4, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, false, 4, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_US_MEM8:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, false, 8, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, false, 8, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_US_MEM:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, true, 1, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, true, 1, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_US_MEM2:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, true, 2, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, true, 2, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_US_MEM4:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, true, 4, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, true, 4, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_US_MEM8:
|
|
||||||
- this->emitBlockReadWriteMemInst(I, CS, true, 8, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteMemInst(I, true, 8, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_US_IMAGE:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, false, 1, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, false, 1, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_US_IMAGE2:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, false, 2, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, false, 2, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_US_IMAGE4:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, false, 4, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, false, 4, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_READ_US_IMAGE8:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, false, 8, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, false, 8, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_US_IMAGE:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, true, 1, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, true, 1, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_US_IMAGE2:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, true, 2, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, true, 2, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_US_IMAGE4:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, true, 4, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, true, 4, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_SUB_GROUP_BLOCK_WRITE_US_IMAGE8:
|
|
||||||
- this->emitBlockReadWriteImageInst(I, CS, true, 8, ir::TYPE_U16); break;
|
|
||||||
+ this->emitBlockReadWriteImageInst(I, true, 8, ir::TYPE_U16); break;
|
|
||||||
case GEN_OCL_GET_PIPE:
|
|
||||||
case GEN_OCL_MAKE_RID:
|
|
||||||
case GEN_OCL_GET_RID:
|
|
||||||
--- a/backend/src/llvm/llvm_includes.hpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_includes.hpp 2020-11-09 19:00:09.955926795 +0100
|
|
||||||
@@ -103,7 +103,6 @@
|
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 35
|
|
||||||
#include "llvm/IR/Mangler.h"
|
|
||||||
-#include "llvm/IR/CallSite.h"
|
|
||||||
#include "llvm/IR/CFG.h"
|
|
||||||
#include "llvm/IR/InstVisitor.h"
|
|
||||||
#include "llvm/IR/IRPrintingPasses.h"
|
|
||||||
--- a/backend/src/llvm/llvm_loadstore_optimization.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_loadstore_optimization.cpp 2020-11-09 19:10:37.141852308 +0100
|
|
||||||
@@ -160,7 +160,7 @@
|
|
||||||
Value *vecPtr = Builder.CreateBitCast(ld->getPointerOperand(),
|
|
||||||
PointerType::get(vecTy, addrSpace));
|
|
||||||
LoadInst *vecValue = Builder.CreateLoad(vecPtr);
|
|
||||||
- vecValue->setAlignment(align);
|
|
||||||
+ vecValue->setAlignment(align.valueOrOne());
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < size; ++i) {
|
|
||||||
Value *S = Builder.CreateExtractElement(vecValue, Builder.getInt32(i));
|
|
||||||
@@ -251,7 +251,7 @@
|
|
||||||
return;
|
|
||||||
Value *newPtr = Builder.CreateBitCast(stPointer, PointerType::get(vecTy, addrSpace));
|
|
||||||
StoreInst *newST = Builder.CreateStore(parent, newPtr);
|
|
||||||
- newST->setAlignment(align);
|
|
||||||
+ newST->setAlignment(align.valueOrOne());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find the safe iterator we can point to. If reorder happens, we need to
|
|
||||||
--- a/backend/src/llvm/llvm_passes.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_passes.cpp 2020-11-09 18:48:55.997006837 +0100
|
|
||||||
@@ -95,7 +95,7 @@
|
|
||||||
{
|
|
||||||
switch (Ty->getTypeID()) {
|
|
||||||
case Type::VoidTyID: NOT_SUPPORTED;
|
|
||||||
- case Type::VectorTyID:
|
|
||||||
+ case Type::FixedVectorTyID:
|
|
||||||
{
|
|
||||||
const VectorType* VecTy = cast<VectorType>(Ty);
|
|
||||||
uint32_t elemNum = VecTy->getNumElements();
|
|
||||||
@@ -138,7 +138,7 @@
|
|
||||||
case Type::HalfTyID: return 16;
|
|
||||||
case Type::FloatTyID: return 32;
|
|
||||||
case Type::DoubleTyID: return 64;
|
|
||||||
- case Type::VectorTyID:
|
|
||||||
+ case Type::FixedVectorTyID:
|
|
||||||
{
|
|
||||||
const VectorType* VecTy = cast<VectorType>(Ty);
|
|
||||||
uint32_t numElem = VecTy->getNumElements();
|
|
||||||
@@ -184,10 +184,12 @@
|
|
||||||
Type *elementType = NULL;
|
|
||||||
if (PointerType* ptrType = dyn_cast<PointerType>(eltTy))
|
|
||||||
elementType = ptrType->getElementType();
|
|
||||||
- else if(SequentialType * seqType = dyn_cast<SequentialType>(eltTy))
|
|
||||||
- elementType = seqType->getElementType();
|
|
||||||
- else if(CompositeType * compTy= dyn_cast<CompositeType>(eltTy))
|
|
||||||
- elementType = compTy->getTypeAtIndex(index);
|
|
||||||
+ else if (ArrayType * arrType = dyn_cast<ArrayType>(eltTy))
|
|
||||||
+ elementType = arrType->getElementType();
|
|
||||||
+ else if(VectorType * vecType = dyn_cast<VectorType>(eltTy))
|
|
||||||
+ elementType = vecType->getElementType();
|
|
||||||
+ else if(StructType * structType = dyn_cast<StructType>(eltTy))
|
|
||||||
+ elementType = structType->getTypeAtIndex(index);
|
|
||||||
GBE_ASSERT(elementType);
|
|
||||||
return elementType;
|
|
||||||
}
|
|
||||||
--- a/backend/src/llvm/llvm_printf_parser.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_printf_parser.cpp 2020-11-09 18:57:52.618943105 +0100
|
|
||||||
@@ -323,8 +323,7 @@
|
|
||||||
|
|
||||||
bool PrintfParser::parseOnePrintfInstruction(CallInst * call)
|
|
||||||
{
|
|
||||||
- CallSite CS(call);
|
|
||||||
- CallSite::arg_iterator CI_FMT = CS.arg_begin();
|
|
||||||
+ User::op_iterator CI_FMT = call->arg_begin();
|
|
||||||
int param_num = 0;
|
|
||||||
|
|
||||||
llvm::Constant* arg0 = dyn_cast<llvm::ConstantExpr>(*CI_FMT);
|
|
||||||
@@ -341,7 +340,7 @@
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
- std::string fmt = fmt_arg->getAsCString();
|
|
||||||
+ std::string fmt = fmt_arg->getAsCString().str();
|
|
||||||
if (fmt.size() == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
@@ -437,8 +436,8 @@
|
|
||||||
if ( callFunc->getIntrinsicID() != 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
- Value *Callee = call->getCalledValue();
|
|
||||||
- const std::string fnName = Callee->getName();
|
|
||||||
+ Value *Callee = call->getCalledOperand();
|
|
||||||
+ const std::string fnName = Callee->getName().str();
|
|
||||||
|
|
||||||
if (fnName != "__gen_ocl_printf_stub" && fnName != "__gen_ocl_puts_stub")
|
|
||||||
continue;
|
|
||||||
@@ -582,7 +581,7 @@
|
|
||||||
if (!fmt_arg || !fmt_arg->isCString()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
- slot.state.str = fmt_arg->getAsCString();
|
|
||||||
+ slot.state.str = fmt_arg->getAsCString().str();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case PRINTF_CONVERSION_P: {
|
|
||||||
@@ -595,10 +594,10 @@
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
- case Type::VectorTyID: {
|
|
||||||
- Type* vect_type = arg->getType();
|
|
||||||
- Type* elt_type = vect_type->getVectorElementType();
|
|
||||||
- int vec_num = vect_type->getVectorNumElements();
|
|
||||||
+ case Type::FixedVectorTyID: {
|
|
||||||
+ VectorType* vect_type = dyn_cast<VectorType>(arg->getType());
|
|
||||||
+ Type* elt_type = vect_type->getElementType();
|
|
||||||
+ int vec_num = vect_type->getNumElements();
|
|
||||||
bool sign = false;
|
|
||||||
|
|
||||||
if (vec_num != slot.state.vector_n) {
|
|
||||||
--- a/backend/src/llvm/llvm_profiling.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_profiling.cpp 2020-11-09 18:59:50.120929150 +0100
|
|
||||||
@@ -35,7 +35,6 @@
|
|
||||||
#include "llvm/IR/IRBuilder.h"
|
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 35
|
|
||||||
-#include "llvm/IR/CallSite.h"
|
|
||||||
#include "llvm/IR/CFG.h"
|
|
||||||
#else
|
|
||||||
#include "llvm/Support/CallSite.h"
|
|
||||||
--- a/backend/src/llvm/llvm_sampler_fix.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_sampler_fix.cpp 2020-11-09 17:01:09.407774832 +0100
|
|
||||||
@@ -45,8 +45,8 @@
|
|
||||||
bool visitCallInst(CallInst *I) {
|
|
||||||
if(!I)
|
|
||||||
return false;
|
|
||||||
- Value *Callee = I->getCalledValue();
|
|
||||||
- const std::string fnName = Callee->getName();
|
|
||||||
+ Value *Callee = I->getCalledOperand();
|
|
||||||
+ const std::string fnName = Callee->getName().str();
|
|
||||||
bool changed = false;
|
|
||||||
Type *boolTy = IntegerType::get(I->getContext(), 1);
|
|
||||||
Type *i32Ty = IntegerType::get(I->getContext(), 32);
|
|
||||||
@@ -59,7 +59,7 @@
|
|
||||||
Value *needFixVal;
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
|
|
||||||
CallInst *init = dyn_cast<CallInst>(I->getOperand(0));
|
|
||||||
- if (init && init->getCalledValue()->getName().compare("__translate_sampler_initializer"))
|
|
||||||
+ if (init && init->getCalledOperand()->getName().compare("__translate_sampler_initializer"))
|
|
||||||
{
|
|
||||||
const ConstantInt *ci = dyn_cast<ConstantInt>(init->getOperand(0));
|
|
||||||
uint32_t samplerInt = ci->getZExtValue();
|
|
||||||
@@ -113,7 +113,7 @@
|
|
||||||
Value *needFixVal;
|
|
||||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
|
|
||||||
CallInst *init = dyn_cast<CallInst>(I->getOperand(0));
|
|
||||||
- if (init && init->getCalledValue()->getName().compare("__translate_sampler_initializer"))
|
|
||||||
+ if (init && init->getCalledOperand()->getName().compare("__translate_sampler_initializer"))
|
|
||||||
{
|
|
||||||
const ConstantInt *ci = dyn_cast<ConstantInt>(init->getOperand(0));
|
|
||||||
uint32_t samplerInt = ci->getZExtValue();
|
|
||||||
--- a/backend/src/llvm/llvm_scalarize.cpp 2020-11-09 16:48:20.823866112 +0100
|
|
||||||
+++ b/backend/src/llvm/llvm_scalarize.cpp 2020-11-09 18:51:16.888990104 +0100
|
|
||||||
@@ -178,7 +178,7 @@
|
|
||||||
if(!type)
|
|
||||||
return type;
|
|
||||||
switch(type->getTypeID()) {
|
|
||||||
- case Type::VectorTyID:
|
|
||||||
+ case Type::FixedVectorTyID:
|
|
||||||
case Type::ArrayTyID:
|
|
||||||
return GetBasicType(type->getContainedType(0));
|
|
||||||
default:
|
|
||||||
@@ -188,7 +188,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
int GetComponentCount(const Type* type) {
|
|
||||||
- if (type && type->getTypeID() == Type::VectorTyID)
|
|
||||||
+ if (type && type->getTypeID() == Type::FixedVectorTyID)
|
|
||||||
return llvm::dyn_cast<VectorType>(type)->getNumElements();
|
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
@@ -652,13 +652,12 @@
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
- Value *Callee = call->getCalledValue();
|
|
||||||
- const std::string fnName = Callee->getName();
|
|
||||||
+ Value *Callee = call->getCalledOperand();
|
|
||||||
+ const std::string fnName = Callee->getName().str();
|
|
||||||
auto genIntrinsicID = intrinsicMap.find(fnName);
|
|
||||||
|
|
||||||
// Get the function arguments
|
|
||||||
- CallSite CS(call);
|
|
||||||
- CallSite::arg_iterator CI = CS.arg_begin() + 1;
|
|
||||||
+ User::op_iterator CI = call->arg_begin() + 1;
|
|
||||||
|
|
||||||
switch (genIntrinsicID) {
|
|
||||||
case GEN_OCL_NOT_FOUND:
|
|
||||||
@@ -729,7 +728,7 @@
|
|
||||||
extractFromVector(call);
|
|
||||||
break;
|
|
||||||
case GEN_OCL_PRINTF:
|
|
||||||
- for (; CI != CS.arg_end(); ++CI)
|
|
||||||
+ for (; CI != call->arg_end(); ++CI)
|
|
||||||
if ((*CI)->getType()->isVectorTy())
|
|
||||||
*CI = InsertToVector(call, *CI);
|
|
||||||
break;
|
|
|
@ -1,115 +0,0 @@
|
||||||
diff --git backend/src/llvm/ExpandLargeIntegers.cpp backend/src/llvm/ExpandLargeIntegers.cpp
|
|
||||||
index 8515dc13..27080380 100644
|
|
||||||
--- a/backend/src/llvm/ExpandLargeIntegers.cpp
|
|
||||||
+++ b/backend/src/llvm/ExpandLargeIntegers.cpp
|
|
||||||
@@ -328,7 +328,7 @@ static Value *buildVectorOrScalar(ConversionState &State, IRBuilder<> &IRB, Smal
|
|
||||||
// splited, that's why these temporary values should be erased.
|
|
||||||
bool KeepInsert = isLegalBitSize(ElemTy->getPrimitiveSizeInBits() * ElemNo);
|
|
||||||
for (unsigned i = 0; i < ElemNo; ++i) {
|
|
||||||
- Value *tmp = vec ? vec : UndefValue::get(VectorType::get(ElemTy, ElemNo));
|
|
||||||
+ Value *tmp = vec ? vec : UndefValue::get(VectorType::get(ElemTy, ElemNo, false));
|
|
||||||
Value *idx = ConstantInt::get(IntTy, i);
|
|
||||||
vec = IRB.CreateInsertElement(tmp, Elements[i], idx);
|
|
||||||
if (!KeepInsert && !isa<Constant>(vec)) {
|
|
||||||
@@ -373,7 +373,7 @@ static void unifyElementType(IRBuilder<> &IRB, SmallVector<Value *, 16> &Src, Sm
|
|
||||||
assert((Size % MinWidth) == 0);
|
|
||||||
|
|
||||||
if (Size > MinWidth) {
|
|
||||||
- VectorType *VecTy = VectorType::get(ElemTy, Size/MinWidth);
|
|
||||||
+ VectorType *VecTy = VectorType::get(ElemTy, Size/MinWidth, false);
|
|
||||||
Value *Casted = IRB.CreateBitCast(Src[i], VecTy);
|
|
||||||
for (unsigned j = 0; j < Size/MinWidth; j++)
|
|
||||||
Dst.push_back(IRB.CreateExtractElement(Casted, ConstantInt::get(IntTy, j)));
|
|
||||||
@@ -462,7 +462,7 @@ static void convertInstruction(Instruction *Inst, ConversionState &State,
|
|
||||||
unsigned ElemNo = Unified.size();
|
|
||||||
Type *ElemTy = Unified[0]->getType();
|
|
||||||
for (unsigned i = 0; i < ElemNo; ++i) {
|
|
||||||
- Value *tmp = vec ? vec : UndefValue::get(VectorType::get(ElemTy, ElemNo));
|
|
||||||
+ Value *tmp = vec ? vec : UndefValue::get(VectorType::get(ElemTy, ElemNo, false));
|
|
||||||
Value *idx = ConstantInt::get(IntTy, i);
|
|
||||||
vec = IRB.CreateInsertElement(tmp, Unified[i], idx);
|
|
||||||
}
|
|
||||||
diff --git backend/src/llvm/llvm_gen_backend.cpp backend/src/llvm/llvm_gen_backend.cpp
|
|
||||||
index c93d89cc..64d5b0e5 100644
|
|
||||||
--- a/backend/src/llvm/llvm_gen_backend.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_gen_backend.cpp
|
|
||||||
@@ -304,7 +304,7 @@ namespace gbe
|
|
||||||
TYPESIZEVEC(long,8)
|
|
||||||
TYPESIZEVEC(unsigned long,8)
|
|
||||||
else{
|
|
||||||
- StructType *StrTy = M->getTypeByName("struct."+name);
|
|
||||||
+ StructType *StrTy = StructType::getTypeByName(M->getContext(), "struct."+name);
|
|
||||||
if(StrTy)
|
|
||||||
return getTypeByteSize(unit,StrTy);
|
|
||||||
}
|
|
||||||
diff --git backend/src/llvm/llvm_loadstore_optimization.cpp backend/src/llvm/llvm_loadstore_optimization.cpp
|
|
||||||
index 5aa38bef..6b5c1bad 100644
|
|
||||||
--- a/backend/src/llvm/llvm_loadstore_optimization.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_loadstore_optimization.cpp
|
|
||||||
@@ -152,7 +152,7 @@ namespace gbe {
|
|
||||||
unsigned addrSpace = ld->getPointerAddressSpace();
|
|
||||||
// insert before first load
|
|
||||||
Builder.SetInsertPoint(ld);
|
|
||||||
- VectorType *vecTy = VectorType::get(ld->getType(), size);
|
|
||||||
+ VectorType *vecTy = VectorType::get(ld->getType(), size, false);
|
|
||||||
Value *vecPtr = Builder.CreateBitCast(ld->getPointerOperand(),
|
|
||||||
PointerType::get(vecTy, addrSpace));
|
|
||||||
LoadInst *vecValue = Builder.CreateLoad(vecPtr);
|
|
||||||
@@ -236,7 +236,7 @@ namespace gbe {
|
|
||||||
Builder.SetInsertPoint(merged[size-1]);
|
|
||||||
|
|
||||||
Type *dataTy = st->getValueOperand()->getType();
|
|
||||||
- VectorType *vecTy = VectorType::get(dataTy, size);
|
|
||||||
+ VectorType *vecTy = VectorType::get(dataTy, size, false);
|
|
||||||
Value * parent = UndefValue::get(vecTy);
|
|
||||||
for(unsigned i = 0; i < size; i++) {
|
|
||||||
parent = Builder.CreateInsertElement(parent, values[i], ConstantInt::get(IntegerType::get(st->getContext(), 32), i));
|
|
||||||
diff --git backend/src/llvm/llvm_printf_parser.cpp backend/src/llvm/llvm_printf_parser.cpp
|
|
||||||
index 6bb7c52a..af459cd2 100644
|
|
||||||
--- a/backend/src/llvm/llvm_printf_parser.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_printf_parser.cpp
|
|
||||||
@@ -630,7 +630,7 @@ error:
|
|
||||||
if (elt_type != elt_dst_type) {
|
|
||||||
Value *II = NULL;
|
|
||||||
for (int i = 0; i < vec_num; i++) {
|
|
||||||
- Value *vec = II ? II : UndefValue::get(VectorType::get(elt_dst_type, vec_num));
|
|
||||||
+ Value *vec = II ? II : UndefValue::get(VectorType::get(elt_dst_type, vec_num, false));
|
|
||||||
Value *cv = ConstantInt::get(Type::getInt32Ty(elt_type->getContext()), i);
|
|
||||||
Value *org = builder->CreateExtractElement(arg, cv);
|
|
||||||
Value *cvt = builder->CreateIntCast(org, elt_dst_type, sign);
|
|
||||||
@@ -658,7 +658,7 @@ error:
|
|
||||||
if (elt_type->getTypeID() != Type::FloatTyID) {
|
|
||||||
Value *II = NULL;
|
|
||||||
for (int i = 0; i < vec_num; i++) {
|
|
||||||
- Value *vec = II ? II : UndefValue::get(VectorType::get(Type::getFloatTy(elt_type->getContext()), vec_num));
|
|
||||||
+ Value *vec = II ? II : UndefValue::get(VectorType::get(Type::getFloatTy(elt_type->getContext()), vec_num, false));
|
|
||||||
Value *cv = ConstantInt::get(Type::getInt32Ty(elt_type->getContext()), i);
|
|
||||||
Value *org = builder->CreateExtractElement(arg, cv);
|
|
||||||
Value* cvt = builder->CreateFPCast(org, Type::getFloatTy(module->getContext()));
|
|
||||||
diff --git backend/src/llvm/llvm_to_gen.cpp backend/src/llvm/llvm_to_gen.cpp
|
|
||||||
index 7f7deffe..9e8ccc67 100644
|
|
||||||
--- a/backend/src/llvm/llvm_to_gen.cpp
|
|
||||||
+++ b/backend/src/llvm/llvm_to_gen.cpp
|
|
||||||
@@ -358,7 +358,7 @@ namespace gbe
|
|
||||||
passes.add(createScalarReplAggregatesPass(64, true, -1, -1, 64));
|
|
||||||
#endif
|
|
||||||
passes.add(createLoadStoreOptimizationPass());
|
|
||||||
- passes.add(createConstantPropagationPass());
|
|
||||||
+ //passes.add(createConstantPropagationPass());
|
|
||||||
passes.add(createPromoteMemoryToRegisterPass());
|
|
||||||
if(optLevel > 0)
|
|
||||||
passes.add(createGVNPass()); // Remove redundancies
|
|
||||||
@@ -367,11 +367,11 @@ namespace gbe
|
|
||||||
passes.add(createScalarizePass()); // Expand all vector ops
|
|
||||||
passes.add(createExpandLargeIntegersPass()); // legalize large integer operation
|
|
||||||
passes.add(createInstructionCombiningPass()); // legalize will generate some silly instructions
|
|
||||||
- passes.add(createConstantPropagationPass()); // propagate constant after scalarize/legalize
|
|
||||||
+ //passes.add(createConstantPropagationPass()); // propagate constant after scalarize/legalize
|
|
||||||
passes.add(createExpandConstantExprPass()); // constant prop may generate ConstantExpr
|
|
||||||
passes.add(createPromoteIntegersPass()); // align integer size to power of two
|
|
||||||
passes.add(createRemoveGEPPass(unit)); // Constant prop may generate gep
|
|
||||||
- passes.add(createDeadInstEliminationPass()); // Remove simplified instructions
|
|
||||||
+ //passes.add(createDeadInstEliminationPass()); // Remove simplified instructions
|
|
||||||
passes.add(createCFGSimplificationPass()); // Merge & remove BBs
|
|
||||||
passes.add(createLowerSwitchPass()); // simplify cfg will generate switch-case instruction
|
|
||||||
if (profiling) {
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- a/backend/src/backend/gen/gen_mesa_disasm.c
|
|
||||||
+++ b/backend/src/backend/gen/gen_mesa_disasm.c
|
|
||||||
@@ -1137,7 +1137,7 @@ static uint32_t __conv_half_to_float(uint16_t h)
|
|
||||||
// Adjust mantissa so it's normalized (and keep
|
|
||||||
// track of exponent adjustment)
|
|
||||||
int e = -1;
|
|
||||||
- uint m = i.mantissa;
|
|
||||||
+ unsigned int m = i.mantissa;
|
|
||||||
do {
|
|
||||||
e++;
|
|
||||||
m <<= 1;
|
|
|
@ -1,23 +0,0 @@
|
||||||
# Template file for 'beignet'
|
|
||||||
pkgname=beignet
|
|
||||||
version=1.3.2
|
|
||||||
revision=10
|
|
||||||
archs="i686* x86_64*"
|
|
||||||
build_style=cmake
|
|
||||||
hostmakedepends="clang llvm pkg-config"
|
|
||||||
makedepends="MesaLib-devel libedit-devel libffi-devel ocl-icd-devel zlib-devel
|
|
||||||
libXfixes-devel"
|
|
||||||
depends="ocl-icd"
|
|
||||||
short_desc="Beignet GPGPU System for Intel GPUs"
|
|
||||||
maintainer="Orphaned <orphan@voidlinux.org>"
|
|
||||||
license="LGPL-2.1-or-later"
|
|
||||||
homepage="http://www.freedesktop.org/wiki/Software/Beignet/"
|
|
||||||
distfiles="https://01.org/sites/default/files/${pkgname}-${version}-source.tar.gz"
|
|
||||||
checksum=c555edba149de23243965a703f39f79fa06f15bcff5a3762b5544b0925010b43
|
|
||||||
|
|
||||||
export CXXFLAGS="-std=c++14"
|
|
||||||
|
|
||||||
post_install() {
|
|
||||||
# remove CL headers, we do use opencl-headers instead.
|
|
||||||
rm -r ${DESTDIR}/usr/include
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
site="https://01.org/beignet/downloads"
|
|
|
@ -35,6 +35,7 @@ replaces="
|
||||||
atom<=1.44.0_1
|
atom<=1.44.0_1
|
||||||
avogadro-devel<=1.2.0_8
|
avogadro-devel<=1.2.0_8
|
||||||
avogadro<=1.2.0_9
|
avogadro<=1.2.0_9
|
||||||
|
beignet<=1.3.2_10
|
||||||
bgc<=1.0.1_1
|
bgc<=1.0.1_1
|
||||||
bokken<=1.8_3
|
bokken<=1.8_3
|
||||||
bomi<=0.9.11_17
|
bomi<=0.9.11_17
|
||||||
|
|
Loading…
Reference in New Issue