Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 1 | //===------ LoopGenerators.cpp - IR helper to create loops ---------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains functions to create scalar and OpenMP parallel loops |
| 11 | // as LLVM-IR. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 15 | #include "polly/ScopDetection.h" |
Hongbin Zheng | 8a84661 | 2012-04-25 13:18:28 +0000 | [diff] [blame] | 16 | #include "polly/CodeGen/LoopGenerators.h" |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 17 | #include "llvm/Analysis/Dominators.h" |
Chandler Carruth | 535d52c | 2013-01-02 11:47:44 +0000 | [diff] [blame] | 18 | #include "llvm/IR/DataLayout.h" |
Tobias Grosser | 8362818 | 2013-05-07 08:11:54 +0000 | [diff] [blame^] | 19 | #include "llvm/IR/Module.h" |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 20 | #include "llvm/Transforms/Utils/BasicBlockUtils.h" |
| 21 | |
| 22 | using namespace llvm; |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 23 | using namespace polly; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 24 | |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 25 | Value *polly::createLoop(Value *LB, Value *UB, Value *Stride, |
Tobias Grosser | 1bb59b0 | 2012-12-29 23:47:38 +0000 | [diff] [blame] | 26 | IRBuilder<> &Builder, Pass *P, BasicBlock *&AfterBlock, |
Tobias Grosser | c967d8e | 2012-10-16 07:29:13 +0000 | [diff] [blame] | 27 | ICmpInst::Predicate Predicate) { |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 28 | DominatorTree &DT = P->getAnalysis<DominatorTree>(); |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 29 | Function *F = Builder.GetInsertBlock()->getParent(); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 30 | LLVMContext &Context = F->getContext(); |
| 31 | |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 32 | BasicBlock *PreheaderBB = Builder.GetInsertBlock(); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 33 | BasicBlock *HeaderBB = BasicBlock::Create(Context, "polly.loop_header", F); |
| 34 | BasicBlock *BodyBB = BasicBlock::Create(Context, "polly.loop_body", F); |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 35 | BasicBlock *AfterBB = SplitBlock(PreheaderBB, Builder.GetInsertPoint()++, P); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 36 | AfterBB->setName("polly.loop_after"); |
| 37 | |
| 38 | PreheaderBB->getTerminator()->setSuccessor(0, HeaderBB); |
| 39 | DT.addNewBlock(HeaderBB, PreheaderBB); |
| 40 | |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 41 | Builder.SetInsertPoint(HeaderBB); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 42 | |
| 43 | // Use the type of upper and lower bound. |
Tobias Grosser | ae2d83e | 2012-12-29 23:57:18 +0000 | [diff] [blame] | 44 | assert(LB->getType() == UB->getType() && |
| 45 | "Different types for upper and lower bound."); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 46 | |
| 47 | IntegerType *LoopIVType = dyn_cast<IntegerType>(UB->getType()); |
| 48 | assert(LoopIVType && "UB is not integer?"); |
| 49 | |
| 50 | // IV |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 51 | PHINode *IV = Builder.CreatePHI(LoopIVType, 2, "polly.loopiv"); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 52 | IV->addIncoming(LB, PreheaderBB); |
| 53 | |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 54 | Stride = Builder.CreateZExtOrBitCast(Stride, LoopIVType); |
Tobias Grosser | 400a4ac | 2012-05-29 09:11:59 +0000 | [diff] [blame] | 55 | Value *IncrementedIV = Builder.CreateNSWAdd(IV, Stride, "polly.next_loopiv"); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 56 | |
| 57 | // Exit condition. |
| 58 | Value *CMP; |
Tobias Grosser | c967d8e | 2012-10-16 07:29:13 +0000 | [diff] [blame] | 59 | CMP = Builder.CreateICmp(Predicate, IV, UB); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 60 | |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 61 | Builder.CreateCondBr(CMP, BodyBB, AfterBB); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 62 | DT.addNewBlock(BodyBB, HeaderBB); |
| 63 | |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 64 | Builder.SetInsertPoint(BodyBB); |
| 65 | Builder.CreateBr(HeaderBB); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 66 | IV->addIncoming(IncrementedIV, BodyBB); |
| 67 | DT.changeImmediateDominator(AfterBB, HeaderBB); |
| 68 | |
Hongbin Zheng | 4ac4e15 | 2012-04-23 13:03:56 +0000 | [diff] [blame] | 69 | Builder.SetInsertPoint(BodyBB->begin()); |
| 70 | AfterBlock = AfterBB; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 71 | |
| 72 | return IV; |
| 73 | } |
| 74 | |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 75 | void OMPGenerator::createCallParallelLoopStart( |
| 76 | Value *SubFunction, Value *SubfunctionParam, Value *NumberOfThreads, |
| 77 | Value *LowerBound, Value *UpperBound, Value *Stride) { |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 78 | Module *M = getModule(); |
| 79 | const char *Name = "GOMP_parallel_loop_runtime_start"; |
| 80 | Function *F = M->getFunction(Name); |
| 81 | |
| 82 | // If F is not available, declare it. |
| 83 | if (!F) { |
| 84 | Type *LongTy = getIntPtrTy(); |
| 85 | GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage; |
| 86 | |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 87 | Type *Params[] = { PointerType::getUnqual(FunctionType::get( |
| 88 | Builder.getVoidTy(), Builder.getInt8PtrTy(), false)), |
| 89 | Builder.getInt8PtrTy(), Builder.getInt32Ty(), LongTy, |
| 90 | LongTy, LongTy, }; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 91 | |
| 92 | FunctionType *Ty = FunctionType::get(Builder.getVoidTy(), Params, false); |
| 93 | F = Function::Create(Ty, Linkage, Name, M); |
| 94 | } |
| 95 | |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 96 | Value *Args[] = { SubFunction, SubfunctionParam, NumberOfThreads, LowerBound, |
| 97 | UpperBound, Stride, }; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 98 | |
| 99 | Builder.CreateCall(F, Args); |
| 100 | } |
| 101 | |
Tobias Grosser | e602a07 | 2013-05-07 07:30:56 +0000 | [diff] [blame] | 102 | Value *OMPGenerator::createCallLoopNext(Value *LowerBoundPtr, |
| 103 | Value *UpperBoundPtr) { |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 104 | Module *M = getModule(); |
| 105 | const char *Name = "GOMP_loop_runtime_next"; |
| 106 | Function *F = M->getFunction(Name); |
| 107 | |
| 108 | // If F is not available, declare it. |
| 109 | if (!F) { |
| 110 | Type *LongPtrTy = PointerType::getUnqual(getIntPtrTy()); |
| 111 | GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage; |
| 112 | |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 113 | Type *Params[] = { LongPtrTy, LongPtrTy, }; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 114 | |
| 115 | FunctionType *Ty = FunctionType::get(Builder.getInt8Ty(), Params, false); |
| 116 | F = Function::Create(Ty, Linkage, Name, M); |
| 117 | } |
| 118 | |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 119 | Value *Args[] = { LowerBoundPtr, UpperBoundPtr, }; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 120 | |
| 121 | Value *Return = Builder.CreateCall(F, Args); |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 122 | Return = Builder.CreateICmpNE( |
| 123 | Return, Builder.CreateZExt(Builder.getFalse(), Return->getType())); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 124 | return Return; |
| 125 | } |
| 126 | |
| 127 | void OMPGenerator::createCallParallelEnd() { |
| 128 | const char *Name = "GOMP_parallel_end"; |
| 129 | Module *M = getModule(); |
| 130 | Function *F = M->getFunction(Name); |
| 131 | |
| 132 | // If F is not available, declare it. |
| 133 | if (!F) { |
| 134 | GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage; |
| 135 | |
| 136 | FunctionType *Ty = FunctionType::get(Builder.getVoidTy(), false); |
| 137 | F = Function::Create(Ty, Linkage, Name, M); |
| 138 | } |
| 139 | |
| 140 | Builder.CreateCall(F); |
| 141 | } |
| 142 | |
| 143 | void OMPGenerator::createCallLoopEndNowait() { |
| 144 | const char *Name = "GOMP_loop_end_nowait"; |
| 145 | Module *M = getModule(); |
| 146 | Function *F = M->getFunction(Name); |
| 147 | |
| 148 | // If F is not available, declare it. |
| 149 | if (!F) { |
| 150 | GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage; |
| 151 | |
| 152 | FunctionType *Ty = FunctionType::get(Builder.getVoidTy(), false); |
| 153 | F = Function::Create(Ty, Linkage, Name, M); |
| 154 | } |
| 155 | |
| 156 | Builder.CreateCall(F); |
| 157 | } |
| 158 | |
| 159 | IntegerType *OMPGenerator::getIntPtrTy() { |
Tobias Grosser | 5d01691d | 2012-11-01 16:45:18 +0000 | [diff] [blame] | 160 | return P->getAnalysis<DataLayout>().getIntPtrType(Builder.getContext()); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | Module *OMPGenerator::getModule() { |
| 164 | return Builder.GetInsertBlock()->getParent()->getParent(); |
| 165 | } |
| 166 | |
| 167 | Function *OMPGenerator::createSubfunctionDefinition() { |
| 168 | Module *M = getModule(); |
| 169 | Function *F = Builder.GetInsertBlock()->getParent(); |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 170 | std::vector<Type *> Arguments(1, Builder.getInt8PtrTy()); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 171 | FunctionType *FT = FunctionType::get(Builder.getVoidTy(), Arguments, false); |
| 172 | Function *FN = Function::Create(FT, Function::InternalLinkage, |
| 173 | F->getName() + ".omp_subfn", M); |
| 174 | // Do not run any polly pass on the new function. |
| 175 | P->getAnalysis<polly::ScopDetection>().markFunctionAsInvalid(FN); |
| 176 | |
| 177 | Function::arg_iterator AI = FN->arg_begin(); |
| 178 | AI->setName("omp.userContext"); |
| 179 | |
| 180 | return FN; |
| 181 | } |
| 182 | |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 183 | Value *OMPGenerator::loadValuesIntoStruct(SetVector<Value *> &Values) { |
| 184 | std::vector<Type *> Members; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 185 | |
| 186 | for (unsigned i = 0; i < Values.size(); i++) |
| 187 | Members.push_back(Values[i]->getType()); |
| 188 | |
| 189 | StructType *Ty = StructType::get(Builder.getContext(), Members); |
| 190 | Value *Struct = Builder.CreateAlloca(Ty, 0, "omp.userContext"); |
| 191 | |
| 192 | for (unsigned i = 0; i < Values.size(); i++) { |
| 193 | Value *Address = Builder.CreateStructGEP(Struct, i); |
| 194 | Builder.CreateStore(Values[i], Address); |
| 195 | } |
| 196 | |
| 197 | return Struct; |
| 198 | } |
| 199 | |
Tobias Grosser | e602a07 | 2013-05-07 07:30:56 +0000 | [diff] [blame] | 200 | void OMPGenerator::extractValuesFromStruct(SetVector<Value *> OldValues, |
| 201 | Value *Struct, |
| 202 | ValueToValueMapTy &Map) { |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 203 | for (unsigned i = 0; i < OldValues.size(); i++) { |
| 204 | Value *Address = Builder.CreateStructGEP(Struct, i); |
| 205 | Value *NewValue = Builder.CreateLoad(Address); |
Andy Gibbs | 36e6ca0 | 2013-03-20 15:42:59 +0000 | [diff] [blame] | 206 | Map.insert(std::make_pair(OldValues[i], NewValue)); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 207 | } |
| 208 | } |
| 209 | |
Tobias Grosser | e602a07 | 2013-05-07 07:30:56 +0000 | [diff] [blame] | 210 | Value *OMPGenerator::createSubfunction(Value *Stride, Value *StructData, |
| 211 | SetVector<Value *> Data, |
| 212 | ValueToValueMapTy &Map, |
| 213 | Function **SubFunction) { |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 214 | Function *FN = createSubfunctionDefinition(); |
| 215 | |
| 216 | BasicBlock *PrevBB, *HeaderBB, *ExitBB, *CheckNextBB, *LoadIVBoundsBB, |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 217 | *AfterBB; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 218 | Value *LowerBoundPtr, *UpperBoundPtr, *UserContext, *Ret1, *HasNextSchedule, |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 219 | *LowerBound, *UpperBound, *IV; |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 220 | Type *IntPtrTy = getIntPtrTy(); |
| 221 | LLVMContext &Context = FN->getContext(); |
| 222 | |
| 223 | // Store the previous basic block. |
| 224 | PrevBB = Builder.GetInsertBlock(); |
| 225 | |
| 226 | // Create basic blocks. |
| 227 | HeaderBB = BasicBlock::Create(Context, "omp.setup", FN); |
| 228 | ExitBB = BasicBlock::Create(Context, "omp.exit", FN); |
| 229 | CheckNextBB = BasicBlock::Create(Context, "omp.checkNext", FN); |
| 230 | LoadIVBoundsBB = BasicBlock::Create(Context, "omp.loadIVBounds", FN); |
| 231 | |
| 232 | DominatorTree &DT = P->getAnalysis<DominatorTree>(); |
| 233 | DT.addNewBlock(HeaderBB, PrevBB); |
| 234 | DT.addNewBlock(ExitBB, HeaderBB); |
| 235 | DT.addNewBlock(CheckNextBB, HeaderBB); |
| 236 | DT.addNewBlock(LoadIVBoundsBB, HeaderBB); |
| 237 | |
| 238 | // Fill up basic block HeaderBB. |
| 239 | Builder.SetInsertPoint(HeaderBB); |
| 240 | LowerBoundPtr = Builder.CreateAlloca(IntPtrTy, 0, "omp.lowerBoundPtr"); |
| 241 | UpperBoundPtr = Builder.CreateAlloca(IntPtrTy, 0, "omp.upperBoundPtr"); |
| 242 | UserContext = Builder.CreateBitCast(FN->arg_begin(), StructData->getType(), |
| 243 | "omp.userContext"); |
| 244 | |
| 245 | extractValuesFromStruct(Data, UserContext, Map); |
| 246 | Builder.CreateBr(CheckNextBB); |
| 247 | |
| 248 | // Add code to check if another set of iterations will be executed. |
| 249 | Builder.SetInsertPoint(CheckNextBB); |
| 250 | Ret1 = createCallLoopNext(LowerBoundPtr, UpperBoundPtr); |
| 251 | HasNextSchedule = Builder.CreateTrunc(Ret1, Builder.getInt1Ty(), |
| 252 | "omp.hasNextScheduleBlock"); |
| 253 | Builder.CreateCondBr(HasNextSchedule, LoadIVBoundsBB, ExitBB); |
| 254 | |
| 255 | // Add code to to load the iv bounds for this set of iterations. |
| 256 | Builder.SetInsertPoint(LoadIVBoundsBB); |
| 257 | LowerBound = Builder.CreateLoad(LowerBoundPtr, "omp.lowerBound"); |
| 258 | UpperBound = Builder.CreateLoad(UpperBoundPtr, "omp.upperBound"); |
| 259 | |
| 260 | // Subtract one as the upper bound provided by openmp is a < comparison |
| 261 | // whereas the codegenForSequential function creates a <= comparison. |
| 262 | UpperBound = Builder.CreateSub(UpperBound, ConstantInt::get(IntPtrTy, 1), |
| 263 | "omp.upperBoundAdjusted"); |
| 264 | |
| 265 | Builder.CreateBr(CheckNextBB); |
| 266 | Builder.SetInsertPoint(--Builder.GetInsertPoint()); |
Tobias Grosser | c967d8e | 2012-10-16 07:29:13 +0000 | [diff] [blame] | 267 | IV = createLoop(LowerBound, UpperBound, Stride, Builder, P, AfterBB, |
| 268 | ICmpInst::ICMP_SLE); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 269 | |
| 270 | BasicBlock::iterator LoopBody = Builder.GetInsertPoint(); |
| 271 | Builder.SetInsertPoint(AfterBB->begin()); |
| 272 | |
| 273 | // Add code to terminate this openmp subfunction. |
| 274 | Builder.SetInsertPoint(ExitBB); |
| 275 | createCallLoopEndNowait(); |
| 276 | Builder.CreateRetVoid(); |
| 277 | |
| 278 | Builder.SetInsertPoint(LoopBody); |
| 279 | *SubFunction = FN; |
| 280 | |
| 281 | return IV; |
| 282 | } |
| 283 | |
Tobias Grosser | e602a07 | 2013-05-07 07:30:56 +0000 | [diff] [blame] | 284 | Value *OMPGenerator::createParallelLoop(Value *LowerBound, Value *UpperBound, |
| 285 | Value *Stride, |
| 286 | SetVector<Value *> &Values, |
| 287 | ValueToValueMapTy &Map, |
| 288 | BasicBlock::iterator *LoopBody) { |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 289 | Value *Struct, *IV, *SubfunctionParam, *NumberOfThreads; |
| 290 | Function *SubFunction; |
| 291 | |
| 292 | Struct = loadValuesIntoStruct(Values); |
| 293 | |
| 294 | BasicBlock::iterator PrevInsertPoint = Builder.GetInsertPoint(); |
| 295 | IV = createSubfunction(Stride, Struct, Values, Map, &SubFunction); |
| 296 | *LoopBody = Builder.GetInsertPoint(); |
| 297 | Builder.SetInsertPoint(PrevInsertPoint); |
| 298 | |
| 299 | // Create call for GOMP_parallel_loop_runtime_start. |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 300 | SubfunctionParam = |
| 301 | Builder.CreateBitCast(Struct, Builder.getInt8PtrTy(), "omp_data"); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 302 | |
| 303 | NumberOfThreads = Builder.getInt32(0); |
| 304 | |
| 305 | // Add one as the upper bound provided by openmp is a < comparison |
| 306 | // whereas the codegenForSequential function creates a <= comparison. |
Tobias Grosser | c14582f | 2013-02-05 18:01:29 +0000 | [diff] [blame] | 307 | UpperBound = |
| 308 | Builder.CreateAdd(UpperBound, ConstantInt::get(getIntPtrTy(), 1)); |
Tobias Grosser | f74a4cd | 2012-03-23 10:35:18 +0000 | [diff] [blame] | 309 | |
| 310 | createCallParallelLoopStart(SubFunction, SubfunctionParam, NumberOfThreads, |
| 311 | LowerBound, UpperBound, Stride); |
| 312 | Builder.CreateCall(SubFunction, SubfunctionParam); |
| 313 | createCallParallelEnd(); |
| 314 | |
| 315 | return IV; |
| 316 | } |