• Home
  • Raw
  • Download

Lines Matching refs:Builder

354     llvm::IRBuilder<> Builder(Begin);  in createEmptyExpandedForEachKernel()  local
355 Builder.CreateRetVoid(); in createEmptyExpandedForEachKernel()
402 llvm::IRBuilder<> Builder(Begin); in createEmptyExpandedReduceAccumulator() local
403 Builder.CreateRetVoid(); in createEmptyExpandedReduceAccumulator()
425 llvm::BasicBlock *createLoop(llvm::IRBuilder<> &Builder, in createLoop() argument
434 CondBB = Builder.GetInsertBlock(); in createLoop()
435 AfterBB = llvm::SplitBlock(CondBB, &*Builder.GetInsertPoint(), nullptr, nullptr); in createLoop()
439 Builder.SetInsertPoint(CondBB); in createLoop()
443 IVVar = Builder.CreateAlloca(LowerBound->getType(), nullptr, BCC_INDEX_VAR_NAME); in createLoop()
444 Builder.CreateStore(LowerBound, IVVar); in createLoop()
450 Cond = Builder.CreateICmpULT(LowerBound, UpperBound); in createLoop()
451 Builder.CreateCondBr(Cond, HeaderBB, AfterBB); in createLoop()
463 Builder.SetInsertPoint(HeaderBB); in createLoop()
464 IV = Builder.CreateLoad(IVVar, "X"); in createLoop()
465 IVNext = Builder.CreateNUWAdd(IV, Builder.getInt32(1)); in createLoop()
466 Builder.CreateStore(IVNext, IVVar); in createLoop()
467 Cond = Builder.CreateICmpULT(IVNext, UpperBound); in createLoop()
468 Builder.CreateCondBr(Cond, HeaderBB, AfterBB); in createLoop()
470 Builder.SetInsertPoint(llvm::cast<llvm::Instruction>(IVNext)); in createLoop()
570 llvm::IRBuilder<> &Builder, in ExpandSpecialArguments() argument
595 auto OldInsertionPoint = Builder.saveIP(); in ExpandSpecialArguments()
596 Builder.SetInsertPoint(LoopHeaderInsertionPoint); in ExpandSpecialArguments()
601 llvm::Value *YAddr = Builder.CreateInBoundsGEP(Arg_p, YValueGEP, "Y.gep"); in ExpandSpecialArguments()
602 CalleeArgs.push_back(Builder.CreateLoad(YAddr, "Y")); in ExpandSpecialArguments()
609 llvm::Value *ZAddr = Builder.CreateInBoundsGEP(Arg_p, ZValueGEP, "Z.gep"); in ExpandSpecialArguments()
610 CalleeArgs.push_back(Builder.CreateLoad(ZAddr, "Z")); in ExpandSpecialArguments()
614 Builder.restoreIP(OldInsertionPoint); in ExpandSpecialArguments()
638 void ExpandInputsLoopInvariant(llvm::IRBuilder<> &Builder, llvm::BasicBlock *LoopHeader, in ExpandInputsLoopInvariant() argument
650 auto OldInsertionPoint = Builder.saveIP(); in ExpandInputsLoopInvariant()
651 Builder.SetInsertPoint(LoopHeader->getTerminator()); in ExpandInputsLoopInvariant()
668 InStructTempSlots.push_back(Builder.CreateAlloca(ElementType, nullptr, in ExpandInputsLoopInvariant()
677 llvm::Value *InBufPtrAddr = Builder.CreateInBoundsGEP(Arg_p, InBufPtrGEP, "input_buf.gep"); in ExpandInputsLoopInvariant()
678 llvm::LoadInst *InBufPtr = Builder.CreateLoad(InBufPtrAddr, "input_buf"); in ExpandInputsLoopInvariant()
682 CastInBufPtr = Builder.CreatePointerCast(InBufPtr, InType, "casted_in"); in ExpandInputsLoopInvariant()
701 Builder.restoreIP(OldInsertionPoint); in ExpandInputsLoopInvariant()
720 void ExpandInputsBody(llvm::IRBuilder<> &Builder, in ExpandInputsBody() argument
729 llvm::Value *Offset = Builder.CreateSub(IndVar, Arg_x1); in ExpandInputsBody()
736 InPtr = Builder.CreateInBoundsGEP(InBufPtrs[Index], Offset); in ExpandInputsBody()
744 … llvm::Value *OffsetInBytes = Builder.CreateMul(Offset, llvm::ConstantInt::get(Int32Ty, InStep)); in ExpandInputsBody()
745 InPtr = Builder.CreateInBoundsGEP(InBufPtrs[Index], OffsetInBytes); in ExpandInputsBody()
746 InPtr = Builder.CreatePointerCast(InPtr, InTy); in ExpandInputsBody()
750 llvm::LoadInst *InputLoad = Builder.CreateLoad(InPtr, "input"); in ExpandInputsBody()
763 Builder.CreateStore(InputLoad, TemporarySlot); in ExpandInputsBody()
817 llvm::IRBuilder<> Builder(&*ExpandedFunction->getEntryBlock().begin()); in ExpandOldStyleForEach() local
827 llvm::LoadInst *InStepArg = Builder.CreateLoad( in ExpandOldStyleForEach()
828 Builder.CreateInBoundsGEP(Arg_p, InStepGEP, "instep_addr.gep"), "instep_addr"); in ExpandOldStyleForEach()
836 InBufPtr = Builder.CreateLoad( in ExpandOldStyleForEach()
837 Builder.CreateInBoundsGEP(Arg_p, InputAddrGEP, "input_buf.gep"), "input_buf"); in ExpandOldStyleForEach()
847 OutBasePtr = Builder.CreateLoad(Builder.CreateInBoundsGEP(Arg_p, OutBaseGEP, "out_buf.gep")); in ExpandOldStyleForEach()
853 …llvm::Value *UsrDataPointerAddr = Builder.CreateStructGEP(nullptr, Arg_p, RsExpandKernelDriverInfo… in ExpandOldStyleForEach()
854 UsrData = Builder.CreatePointerCast(Builder.CreateLoad(UsrDataPointerAddr), UsrDataTy); in ExpandOldStyleForEach()
858 llvm::BasicBlock *LoopHeader = Builder.GetInsertBlock(); in ExpandOldStyleForEach()
860 createLoop(Builder, Arg_x1, Arg_x2, &IV); in ExpandOldStyleForEach()
863 … const int CalleeArgsContextIdx = ExpandSpecialArguments(Signature, IV, Arg_p, Builder, CalleeArgs, in ExpandOldStyleForEach()
884 llvm::Value *OutOffset = Builder.CreateSub(IV, Arg_x1); in ExpandOldStyleForEach()
885 OutOffset = Builder.CreateMul(OutOffset, OutStep); in ExpandOldStyleForEach()
886 OutPtr = Builder.CreateInBoundsGEP(OutBasePtr, OutOffset); in ExpandOldStyleForEach()
887 OutPtr = Builder.CreatePointerCast(OutPtr, OutTy); in ExpandOldStyleForEach()
891 llvm::Value *InOffset = Builder.CreateSub(IV, Arg_x1); in ExpandOldStyleForEach()
892 InOffset = Builder.CreateMul(InOffset, InStep); in ExpandOldStyleForEach()
893 InPtr = Builder.CreateInBoundsGEP(InBufPtr, InOffset); in ExpandOldStyleForEach()
894 InPtr = Builder.CreatePointerCast(InPtr, InTy); in ExpandOldStyleForEach()
909 finishArgList(RootArgs, CalleeArgs, CalleeArgsContextIdx, *Function, Builder); in ExpandOldStyleForEach()
911 Builder.CreateCall(Function, RootArgs); in ExpandOldStyleForEach()
948 llvm::IRBuilder<> Builder(&*ExpandedFunction->getEntryBlock().begin()); in ExpandForEach() local
1002 OutBasePtr = Builder.CreateLoad(Builder.CreateInBoundsGEP(Arg_p, OutBaseGEP, "out_buf.gep")); in ExpandForEach()
1009 CastedOutBasePtr = Builder.CreatePointerCast(OutBasePtr, OutTy, "casted_out"); in ExpandForEach()
1028 llvm::BasicBlock *LoopHeader = Builder.GetInsertBlock(); in ExpandForEach()
1030 createLoop(Builder, Arg_x1, Arg_x2, &IV); in ExpandForEach()
1034 ExpandSpecialArguments(Signature, IV, Arg_p, Builder, CalleeArgs, in ExpandForEach()
1045 ExpandInputsLoopInvariant(Builder, LoopHeader, Arg_p, TBAAPointer, ArgIter, NumInPtrArguments, in ExpandForEach()
1058 llvm::Value *OutOffset = Builder.CreateSub(IV, Arg_x1); in ExpandForEach()
1061 OutPtr = Builder.CreateInBoundsGEP(CastedOutBasePtr, OutOffset); in ExpandForEach()
1067 …llvm::Value *OutOffsetInBytes = Builder.CreateMul(OutOffset, llvm::ConstantInt::get(Int32Ty, OutSt… in ExpandForEach()
1068 OutPtr = Builder.CreateInBoundsGEP(CastedOutBasePtr, OutOffsetInBytes); in ExpandForEach()
1069 OutPtr = Builder.CreatePointerCast(OutPtr, OutTy); in ExpandForEach()
1080 ExpandInputsBody(Builder, Arg_x1, TBAAAllocation, NumInPtrArguments, in ExpandForEach()
1084 finishArgList(RootArgs, CalleeArgs, CalleeArgsContextIdx, *Function, Builder); in ExpandForEach()
1086 llvm::Value *RetVal = Builder.CreateCall(Function, RootArgs); in ExpandForEach()
1090 llvm::StoreInst *Store = Builder.CreateStore(RetVal, OutPtr); in ExpandForEach()
1183 llvm::IRBuilder<> Builder(&*FnExpandedAccumulator->getEntryBlock().begin()); in ExpandReduceAccumulator() local
1186 llvm::BasicBlock *LoopHeader = Builder.GetInsertBlock(); in ExpandReduceAccumulator()
1188 createLoop(Builder, Arg_x1, Arg_x2, &IndVar); in ExpandReduceAccumulator()
1192 ExpandSpecialArguments(Signature, IndVar, Arg_p, Builder, CalleeArgs, in ExpandReduceAccumulator()
1198 … ExpandInputsLoopInvariant(Builder, LoopHeader, Arg_p, TBAAPointer, AccumulatorArgIter, NumInputs, in ExpandReduceAccumulator()
1204 …ExpandInputsBody(Builder, Arg_x1, TBAAAllocation, NumInputs, InTypes, InBufPtrs, InStructTempSlots, in ExpandReduceAccumulator()
1206 finishArgList(RootArgs, CalleeArgs, CalleeArgsContextIdx, *FnAccumulator, Builder); in ExpandReduceAccumulator()
1207 Builder.CreateCall(FnAccumulator, RootArgs); in ExpandReduceAccumulator()
1259 llvm::IRBuilder<> Builder(BB); in CreateReduceCombinerFromAccumulator() local
1267 llvm::Value *TempMem = Builder.CreateAlloca(ElementType, nullptr, "caller_copy"); in CreateReduceCombinerFromAccumulator()
1268 Builder.CreateStore(Builder.CreateLoad(CombinerArg_other), TempMem); in CreateReduceCombinerFromAccumulator()
1269 Builder.CreateCall(FnAccumulator, { CombinerArg_accum, TempMem }); in CreateReduceCombinerFromAccumulator()
1274 TypeAdjustedOther = Builder.CreatePointerCast(CombinerArg_other, in CreateReduceCombinerFromAccumulator()
1278 llvm::Value *DerefOther = Builder.CreateLoad(TypeAdjustedOther); in CreateReduceCombinerFromAccumulator()
1279 Builder.CreateCall(FnAccumulator, { CombinerArg_accum, DerefOther }); in CreateReduceCombinerFromAccumulator()
1281 Builder.CreateRetVoid(); in CreateReduceCombinerFromAccumulator()