Lines Matching refs:MS
417 MemorySanitizer &MS; member
435 MemorySanitizerVisitor(Function &F, MemorySanitizer &MS) in MemorySanitizerVisitor()
436 : F(F), MS(MS), VAHelper(CreateVarArgHelper(F, MS, *this)) { in MemorySanitizerVisitor()
438 !MS.BL->isIn(F) && in MemorySanitizerVisitor()
465 if (MS.TrackOrigins) { in materializeStores()
484 MS.OriginStoreWeights); in materializeStores()
506 MS.ColdCallWeights); in materializeChecks()
509 if (MS.TrackOrigins) { in materializeChecks()
512 MS.OriginTLS); in materializeChecks()
514 CallInst *Call = IRB.CreateCall(MS.WarningFn); in materializeChecks()
516 IRB.CreateCall(MS.EmptyAsm); in materializeChecks()
524 MS.initializeCallbacks(*F.getParent()); in runOnFunction()
525 if (!MS.TD) return false; in runOnFunction()
546 PHINode *PNO = MS.TrackOrigins ? cast<PHINode>(getOrigin(PN)) : 0; in runOnFunction()
582 uint32_t EltSize = MS.TD->getTypeSizeInBits(VT->getElementType()); in getShadowTy()
583 return VectorType::get(IntegerType::get(*MS.C, EltSize), in getShadowTy()
590 StructType *Res = StructType::get(*MS.C, Elements, ST->isPacked()); in getShadowTy()
594 uint32_t TypeSize = MS.TD->getTypeSizeInBits(OrigTy); in getShadowTy()
595 return IntegerType::get(*MS.C, TypeSize); in getShadowTy()
601 return IntegerType::get(*MS.C, vt->getBitWidth()); in getShadowTyNoVec()
620 IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy), in getShadowPtr()
621 ConstantInt::get(MS.IntptrTy, ~MS.ShadowMask)); in getShadowPtr()
631 IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy), in getOriginPtr()
632 ConstantInt::get(MS.IntptrTy, ~MS.ShadowMask)); in getOriginPtr()
635 ConstantInt::get(MS.IntptrTy, MS.OriginOffset)); in getOriginPtr()
637 IRB.CreateAnd(Add, ConstantInt::get(MS.IntptrTy, ~3ULL)); in getOriginPtr()
646 Value *Base = IRB.CreatePointerCast(MS.ParamTLS, MS.IntptrTy); in getShadowPtrForArgument()
647 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForArgument()
655 if (!MS.TrackOrigins) return 0; in getOriginPtrForArgument()
656 Value *Base = IRB.CreatePointerCast(MS.ParamOriginTLS, MS.IntptrTy); in getOriginPtrForArgument()
657 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getOriginPtrForArgument()
658 return IRB.CreateIntToPtr(Base, PointerType::get(MS.OriginTy, 0), in getOriginPtrForArgument()
664 Value *Base = IRB.CreatePointerCast(MS.RetvalTLS, MS.IntptrTy); in getShadowPtrForRetval()
672 return MS.RetvalOriginTLS; in getOriginPtrForRetval()
683 if (!MS.TrackOrigins) return; in setOrigin()
714 return Constant::getNullValue(MS.OriginTy); in getCleanOrigin()
753 ? MS.TD->getTypeAllocSize(AI->getType()->getPointerElementType()) in getShadow()
754 : MS.TD->getTypeAllocSize(AI->getType()); in getShadow()
771 if (MS.TrackOrigins) { in getShadow()
792 if (!MS.TrackOrigins) return 0; in getOrigin()
850 if (MS.TrackOrigins) { in visitLoadInst()
1027 if (MSV->MS.TrackOrigins) { in Add()
1044 Value *OpOrigin = MSV->MS.TrackOrigins ? MSV->getOrigin(V) : 0; in Add()
1056 if (MSV->MS.TrackOrigins) { in Done()
1068 if (!MS.TrackOrigins) return; in setOriginForNaryOp()
1095 Value *V1 = IRB.CreateBitCast(V, Type::getIntNTy(*MS.C, srcSizeInBits)); in CreateShadowCast()
1097 IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), false); in CreateShadowCast()
1331 MS.MemmoveFn, in visitMemMoveInst()
1334 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)); in visitMemMoveInst()
1345 MS.MemcpyFn, in visitMemCpyInst()
1348 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)); in visitMemCpyInst()
1356 MS.MemsetFn, in visitMemSetInst()
1359 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)); in visitMemSetInst()
1409 if (MS.TrackOrigins) in handleVectorStoreIntrinsic()
1436 if (MS.TrackOrigins) { in handleVectorLoadIntrinsic()
1603 Size = MS.TD->getTypeAllocSize(A->getType()->getPointerElementType()); in visitCallSite()
1606 getShadowPtr(A, Type::getInt8Ty(*MS.C), IRB), in visitCallSite()
1609 Size = MS.TD->getTypeAllocSize(A->getType()); in visitCallSite()
1613 if (MS.TrackOrigins) in visitCallSite()
1657 if (MS.TrackOrigins) in visitCallSite()
1669 if (MS.TrackOrigins) in visitReturnInst()
1679 if (MS.TrackOrigins) in visitPHINode()
1680 setOrigin(&I, IRB.CreatePHI(MS.OriginTy, I.getNumIncomingValues(), in visitPHINode()
1688 uint64_t Size = MS.TD->getTypeAllocSize(I.getAllocatedType()); in visitAllocaInst()
1690 IRB.CreateCall2(MS.MsanPoisonStackFn, in visitAllocaInst()
1692 ConstantInt::get(MS.IntptrTy, Size)); in visitAllocaInst()
1694 Value *ShadowBase = getShadowPtr(&I, Type::getInt8PtrTy(*MS.C), IRB); in visitAllocaInst()
1699 if (MS.TrackOrigins) { in visitAllocaInst()
1712 IRB.CreateCall3(MS.MsanSetAllocaOriginFn, in visitAllocaInst()
1714 ConstantInt::get(MS.IntptrTy, Size), in visitAllocaInst()
1724 if (MS.TrackOrigins) { in visitSelectInst()
1808 MemorySanitizer &MS; member
1815 VarArgAMD64Helper(Function &F, MemorySanitizer &MS, in VarArgAMD64Helper()
1817 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(0), VAArgOverflowSize(0) { } in VarArgAMD64Helper()
1864 uint64_t ArgSize = MS.TD->getTypeAllocSize(A->getType()); in visitCallSite()
1872 IRB.CreateStore(OverflowSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
1878 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
1879 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
1914 VAArgOverflowSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
1916 IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AMD64FpEndOffset), in finalizeInstrumentation()
1918 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
1919 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
1931 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
1932 ConstantInt::get(MS.IntptrTy, 16)), in finalizeInstrumentation()
1933 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
1942 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
1943 ConstantInt::get(MS.IntptrTy, 8)), in finalizeInstrumentation()
1944 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()