Lines Matching defs:IRB

202   IRBuilder<> IRB(Ctx);
207 IRB.getVoidTy(), IRB.getPtrTy());
209 M.getOrInsertFunction("__tsan_func_exit", Attr, IRB.getVoidTy());
211 IRB.getVoidTy());
213 M.getOrInsertFunction("__tsan_ignore_thread_end", Attr, IRB.getVoidTy());
214 IntegerType *OrdTy = IRB.getInt32Ty();
221 TsanRead[i] = M.getOrInsertFunction(ReadName, Attr, IRB.getVoidTy(),
222 IRB.getPtrTy());
225 TsanWrite[i] = M.getOrInsertFunction(WriteName, Attr, IRB.getVoidTy(),
226 IRB.getPtrTy());
230 UnalignedReadName, Attr, IRB.getVoidTy(), IRB.getPtrTy());
234 UnalignedWriteName, Attr, IRB.getVoidTy(), IRB.getPtrTy());
238 VolatileReadName, Attr, IRB.getVoidTy(), IRB.getPtrTy());
242 VolatileWriteName, Attr, IRB.getVoidTy(), IRB.getPtrTy());
247 UnalignedVolatileReadName, Attr, IRB.getVoidTy(), IRB.getPtrTy());
252 UnalignedVolatileWriteName, Attr, IRB.getVoidTy(), IRB.getPtrTy());
256 CompoundRWName, Attr, IRB.getVoidTy(), IRB.getPtrTy());
261 UnalignedCompoundRWName, Attr, IRB.getVoidTy(), IRB.getPtrTy());
280 IRB.getVoidTy(), PtrTy, Ty, OrdTy);
319 M.getOrInsertFunction("__tsan_vptr_update", Attr, IRB.getVoidTy(),
320 IRB.getPtrTy(), IRB.getPtrTy());
322 IRB.getVoidTy(), IRB.getPtrTy());
326 IRB.getVoidTy(), OrdTy);
331 IRB.getVoidTy(), OrdTy);
334 M.getOrInsertFunction("__tsan_memmove", Attr, IRB.getPtrTy(),
335 IRB.getPtrTy(), IRB.getPtrTy(), IntptrTy);
337 M.getOrInsertFunction("__tsan_memcpy", Attr, IRB.getPtrTy(),
338 IRB.getPtrTy(), IRB.getPtrTy(), IntptrTy);
342 IRB.getPtrTy(), IRB.getPtrTy(), IRB.getInt32Ty(), IntptrTy);
480 InstrumentationIRBuilder IRB(F.getEntryBlock().getFirstNonPHI());
481 IRB.CreateCall(TsanIgnoreBegin);
570 InstrumentationIRBuilder IRB(F.getEntryBlock().getFirstNonPHI());
571 Value *ReturnAddress = IRB.CreateCall(
573 IRB.getInt32(0));
574 IRB.CreateCall(TsanFuncEntry, ReturnAddress);
588 InstrumentationIRBuilder IRB(II.Inst);
610 StoredValue = IRB.CreateExtractElement(
611 StoredValue, ConstantInt::get(IRB.getInt32Ty(), 0));
613 StoredValue = IRB.CreateIntToPtr(StoredValue, IRB.getPtrTy());
615 IRB.CreateCall(TsanVptrUpdate, {Addr, StoredValue});
620 IRB.CreateCall(TsanVptrLoad, Addr);
652 IRB.CreateCall(OnAccessFunc, Addr);
660 static ConstantInt *createOrdering(IRBuilder<> *IRB, AtomicOrdering ord) {
674 return IRB->getInt32(v);
686 InstrumentationIRBuilder IRB(I);
688 Value *Cast1 = IRB.CreateIntCast(M->getArgOperand(1), IRB.getInt32Ty(), false);
689 Value *Cast2 = IRB.CreateIntCast(M->getArgOperand(2), IntptrTy, false);
690 IRB.CreateCall(
697 IRB.CreateCall(
701 IRB.CreateIntCast(M->getArgOperand(2), IntptrTy, false)});
716 InstrumentationIRBuilder IRB(I);
724 createOrdering(&IRB, LI->getOrdering())};
725 Value *C = IRB.CreateCall(TsanAtomicLoad[Idx], Args);
726 Value *Cast = IRB.CreateBitOrPointerCast(C, OrigTy);
736 Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize);
738 IRB.CreateBitOrPointerCast(SI->getValueOperand(), Ty),
739 createOrdering(&IRB, SI->getOrdering())};
740 IRB.CreateCall(TsanAtomicStore[Idx], Args);
753 Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize);
755 Value *Args[] = {Addr, IRB.CreateBitOrPointerCast(Val, Ty),
756 createOrdering(&IRB, RMWI->getOrdering())};
757 Value *C = IRB.CreateCall(F, Args);
758 I->replaceAllUsesWith(IRB.CreateBitOrPointerCast(C, Val->getType()));
768 Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize);
770 IRB.CreateBitOrPointerCast(CASI->getCompareOperand(), Ty);
772 IRB.CreateBitOrPointerCast(CASI->getNewValOperand(), Ty);
776 createOrdering(&IRB, CASI->getSuccessOrdering()),
777 createOrdering(&IRB, CASI->getFailureOrdering())};
778 CallInst *C = IRB.CreateCall(TsanAtomicCAS[Idx], Args);
779 Value *Success = IRB.CreateICmpEQ(C, CmpOperand);
783 OldVal = IRB.CreateIntToPtr(C, OrigOldValTy);
787 IRB.CreateInsertValue(PoisonValue::get(CASI->getType()), OldVal, 0);
788 Res = IRB.CreateInsertValue(Res, Success, 1);
793 Value *Args[] = {createOrdering(&IRB, FI->getOrdering())};
797 IRB.CreateCall(F, Args);