/// @param LB The lower bound for the loop we parallelize.
/// @param UB The upper bound for the loop we parallelize.
/// @param Stride The stride of the loop we parallelize.
- virtual void deployParallelExecution(Value *SubFn, Value *SubFnParam,
+ virtual void deployParallelExecution(Function *SubFn, Value *SubFnParam,
Value *LB, Value *UB, Value *Stride) = 0;
/// Prepare the definition of the parallel subfunction.
void createCallSpawnThreads(Value *SubFn, Value *SubFnParam, Value *LB,
Value *UB, Value *Stride);
- void deployParallelExecution(Value *SubFn, Value *SubFnParam, Value *LB,
+ void deployParallelExecution(Function *SubFn, Value *SubFnParam, Value *LB,
Value *UB, Value *Stride) override;
virtual Function *prepareSubFnDefinition(Function *F) const override;
void createCallSpawnThreads(Value *SubFn, Value *SubFnParam, Value *LB,
Value *UB, Value *Stride);
- void deployParallelExecution(Value *SubFn, Value *SubFnParam, Value *LB,
+ void deployParallelExecution(Function *SubFn, Value *SubFnParam, Value *LB,
Value *UB, Value *Stride) override;
virtual Function *prepareSubFnDefinition(Function *F) const override;
Builder.CreateCall(F, Args);
}
-void ParallelLoopGeneratorGOMP::deployParallelExecution(Value *SubFn,
+void ParallelLoopGeneratorGOMP::deployParallelExecution(Function *SubFn,
Value *SubFnParam,
Value *LB, Value *UB,
Value *Stride) {
Builder.CreateCall(F, Args);
}
-void ParallelLoopGeneratorKMP::deployParallelExecution(Value *SubFn,
+void ParallelLoopGeneratorKMP::deployParallelExecution(Function *SubFn,
Value *SubFnParam,
Value *LB, Value *UB,
Value *Stride) {
std::string InstName = Alloca->getName().str();
auto NewAlloca =
- new AllocaInst(Alloca->getType()->getElementType(), 0,
+ new AllocaInst(Alloca->getAllocatedType(), 0,
"polly_byref_alloca_" + InstName, &*Entry->begin());
- auto *LoadedVal =
- new LoadInst(Alloca, "polly_byref_load_" + InstName, &Inst);
+ auto *LoadedVal = new LoadInst(Alloca->getAllocatedType(), Alloca,
+ "polly_byref_load_" + InstName, &Inst);
new StoreInst(LoadedVal, NewAlloca, &Inst);
auto *NewBitCast = new BitCastInst(NewAlloca, BitCast->getType(),