Lines Matching refs:MS
581 MemorySanitizer &MS; member
604 MemorySanitizerVisitor(Function &F, MemorySanitizer &MS) in MemorySanitizerVisitor()
605 : F(F), MS(MS), VAHelper(CreateVarArgHelper(F, MS, *this)) { in MemorySanitizerVisitor()
621 if (MS.TrackOrigins <= 1) return V; in updateOrigin()
622 return IRB.CreateCall(MS.MsanChainOriginFn, V); in updateOrigin()
627 unsigned IntptrSize = DL.getTypeStoreSize(MS.IntptrTy); in originToIntptr()
630 Origin = IRB.CreateIntCast(Origin, MS.IntptrTy, /* isSigned */ false); in originToIntptr()
638 unsigned IntptrAlignment = DL.getABITypeAlignment(MS.IntptrTy); in paintOrigin()
639 unsigned IntptrSize = DL.getTypeStoreSize(MS.IntptrTy); in paintOrigin()
648 IRB.CreatePointerCast(OriginPtr, PointerType::get(MS.IntptrTy, 0)); in paintOrigin()
650 Value *Ptr = i ? IRB.CreateConstGEP1_32(MS.IntptrTy, IntptrOriginPtr, i) in paintOrigin()
690 Value *Fn = MS.MaybeStoreOriginFn[SizeIndex]; in storeOrigin()
700 Cmp, IRB.GetInsertPoint(), false, MS.OriginStoreWeights); in storeOrigin()
728 if (MS.TrackOrigins && !SI.isAtomic()) in materializeStores()
744 if (MS.TrackOrigins) { in materializeOneCheck()
746 MS.OriginTLS); in materializeOneCheck()
748 IRB.CreateCall(MS.WarningFn, {}); in materializeOneCheck()
749 IRB.CreateCall(MS.EmptyAsm, {}); in materializeOneCheck()
762 Value *Fn = MS.MaybeWarningFn[SizeIndex]; in materializeOneCheck()
765 IRB.CreateCall(Fn, {ConvertedShadow2, MS.TrackOrigins && Origin in materializeOneCheck()
773 /* Unreachable */ !ClKeepGoing, MS.ColdCallWeights); in materializeOneCheck()
776 if (MS.TrackOrigins) { in materializeOneCheck()
778 MS.OriginTLS); in materializeOneCheck()
780 IRB.CreateCall(MS.WarningFn, {}); in materializeOneCheck()
781 IRB.CreateCall(MS.EmptyAsm, {}); in materializeOneCheck()
798 MS.initializeCallbacks(*F.getParent()); in runOnFunction()
816 PHINode *PNO = MS.TrackOrigins ? cast<PHINode>(getOrigin(PN)) : nullptr; in runOnFunction()
857 return VectorType::get(IntegerType::get(*MS.C, EltSize), in getShadowTy()
868 StructType *Res = StructType::get(*MS.C, Elements, ST->isPacked()); in getShadowTy()
873 return IntegerType::get(*MS.C, TypeSize); in getShadowTy()
879 return IntegerType::get(*MS.C, vt->getBitWidth()); in getShadowTyNoVec()
896 uint64_t AndMask = MS.MapParams->AndMask; in getShadowPtrOffset()
899 IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy), in getShadowPtrOffset()
900 ConstantInt::get(MS.IntptrTy, ~AndMask)); in getShadowPtrOffset()
902 uint64_t XorMask = MS.MapParams->XorMask; in getShadowPtrOffset()
905 ConstantInt::get(MS.IntptrTy, XorMask)); in getShadowPtrOffset()
916 uint64_t ShadowBase = MS.MapParams->ShadowBase; in getShadowPtr()
920 ConstantInt::get(MS.IntptrTy, ShadowBase)); in getShadowPtr()
930 uint64_t OriginBase = MS.MapParams->OriginBase; in getOriginPtr()
934 ConstantInt::get(MS.IntptrTy, OriginBase)); in getOriginPtr()
938 ConstantInt::get(MS.IntptrTy, ~Mask)); in getOriginPtr()
949 Value *Base = IRB.CreatePointerCast(MS.ParamTLS, MS.IntptrTy); in getShadowPtrForArgument()
950 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForArgument()
958 if (!MS.TrackOrigins) return nullptr; in getOriginPtrForArgument()
959 Value *Base = IRB.CreatePointerCast(MS.ParamOriginTLS, MS.IntptrTy); in getOriginPtrForArgument()
960 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getOriginPtrForArgument()
961 return IRB.CreateIntToPtr(Base, PointerType::get(MS.OriginTy, 0), in getOriginPtrForArgument()
967 Value *Base = IRB.CreatePointerCast(MS.RetvalTLS, MS.IntptrTy); in getShadowPtrForRetval()
975 return MS.RetvalOriginTLS; in getOriginPtrForRetval()
986 if (!MS.TrackOrigins) return; in setOrigin()
1032 return Constant::getNullValue(MS.OriginTy); in getCleanOrigin()
1112 if (MS.TrackOrigins && !Overflow) { in getShadow()
1136 if (!MS.TrackOrigins) return nullptr; in getOrigin()
1245 if (MS.TrackOrigins) { in visitLoadInst()
1455 if (MSV->MS.TrackOrigins) { in Add()
1476 Value *OpOrigin = MSV->MS.TrackOrigins ? MSV->getOrigin(V) : nullptr; in Add()
1488 if (MSV->MS.TrackOrigins) { in Done()
1500 if (!MS.TrackOrigins) return; in setOriginForNaryOp()
1528 Value *V1 = IRB.CreateBitCast(V, Type::getIntNTy(*MS.C, srcSizeInBits)); in CreateShadowCast()
1530 IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), Signed); in CreateShadowCast()
1823 MS.MemmoveFn, in visitMemMoveInst()
1826 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemMoveInst()
1837 MS.MemcpyFn, in visitMemCpyInst()
1840 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemCpyInst()
1848 MS.MemsetFn, in visitMemSetInst()
1851 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemSetInst()
1901 if (MS.TrackOrigins) in handleVectorStoreIntrinsic()
1927 if (MS.TrackOrigins) { in handleVectorLoadIntrinsic()
2144 return VectorType::get(IntegerType::get(*MS.C, EltSizeInBits), in getMMXVectorTy()
2207 Type *X86_MMXTy = Type::getX86_MMXTy(*MS.C); in handleVectorPackIntrinsic()
2226 Type *ResTy = isX86_MMX ? IntegerType::get(*MS.C, 64) : I.getType(); in handleVectorSadIntrinsic()
2468 getShadowPtr(A, Type::getInt8Ty(*MS.C), IRB), in visitCallSite()
2478 if (MS.TrackOrigins && !ArgIsInitialized) in visitCallSite()
2522 if (MS.TrackOrigins) in visitCallSite()
2539 if (MS.TrackOrigins) in visitReturnInst()
2555 if (MS.TrackOrigins) in visitPHINode()
2556 setOrigin(&I, IRB.CreatePHI(MS.OriginTy, I.getNumIncomingValues(), in visitPHINode()
2567 IRB.CreateCall(MS.MsanPoisonStackFn, in visitAllocaInst()
2569 ConstantInt::get(MS.IntptrTy, Size)}); in visitAllocaInst()
2571 Value *ShadowBase = getShadowPtr(&I, Type::getInt8PtrTy(*MS.C), IRB); in visitAllocaInst()
2576 if (PoisonStack && MS.TrackOrigins) { in visitAllocaInst()
2589 IRB.CreateCall(MS.MsanSetAllocaOrigin4Fn, in visitAllocaInst()
2591 ConstantInt::get(MS.IntptrTy, Size), in visitAllocaInst()
2593 IRB.CreatePointerCast(&F, MS.IntptrTy)}); in visitAllocaInst()
2630 if (MS.TrackOrigins) { in visitSelectInst()
2719 MemorySanitizer &MS; member
2726 VarArgAMD64Helper(Function &F, MemorySanitizer &MS, in VarArgAMD64Helper()
2728 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgAMD64Helper()
2798 IRB.CreateStore(OverflowSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
2804 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
2805 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
2840 VAArgOverflowSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
2842 IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AMD64FpEndOffset), in finalizeInstrumentation()
2844 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
2845 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
2857 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
2858 ConstantInt::get(MS.IntptrTy, 16)), in finalizeInstrumentation()
2859 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
2868 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
2869 ConstantInt::get(MS.IntptrTy, 8)), in finalizeInstrumentation()
2870 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
2884 MemorySanitizer &MS; member
2891 VarArgMIPS64Helper(Function &F, MemorySanitizer &MS, in VarArgMIPS64Helper()
2893 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgMIPS64Helper()
2919 IRB.CreateStore(TotalVAArgSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
2925 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
2926 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
2954 VAArgSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
2955 Value *CopySize = IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, 0), in finalizeInstrumentation()
2961 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
2962 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
2972 IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
2973 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
2984 VarArgNoOpHelper(Function &F, MemorySanitizer &MS, in VarArgNoOpHelper()