Lines Matching defs:IRB

62                                  BuilderTy &IRB, ScalarEvolution &SE) {
79 Value *NeededSizeVal = IRB.CreateTypeSize(IndexTy, NeededSize);
92 Value *ObjSize = IRB.CreateSub(Size, Offset);
95 : IRB.CreateICmpULT(Size, Offset);
100 : IRB.CreateICmpULT(ObjSize, NeededSizeVal);
101 Value *Or = IRB.CreateOr(Cmp2, Cmp3);
104 Value *Cmp1 = IRB.CreateICmpSLT(Offset, ConstantInt::get(IndexTy, 0));
105 Or = IRB.CreateOr(Cmp1, Or);
111 static CallInst *InsertTrap(BuilderTy &IRB, bool DebugTrapBB,
114 return IRB.CreateIntrinsic(Intrinsic::trap, {}, {});
116 return IRB.CreateIntrinsic(
118 ConstantInt::get(IRB.getInt8Ty(),
121 : IRB.GetInsertBlock()->getParent()->size()));
124 static CallInst *InsertCall(BuilderTy &IRB, bool MayReturn, StringRef Name) {
125 Function *Fn = IRB.GetInsertBlock()->getParent();
135 return IRB.CreateCall(Callee);
144 static void insertBoundsCheck(Value *Or, BuilderTy &IRB, GetTrapBBT GetTrapBB) {
155 BasicBlock::iterator SplitI = IRB.GetInsertPoint();
160 BasicBlock *TrapBB = GetTrapBB(IRB, Cont);
201 BuilderTy IRB(I.getParent(), BasicBlock::iterator(&I), TargetFolder(DL));
205 ObjSizeEval, IRB, SE);
209 DL, TLI, ObjSizeEval, IRB, SE);
214 DL, TLI, ObjSizeEval, IRB, SE);
218 DL, TLI, ObjSizeEval, IRB, SE);
222 llvm::Value *Allow = IRB.CreateIntrinsic(
223 IRB.getInt1Ty(), Intrinsic::allow_ubsan_check,
224 {llvm::ConstantInt::getSigned(IRB.getInt8Ty(), *Opts.GuardKind)});
225 Or = IRB.CreateAnd(Or, Allow);
239 auto GetTrapBB = [&ReuseTrapBB, &Opts, &Name](BuilderTy &IRB,
241 Function *Fn = IRB.GetInsertBlock()->getParent();
242 auto DebugLoc = IRB.getCurrentDebugLocation();
243 IRBuilder<>::InsertPointGuard Guard(IRB);
252 IRB.SetInsertPoint(TrapBB);
255 CallInst *TrapCall = Opts.Rt ? InsertCall(IRB, Opts.Rt->MayReturn, Name)
256 : InsertTrap(IRB, DebugTrapBB, Opts.GuardKind);
265 IRB.CreateBr(Cont);
268 IRB.CreateUnreachable();
279 BuilderTy IRB(Inst->getParent(), BasicBlock::iterator(Inst), TargetFolder(DL));
280 insertBoundsCheck(Entry.second, IRB, GetTrapBB);