Lines Matching refs:IRB
133 IRBuilder<> IRB(M.getContext()); in initializeCallbacks() local
136 "__tsan_func_entry", IRB.getVoidTy(), IRB.getInt8PtrTy(), nullptr)); in initializeCallbacks()
138 M.getOrInsertFunction("__tsan_func_exit", IRB.getVoidTy(), nullptr)); in initializeCallbacks()
139 OrdTy = IRB.getInt32Ty(); in initializeCallbacks()
145 ReadName, IRB.getVoidTy(), IRB.getInt8PtrTy(), nullptr)); in initializeCallbacks()
149 WriteName, IRB.getVoidTy(), IRB.getInt8PtrTy(), nullptr)); in initializeCallbacks()
155 UnalignedReadName, IRB.getVoidTy(), IRB.getInt8PtrTy(), nullptr)); in initializeCallbacks()
161 UnalignedWriteName, IRB.getVoidTy(), IRB.getInt8PtrTy(), nullptr)); in initializeCallbacks()
173 AtomicStoreName, IRB.getVoidTy(), PtrTy, Ty, OrdTy, nullptr)); in initializeCallbacks()
206 M.getOrInsertFunction("__tsan_vptr_update", IRB.getVoidTy(), in initializeCallbacks()
207 IRB.getInt8PtrTy(), IRB.getInt8PtrTy(), nullptr)); in initializeCallbacks()
209 "__tsan_vptr_read", IRB.getVoidTy(), IRB.getInt8PtrTy(), nullptr)); in initializeCallbacks()
211 "__tsan_atomic_thread_fence", IRB.getVoidTy(), OrdTy, nullptr)); in initializeCallbacks()
213 "__tsan_atomic_signal_fence", IRB.getVoidTy(), OrdTy, nullptr)); in initializeCallbacks()
216 M.getOrInsertFunction("memmove", IRB.getInt8PtrTy(), IRB.getInt8PtrTy(), in initializeCallbacks()
217 IRB.getInt8PtrTy(), IntptrTy, nullptr)); in initializeCallbacks()
219 M.getOrInsertFunction("memcpy", IRB.getInt8PtrTy(), IRB.getInt8PtrTy(), in initializeCallbacks()
220 IRB.getInt8PtrTy(), IntptrTy, nullptr)); in initializeCallbacks()
222 M.getOrInsertFunction("memset", IRB.getInt8PtrTy(), IRB.getInt8PtrTy(), in initializeCallbacks()
223 IRB.getInt32Ty(), IntptrTy, nullptr)); in initializeCallbacks()
230 IRBuilder<> IRB(M.getContext()); in doInitialization() local
231 IntptrTy = IRB.getIntPtrTy(DL); in doInitialization()
233 IRB.getVoidTy(), nullptr); in doInitialization()
387 IRBuilder<> IRB(F.getEntryBlock().getFirstNonPHI()); in runOnFunction() local
388 Value *ReturnAddress = IRB.CreateCall( in runOnFunction()
390 IRB.getInt32(0)); in runOnFunction()
391 IRB.CreateCall(TsanFuncEntry, ReturnAddress); in runOnFunction()
403 IRBuilder<> IRB(I); in instrumentLoadOrStore() local
418 StoredValue = IRB.CreateExtractElement( in instrumentLoadOrStore()
419 StoredValue, ConstantInt::get(IRB.getInt32Ty(), 0)); in instrumentLoadOrStore()
421 StoredValue = IRB.CreateIntToPtr(StoredValue, IRB.getInt8PtrTy()); in instrumentLoadOrStore()
423 IRB.CreateCall2(TsanVptrUpdate, in instrumentLoadOrStore()
424 IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()), in instrumentLoadOrStore()
425 IRB.CreatePointerCast(StoredValue, IRB.getInt8PtrTy())); in instrumentLoadOrStore()
430 IRB.CreateCall(TsanVptrLoad, in instrumentLoadOrStore()
431 IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy())); in instrumentLoadOrStore()
445 IRB.CreateCall(OnAccessFunc, IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy())); in instrumentLoadOrStore()
451 static ConstantInt *createOrdering(IRBuilder<> *IRB, AtomicOrdering ord) { in createOrdering() argument
463 return IRB->getInt32(v); in createOrdering()
475 IRBuilder<> IRB(I); in instrumentMemIntrinsic() local
477 IRB.CreateCall3(MemsetFn, in instrumentMemIntrinsic()
478 IRB.CreatePointerCast(M->getArgOperand(0), IRB.getInt8PtrTy()), in instrumentMemIntrinsic()
479 IRB.CreateIntCast(M->getArgOperand(1), IRB.getInt32Ty(), false), in instrumentMemIntrinsic()
480 IRB.CreateIntCast(M->getArgOperand(2), IntptrTy, false)); in instrumentMemIntrinsic()
483 IRB.CreateCall3(isa<MemCpyInst>(M) ? MemcpyFn : MemmoveFn, in instrumentMemIntrinsic()
484 IRB.CreatePointerCast(M->getArgOperand(0), IRB.getInt8PtrTy()), in instrumentMemIntrinsic()
485 IRB.CreatePointerCast(M->getArgOperand(1), IRB.getInt8PtrTy()), in instrumentMemIntrinsic()
486 IRB.CreateIntCast(M->getArgOperand(2), IntptrTy, false)); in instrumentMemIntrinsic()
501 IRBuilder<> IRB(I); in instrumentAtomic() local
509 Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize); in instrumentAtomic()
511 Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAtomic()
512 createOrdering(&IRB, LI->getOrdering())}; in instrumentAtomic()
523 Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize); in instrumentAtomic()
525 Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAtomic()
526 IRB.CreateIntCast(SI->getValueOperand(), Ty, false), in instrumentAtomic()
527 createOrdering(&IRB, SI->getOrdering())}; in instrumentAtomic()
540 Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize); in instrumentAtomic()
542 Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAtomic()
543 IRB.CreateIntCast(RMWI->getValOperand(), Ty, false), in instrumentAtomic()
544 createOrdering(&IRB, RMWI->getOrdering())}; in instrumentAtomic()
554 Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize); in instrumentAtomic()
556 Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), in instrumentAtomic()
557 IRB.CreateIntCast(CASI->getCompareOperand(), Ty, false), in instrumentAtomic()
558 IRB.CreateIntCast(CASI->getNewValOperand(), Ty, false), in instrumentAtomic()
559 createOrdering(&IRB, CASI->getSuccessOrdering()), in instrumentAtomic()
560 createOrdering(&IRB, CASI->getFailureOrdering())}; in instrumentAtomic()
561 CallInst *C = IRB.CreateCall(TsanAtomicCAS[Idx], Args); in instrumentAtomic()
562 Value *Success = IRB.CreateICmpEQ(C, CASI->getCompareOperand()); in instrumentAtomic()
564 Value *Res = IRB.CreateInsertValue(UndefValue::get(CASI->getType()), C, 0); in instrumentAtomic()
565 Res = IRB.CreateInsertValue(Res, Success, 1); in instrumentAtomic()
570 Value *Args[] = {createOrdering(&IRB, FI->getOrdering())}; in instrumentAtomic()