Home
last modified time | relevance | path

Searched refs:IRB (Results 1 – 25 of 66) sorted by relevance

123

/freebsd/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/
H A DMemorySanitizer.cpp779 IRBuilder<> IRB(*C); in createKernelApi() local
792 IRB.getVoidTy(), IRB.getInt32Ty()); in createKernelApi()
797 ArrayType::get(IRB.getInt64Ty(), kParamTLSSize / 8), in createKernelApi()
798 ArrayType::get(IRB.getInt64Ty(), kRetvalTLSSize / 8), in createKernelApi()
799 ArrayType::get(IRB.getInt64Ty(), kParamTLSSize / 8), in createKernelApi()
800 ArrayType::get(IRB.getInt64Ty(), kParamTLSSize / 8), /* va_arg_origin */ in createKernelApi()
801 IRB.getInt64Ty(), ArrayType::get(OriginTy, kParamTLSSize / 4), OriginTy, in createKernelApi()
806 MsanMetadata = StructType::get(PointerType::get(IRB.getInt8Ty(), 0), in createKernelApi()
807 PointerType::get(IRB.getInt32Ty(), 0)); in createKernelApi()
815 M, name_load, PointerType::get(IRB.getInt8Ty(), 0)); in createKernelApi()
[all …]
H A DThreadSanitizer.cpp202 IRBuilder<> IRB(Ctx); in initialize() local
207 IRB.getVoidTy(), IRB.getPtrTy()); in initialize()
209 M.getOrInsertFunction("__tsan_func_exit", Attr, IRB.getVoidTy()); in initialize()
211 IRB.getVoidTy()); in initialize()
213 M.getOrInsertFunction("__tsan_ignore_thread_end", Attr, IRB.getVoidTy()); in initialize()
214 IntegerType *OrdTy = IRB.getInt32Ty(); in initialize()
221 TsanRead[i] = M.getOrInsertFunction(ReadName, Attr, IRB.getVoidTy(), in initialize()
222 IRB.getPtrTy()); in initialize()
225 TsanWrite[i] = M.getOrInsertFunction(WriteName, Attr, IRB.getVoidTy(), in initialize()
226 IRB.getPtrTy()); in initialize()
[all …]
H A DHWAddressSanitizer.cpp321 Value *getOpaqueNoopCast(IRBuilder<> &IRB, Value *Val);
323 Value *getDynamicShadowIfunc(IRBuilder<> &IRB);
324 Value *getShadowNonTls(IRBuilder<> &IRB);
327 Value *memToShadow(Value *Shadow, IRBuilder<> &IRB);
353 void tagAlloca(IRBuilder<> &IRB, AllocaInst *AI, Value *Tag, size_t Size);
354 Value *tagPointer(IRBuilder<> &IRB, Type *Ty, Value *PtrLong, Value *Tag);
355 Value *untagPointer(IRBuilder<> &IRB, Value *PtrLong);
360 Value *getNextTagWithCall(IRBuilder<> &IRB);
361 Value *getStackBaseTag(IRBuilder<> &IRB);
362 Value *getAllocaTag(IRBuilder<> &IRB, Value *StackTag, unsigned AllocaNo);
[all …]
H A DBoundsChecking.cpp59 BuilderTy &IRB, ScalarEvolution &SE) { in getBoundsCheckCond() argument
76 Value *NeededSizeVal = IRB.CreateTypeSize(IndexTy, NeededSize); in getBoundsCheckCond()
89 Value *ObjSize = IRB.CreateSub(Size, Offset); in getBoundsCheckCond()
92 : IRB.CreateICmpULT(Size, Offset); in getBoundsCheckCond()
97 : IRB.CreateICmpULT(ObjSize, NeededSizeVal); in getBoundsCheckCond()
98 Value *Or = IRB.CreateOr(Cmp2, Cmp3); in getBoundsCheckCond()
101 Value *Cmp1 = IRB.CreateICmpSLT(Offset, ConstantInt::get(IndexTy, 0)); in getBoundsCheckCond()
102 Or = IRB.CreateOr(Cmp1, Or); in getBoundsCheckCond()
114 static void insertBoundsCheck(Value *Or, BuilderTy &IRB, GetTrapBBT GetTrapBB) { in insertBoundsCheck() argument
125 BasicBlock::iterator SplitI = IRB.GetInsertPoint(); in insertBoundsCheck()
[all …]
H A DAddressSanitizer.cpp702 CallInst *createRuntimeCall(IRBuilder<> &IRB, FunctionCallee Callee, in createRuntimeCall() argument
705 assert(IRB.GetInsertBlock()->getParent() == OwnerFn);
707 CallInst *Inst = IRB.CreateCall(Callee, Args, Name, nullptr);
774 Instruction *genAMDGPUReportBlock(IRBuilder<> &IRB, Value *Cond,
789 Value *createSlowPathCmp(IRBuilder<> &IRB, Value *AddrLong,
796 Value *memToShadow(Value *Shadow, IRBuilder<> &IRB);
914 void instrumentGlobals(IRBuilder<> &IRB, Module &M, bool *CtorComdat);
915 void InstrumentGlobalsCOFF(IRBuilder<> &IRB, Module &M,
918 void instrumentGlobalsELF(IRBuilder<> &IRB, Module &M,
922 void InstrumentGlobalsMachO(IRBuilder<> &IRB, Module &M,
[all …]
H A DDataFlowSanitizer.cpp518 Value *getShadowOffset(Value *Addr, IRBuilder<> &IRB);
531 void buildExternWeakCheckIfNeeded(IRBuilder<> &IRB, Function *F);
628 Value *getArgTLS(Type *T, unsigned ArgOffset, IRBuilder<> &IRB);
631 Value *getRetvalTLS(Type *T, IRBuilder<> &IRB);
636 Value *getArgOriginTLS(unsigned ArgNo, IRBuilder<> &IRB);
708 void addReachesFunctionCallbacksIfEnabled(IRBuilder<> &IRB, Instruction &I,
718 IRBuilder<> &IRB);
720 Value *collapseToPrimitiveShadow(Value *Shadow, IRBuilder<> &IRB);
745 Value *updateOrigin(Value *V, IRBuilder<> &IRB);
749 Value *updateOriginIfTainted(Value *Shadow, Value *Origin, IRBuilder<> &IRB);
[all …]
H A DSanitizerCoverage.cpp331 IRBuilder<> IRB(M.getContext()); in CreateSecStartEnd() local
338 IRB.CreatePtrAdd(SecStart, ConstantInt::get(IntptrTy, sizeof(uint64_t))); in CreateSecStartEnd()
395 IRBuilder<> IRB(*C); in instrumentModule() local
396 Int64Ty = IRB.getInt64Ty(); in instrumentModule()
397 Int32Ty = IRB.getInt32Ty(); in instrumentModule()
398 Int16Ty = IRB.getInt16Ty(); in instrumentModule()
399 Int8Ty = IRB.getInt8Ty(); in instrumentModule()
400 Int1Ty = IRB.getInt1Ty(); in instrumentModule()
414 IRB.getInt8Ty(), IRB.getInt8Ty()); in instrumentModule()
417 IRB.getInt16Ty(), IRB.getInt16Ty()); in instrumentModule()
[all …]
H A DMemProfiler.cpp240 Value *memToShadow(Value *Shadow, IRBuilder<> &IRB);
301 Value *MemProfiler::memToShadow(Value *Shadow, IRBuilder<> &IRB) { in memToShadow() argument
303 Shadow = IRB.CreateAnd(Shadow, Mapping.Mask); in memToShadow()
304 Shadow = IRB.CreateLShr(Shadow, Mapping.Scale); in memToShadow()
307 return IRB.CreateAdd(Shadow, DynamicShadowOffset); in memToShadow()
312 IRBuilder<> IRB(MI); in instrumentMemIntrinsic() local
314 IRB.CreateCall(isa<MemMoveInst>(MI) ? MemProfMemmove : MemProfMemcpy, in instrumentMemIntrinsic()
316 IRB.CreateIntCast(MI->getOperand(2), IntptrTy, false)}); in instrumentMemIntrinsic()
318 IRB.CreateCall( in instrumentMemIntrinsic()
321 IRB.CreateIntCast(MI->getOperand(1), IRB.getInt32Ty(), false), in instrumentMemIntrinsic()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/
H A DWebAssemblyLowerEmscriptenEHSjLj.cpp464 IRBuilder<> IRB(M->getContext()); in getAddrIntType() local
465 return IRB.getIntNTy(M->getDataLayout().getPointerSizeInBits()); in getAddrIntType()
479 IRBuilder<> IRB(M->getContext()); in getAddrSizeInt() local
480 return IRB.getIntN(M->getDataLayout().getPointerSizeInBits(), C); in getAddrSizeInt()
513 IRBuilder<> IRB(C); in wrapInvoke() local
514 IRB.SetInsertPoint(CI); in wrapInvoke()
518 IRB.CreateStore(getAddrSizeInt(M, 0), ThrewGV); in wrapInvoke()
526 CallInst *NewCall = IRB.CreateCall(getInvokeWrapper(CI), Args); in wrapInvoke()
566 IRB.CreateLoad(getAddrIntType(M), ThrewGV, ThrewGV->getName() + ".val"); in wrapInvoke()
567 IRB.CreateStore(getAddrSizeInt(M, 0), ThrewGV); in wrapInvoke()
[all …]
H A DWebAssemblyRefTypeMem2Local.cpp62 IRBuilder<> IRB(AI.getContext()); in visitAllocaInst() local
63 IRB.SetInsertPoint(&AI); in visitAllocaInst()
64 auto *NewAI = IRB.CreateAlloca(AI.getAllocatedType(), in visitAllocaInst()
/freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/
H A DAArch64StackTagging.cpp153 IRBuilder<> IRB(SI); in addStore() local
154 applyStore(IRB, Offset, Offset + StoreSize, SI->getOperand(0)); in addStore()
162 IRBuilder<> IRB(MSI); in addMemSet() local
163 applyMemSet(IRB, Offset, Offset + StoreSize, in addMemSet()
168 void applyMemSet(IRBuilder<> &IRB, int64_t Start, int64_t End, in applyMemSet() argument
184 ConstantInt::get(IRB.getInt64Ty(), Cst * V->getZExtValue()); in applyMemSet()
190 CurrentV = IRB.CreateOr(CurrentV, C); in applyMemSet()
197 Value *sliceValue(IRBuilder<> &IRB, Value *V, int64_t Offset) { in sliceValue() argument
199 V = IRB.CreateLShr(V, Offset * 8); in sliceValue()
200 V = IRB.CreateZExtOrTrunc(V, IRB.getInt64Ty()); in sliceValue()
[all …]
H A DAArch64Arm64ECCallLowering.cpp423 IRBuilder<> IRB(BB); in buildExitThunk() local
426 Value *Callee = IRB.CreateLoad(PtrTy, CalleePtr); in buildExitThunk()
440 Args.push_back(IRB.CreateAlloca(RetTy)); in buildExitThunk()
464 Value *Mem = IRB.CreateAlloca(Arg.getType()); in buildExitThunk()
465 IRB.CreateStore(&Arg, Mem); in buildExitThunk()
467 Type *IntTy = IRB.getIntNTy(DL.getTypeStoreSizeInBits(Arg.getType())); in buildExitThunk()
468 Args.push_back(IRB.CreateLoad(IntTy, IRB.CreateBitCast(Mem, PtrTy))); in buildExitThunk()
480 Callee = IRB.CreateBitCast(Callee, PtrTy); in buildExitThunk()
481 CallInst *Call = IRB.CreateCall(X64Ty, Callee, Args); in buildExitThunk()
489 RetVal = IRB.CreateLoad(RetTy, Args[1]); in buildExitThunk()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/
H A DWasmEHPrepare.cpp164 IRBuilder<> IRB(M.getContext()); in doInitialization() local
165 P.LPadContextTy = StructType::get(IRB.getInt32Ty(), // lpad_index in doInitialization()
166 IRB.getPtrTy(), // lsda in doInitialization()
167 IRB.getInt32Ty() // selector in doInitialization()
195 IRBuilder<> IRB(F.getContext()); in prepareThrows() local
213 IRB.SetInsertPoint(BB); in prepareThrows()
214 IRB.CreateUnreachable(); in prepareThrows()
223 IRBuilder<> IRB(F.getContext()); in prepareEHPads() local
257 LSDAField = IRB.CreateConstInBoundsGEP2_32(LPadContextTy, LPadContextGV, 0, 1, in prepareEHPads()
259 SelectorField = IRB.CreateConstInBoundsGEP2_32(LPadContextTy, LPadContextGV, in prepareEHPads()
[all …]
H A DSafeStack.cpp134 Value *getStackGuard(IRBuilder<> &IRB, Function &F);
137 void checkStackGuard(IRBuilder<> &IRB, Function &F, Instruction &RI,
158 Value *moveStaticAllocasToUnsafeStack(IRBuilder<> &IRB, Function &F,
170 createStackRestorePoints(IRBuilder<> &IRB, Function &F,
365 Value *SafeStack::getStackGuard(IRBuilder<> &IRB, Function &F) { in getStackGuard() argument
366 Value *StackGuardVar = TL.getIRStackGuard(IRB); in getStackGuard()
371 return IRB.CreateCall(Intrinsic::getDeclaration(M, Intrinsic::stackguard)); in getStackGuard()
374 return IRB.CreateLoad(StackPtrTy, StackGuardVar, "StackGuard"); in getStackGuard()
429 SafeStack::createStackRestorePoints(IRBuilder<> &IRB, Function &F, in createStackRestorePoints() argument
447 DynamicTop = IRB.CreateAlloca(StackPtrTy, /*ArraySize=*/nullptr, in createStackRestorePoints()
[all …]
H A DSanitizerBinaryMetadata.cpp77 IRBuilder<> IRB(F.getContext()); in runOnMachineFunction() local
85 {IRB.getInt(NewFeatures), IRB.getInt32(Size)}}})); in runOnMachineFunction()
/freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/
H A DAMDGPUCtorDtorLowering.cpp76 IRBuilder<> IRB(BasicBlock::Create(C, "entry", &F)); in createInitOrFiniCalls()
79 Type *PtrTy = IRB.getPtrTy(AMDGPUAS::GLOBAL_ADDRESS); in createInitOrFiniCalls()
106 auto *CallBackTy = FunctionType::get(IRB.getVoidTy(), {}); in createInitOrFiniCalls()
114 auto *EndPtr = IRB.CreatePtrToInt(End, Int64Ty); in createInitOrFiniKernel()
115 auto *BeginPtr = IRB.CreatePtrToInt(Begin, Int64Ty); in createInitOrFiniKernel()
116 auto *ByteSize = IRB.CreateSub(EndPtr, BeginPtr); in createInitOrFiniKernel()
117 auto *Size = IRB.CreateAShr(ByteSize, ConstantInt::get(Int64Ty, 3)); in createInitOrFiniKernel()
118 auto *Offset = IRB.CreateSub(Size, ConstantInt::get(Int64Ty, 1)); in createInitOrFiniKernel()
119 Start = IRB.CreateInBoundsGEP( in createInitOrFiniKernel()
120 ArrayType::get(IRB in createInitOrFiniKernel()
67 IRBuilder<> IRB(BasicBlock::Create(C, "entry", &F)); createInitOrFiniCalls() local
[all...]
H A DAMDGPULowerBufferFatPointers.cpp418 IRBuilder<> IRB; member in __anone5d2dd830311::StoreFatPtrsAsIntsVisitor
430 : TypeMap(TypeMap), IRB(Ctx) {} in StoreFatPtrsAsIntsVisitor()
449 Value *Cast = IRB.CreatePtrToInt(V, To, Name + ".int"); in fatPtrsToInts()
461 Value *Field = IRB.CreateExtractValue(V, I); in fatPtrsToInts()
464 Ret = IRB.CreateInsertValue(Ret, NewField, I); in fatPtrsToInts()
469 Value *Field = IRB.CreateExtractValue(V, Idx); in fatPtrsToInts()
472 Ret = IRB.CreateInsertValue(Ret, NewField, Idx); in fatPtrsToInts()
484 Value *Cast = IRB.CreateIntToPtr(V, To, Name + ".ptr"); in intsToFatPtrs()
495 Value *Field = IRB.CreateExtractValue(V, I); in intsToFatPtrs()
498 Ret = IRB.CreateInsertValue(Ret, NewField, I); in intsToFatPtrs()
[all …]
H A DSIAnnotateControlFlow.cpp209 IRBuilder<> IRB(Term); in openIf() local
210 Value *IfCall = IRB.CreateCall(If, {Term->getCondition()}); in openIf()
211 Value *Cond = IRB.CreateExtractValue(IfCall, {0}); in openIf()
212 Value *Mask = IRB.CreateExtractValue(IfCall, {1}); in openIf()
224 IRBuilder<> IRB(Term); in insertElse() local
225 Value *ElseCall = IRB.CreateCall(Else, {popSaved()}); in insertElse()
226 Value *Cond = IRB.CreateExtractValue(ElseCall, {0}); in insertElse()
227 Value *Mask = IRB.CreateExtractValue(ElseCall, {1}); in insertElse()
339 IRBuilder<> IRB(FirstInsertionPt->getParent(), FirstInsertionPt); in closeControlFlow() local
343 IRB.SetCurrentDebugLocation(DebugLoc()); in closeControlFlow()
[all …]
H A DAMDGPULateCodeGenPrepare.cpp484 IRBuilder<> IRB(&LI); in visitLoadInst() local
485 IRB.SetCurrentDebugLocation(LI.getDebugLoc()); in visitLoadInst()
490 auto *NewPtr = IRB.CreateConstGEP1_64( in visitLoadInst()
491 IRB.getInt8Ty(), in visitLoadInst()
492 IRB.CreateAddrSpaceCast(Base, LI.getPointerOperand()->getType()), in visitLoadInst()
495 LoadInst *NewLd = IRB.CreateAlignedLoad(IRB.getInt32Ty(), NewPtr, Align(4)); in visitLoadInst()
500 auto *NewVal = IRB.CreateBitCast( in visitLoadInst()
501 IRB.CreateTrunc(IRB.CreateLShr(NewLd, ShAmt), IntNTy), LI.getType()); in visitLoadInst()
/freebsd/contrib/llvm-project/llvm/lib/Target/NVPTX/
H A DNVPTXCtorDtorLowering.cpp132 IRBuilder<> IRB(BasicBlock::Create(C, "entry", &F)); in createInitOrFiniCalls() local
135 Type *PtrTy = IRB.getPtrTy(llvm::ADDRESS_SPACE_GLOBAL); in createInitOrFiniCalls()
166 auto *CallBackTy = FunctionType::get(IRB.getVoidTy(), {}); in createInitOrFiniCalls()
170 Value *BeginVal = IRB.CreateLoad(Begin->getType(), Begin, "begin"); in createInitOrFiniCalls()
171 Value *EndVal = IRB.CreateLoad(Begin->getType(), End, "stop"); in createInitOrFiniCalls()
173 auto *BeginInt = IRB.CreatePtrToInt(BeginVal, IntegerType::getInt64Ty(C)); in createInitOrFiniCalls()
174 auto *EndInt = IRB.CreatePtrToInt(EndVal, IntegerType::getInt64Ty(C)); in createInitOrFiniCalls()
175 auto *SubInst = IRB.CreateSub(EndInt, BeginInt); in createInitOrFiniCalls()
176 auto *Offset = IRB.CreateAShr( in createInitOrFiniCalls()
179 auto *ValuePtr = IRB.CreateGEP(PointerType::get(C, 0), BeginVal, in createInitOrFiniCalls()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DMemoryTaggingSupport.cpp249 Value *readRegister(IRBuilder<> &IRB, StringRef Name) { in readRegister() argument
250 Module *M = IRB.GetInsertBlock()->getParent()->getParent(); in readRegister()
252 M, Intrinsic::read_register, IRB.getIntPtrTy(M->getDataLayout())); in readRegister()
256 return IRB.CreateCall(ReadRegister, Args); in readRegister()
259 Value *getPC(const Triple &TargetTriple, IRBuilder<> &IRB) { in getPC() argument
260 Module *M = IRB.GetInsertBlock()->getParent()->getParent(); in getPC()
262 return memtag::readRegister(IRB, "pc"); in getPC()
263 return IRB.CreatePtrToInt(IRB.GetInsertBlock()->getParent(), in getPC()
264 IRB.getIntPtrTy(M->getDataLayout())); in getPC()
267 Value *getFP(IRBuilder<> &IRB) { in getFP() argument
[all …]
H A DModuleUtils.cpp31 IRBuilder<> IRB(M.getContext()); in appendToGlobalArray() local
32 FunctionType *FnTy = FunctionType::get(IRB.getVoidTy(), false); in appendToGlobalArray()
48 EltTy = StructType::get(IRB.getInt32Ty(), in appendToGlobalArray()
50 IRB.getPtrTy()); in appendToGlobalArray()
55 CSVals[0] = IRB.getInt32(Priority); in appendToGlobalArray()
57 CSVals[2] = Data ? ConstantExpr::getPointerCast(Data, IRB.getPtrTy()) in appendToGlobalArray()
58 : Constant::getNullValue(IRB.getPtrTy()); in appendToGlobalArray()
217 IRBuilder<> IRB(M.getContext()); in createSanitizerCtorAndInitFunctions() local
228 IRB.SetInsertPoint(EntryBB); in createSanitizerCtorAndInitFunctions()
230 IRB.CreateICmpNE(InitFn, ConstantPointerNull::get(InitFnPtr)); in createSanitizerCtorAndInitFunctions()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/SPIRV/
H A DSPIRVPrepareFunctions.cpp134 IRBuilder<> IRB(EntryBB); in lowerIntrinsicToFunction() local
135 auto *MemSet = IRB.CreateMemSet(Dest, Val, Len, MSI->getDestAlign(), in lowerIntrinsicToFunction()
137 IRB.CreateRetVoid(); in lowerIntrinsicToFunction()
144 IRBuilder<> IRB(EntryBB); in lowerIntrinsicToFunction() local
145 auto *BSwap = IRB.CreateIntrinsic(Intrinsic::bswap, Intrinsic->getType(), in lowerIntrinsicToFunction()
147 IRB.CreateRet(BSwap); in lowerIntrinsicToFunction()
276 IRBuilder<> IRB(II->getParent()); in lowerPtrAnnotation() local
277 IRB.SetInsertPoint(II); in lowerPtrAnnotation()
278 IRB.CreateIntrinsic( in lowerPtrAnnotation()
301 IRBuilder<> IRB(RotateBB); in lowerFunnelShifts() local
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/
H A DSROA.cpp1603 static void speculatePHINodeLoads(IRBuilderTy &IRB, PHINode &PN) { in speculatePHINodeLoads() argument
1608 IRB.SetInsertPoint(&PN); in speculatePHINodeLoads()
1609 PHINode *NewPN = IRB.CreatePHI(LoadTy, PN.getNumIncomingValues(), in speculatePHINodeLoads()
1640 IRB.SetInsertPoint(TI); in speculatePHINodeLoads()
1642 LoadInst *Load = IRB.CreateAlignedLoad( in speculatePHINodeLoads()
1747 IRBuilderTy &IRB) { in speculateSelectInstLoads() argument
1756 IRB.SetInsertPoint(&LI); in speculateSelectInstLoads()
1759 IRB.CreateAlignedLoad(LI.getType(), TV, LI.getAlign(), in speculateSelectInstLoads()
1762 IRB.CreateAlignedLoad(LI.getType(), FV, LI.getAlign(), in speculateSelectInstLoads()
1776 Value *V = IRB.CreateSelect(SI.getCondition(), TL, FL, in speculateSelectInstLoads()
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/Utils/
H A DMemoryTaggingSupport.h84 Value *readRegister(IRBuilder<> &IRB, StringRef Name);
85 Value *getFP(IRBuilder<> &IRB);
86 Value *getPC(const Triple &TargetTriple, IRBuilder<> &IRB);
87 Value *getAndroidSlotPtr(IRBuilder<> &IRB, int Slot);

123