Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 710640 | Differences between
and this patch

Collapse All | Expand All

(-)a/CMake/FindLLVM.cmake.orig (+3 lines)
Lines 116-121 macro(add_one_lib name) Link Here
116
endmacro()
116
endmacro()
117
117
118
#Assume clang lib path same as llvm lib path
118
#Assume clang lib path same as llvm lib path
119
if (LLVM_VERSION_NODOT VERSION_GREATER 80)
120
add_one_lib("clang-cpp")
121
endif (LLVM_VERSION_NODOT VERSION_GREATER 80)
119
add_one_lib("clangCodeGen")
122
add_one_lib("clangCodeGen")
120
add_one_lib("clangFrontend")
123
add_one_lib("clangFrontend")
121
add_one_lib("clangSerialization")
124
add_one_lib("clangSerialization")
(-)a/backend/src/llvm/llvm_intrinsic_lowering.cpp.orig (+4 lines)
Lines 77-83 namespace gbe { Link Here
77
        std::vector<Type *> ParamTys;
77
        std::vector<Type *> ParamTys;
78
        for (Value** I = ArgBegin; I != ArgEnd; ++I)
78
        for (Value** I = ArgBegin; I != ArgEnd; ++I)
79
          ParamTys.push_back((*I)->getType());
79
          ParamTys.push_back((*I)->getType());
80
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
81
        FunctionCallee FCache = M->getOrInsertFunction(NewFn,
82
#else
80
        Constant* FCache = M->getOrInsertFunction(NewFn,
83
        Constant* FCache = M->getOrInsertFunction(NewFn,
84
#endif
81
                                        FunctionType::get(RetTy, ParamTys, false));
85
                                        FunctionType::get(RetTy, ParamTys, false));
82
86
83
        IRBuilder<> Builder(CI->getParent(), BasicBlock::iterator(CI));
87
        IRBuilder<> Builder(CI->getParent(), BasicBlock::iterator(CI));
(-)a/backend/src/llvm/llvm_sampler_fix.cpp.orig (+8 lines)
Lines 82-88 namespace gbe { Link Here
82
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
82
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
83
          Module *M = I->getParent()->getParent()->getParent();
83
          Module *M = I->getParent()->getParent()->getParent();
84
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
84
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
85
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
86
          FunctionCallee samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
87
#else
85
          Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
88
          Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
89
#endif
86
#else
90
#else
87
          Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType(), nullptr);
91
          Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType(), nullptr);
88
#endif
92
#endif
Lines 124-130 namespace gbe { Link Here
124
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
128
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
125
          Module *M = I->getParent()->getParent()->getParent();
129
          Module *M = I->getParent()->getParent()->getParent();
126
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
130
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
131
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
132
          FunctionCallee samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
133
#else
127
          Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
134
          Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
135
#endif
128
#else
136
#else
129
          Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType(), nullptr);
137
          Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType(), nullptr);
130
#endif
138
#endif
(-)a/backend/src/llvm/llvm_profiling.cpp.orig (+16 lines)
Lines 163-172 namespace gbe Link Here
163
      // __gen_ocl_store_timestamp(int nth, int type);
163
      // __gen_ocl_store_timestamp(int nth, int type);
164
      Value *Args[2] = {ConstantInt::get(intTy, pointNum++), ConstantInt::get(intTy, profilingType)};
164
      Value *Args[2] = {ConstantInt::get(intTy, pointNum++), ConstantInt::get(intTy, profilingType)};
165
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
165
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
166
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
167
      builder->CreateCall(module->getOrInsertFunction(
168
#else
166
      builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
169
      builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
170
#endif
167
              "__gen_ocl_calc_timestamp", Type::getVoidTy(module->getContext()),
171
              "__gen_ocl_calc_timestamp", Type::getVoidTy(module->getContext()),
168
              IntegerType::getInt32Ty(module->getContext()),
172
              IntegerType::getInt32Ty(module->getContext()),
173
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
174
              IntegerType::getInt32Ty(module->getContext())),
175
#else
169
              IntegerType::getInt32Ty(module->getContext()))),
176
              IntegerType::getInt32Ty(module->getContext()))),
177
#endif
170
              ArrayRef<Value*>(Args));
178
              ArrayRef<Value*>(Args));
171
#else
179
#else
172
      builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
180
      builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
Lines 185-194 namespace gbe Link Here
185
    Value *Args2[2] = {profilingBuf, ConstantInt::get(intTy, profilingType)};
193
    Value *Args2[2] = {profilingBuf, ConstantInt::get(intTy, profilingType)};
186
194
187
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
195
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
196
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
197
    builder->CreateCall(module->getOrInsertFunction(
198
#else
188
    builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
199
    builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
200
#endif
189
            "__gen_ocl_store_profiling", Type::getVoidTy(module->getContext()),
201
            "__gen_ocl_store_profiling", Type::getVoidTy(module->getContext()),
190
            ptrTy,
202
            ptrTy,
203
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
204
            IntegerType::getInt32Ty(module->getContext())),
205
#else
191
            IntegerType::getInt32Ty(module->getContext()))),
206
            IntegerType::getInt32Ty(module->getContext()))),
207
#endif
192
            ArrayRef<Value*>(Args2));
208
            ArrayRef<Value*>(Args2));
193
#else
209
#else
194
    builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
210
    builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
(-)a/backend/src/llvm/llvm_device_enqueue.cpp.orig (+5 lines)
Lines 398-405 namespace gbe { Link Here
398
              std::vector<Type *> ParamTys;
398
              std::vector<Type *> ParamTys;
399
              for (Value** iter = args.begin(); iter != args.end(); ++iter)
399
              for (Value** iter = args.begin(); iter != args.end(); ++iter)
400
                ParamTys.push_back((*iter)->getType());
400
                ParamTys.push_back((*iter)->getType());
401
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
402
              CallInst* newCI = builder.CreateCall(mod->getOrInsertFunction(
403
                              "__gen_enqueue_kernel_slm", FunctionType::get(intTy, ParamTys, false)), args);
404
#else
401
              CallInst* newCI = builder.CreateCall(cast<llvm::Function>(mod->getOrInsertFunction(
405
              CallInst* newCI = builder.CreateCall(cast<llvm::Function>(mod->getOrInsertFunction(
402
                              "__gen_enqueue_kernel_slm", FunctionType::get(intTy, ParamTys, false))), args);
406
                              "__gen_enqueue_kernel_slm", FunctionType::get(intTy, ParamTys, false))), args);
407
#endif
403
              CI->replaceAllUsesWith(newCI);
408
              CI->replaceAllUsesWith(newCI);
404
              deadInsnSet.insert(CI);
409
              deadInsnSet.insert(CI);
405
            }
410
            }

Return to bug 710640