• Home
  • Raw
  • Download

Lines Matching refs:MS

605   MemorySanitizer &MS;  member
628 MemorySanitizerVisitor(Function &F, MemorySanitizer &MS) in MemorySanitizerVisitor()
629 : F(F), MS(MS), VAHelper(CreateVarArgHelper(F, MS, *this)) { in MemorySanitizerVisitor()
645 if (MS.TrackOrigins <= 1) return V; in updateOrigin()
646 return IRB.CreateCall(MS.MsanChainOriginFn, V); in updateOrigin()
651 unsigned IntptrSize = DL.getTypeStoreSize(MS.IntptrTy); in originToIntptr()
654 Origin = IRB.CreateIntCast(Origin, MS.IntptrTy, /* isSigned */ false); in originToIntptr()
662 unsigned IntptrAlignment = DL.getABITypeAlignment(MS.IntptrTy); in paintOrigin()
663 unsigned IntptrSize = DL.getTypeStoreSize(MS.IntptrTy); in paintOrigin()
672 IRB.CreatePointerCast(OriginPtr, PointerType::get(MS.IntptrTy, 0)); in paintOrigin()
674 Value *Ptr = i ? IRB.CreateConstGEP1_32(MS.IntptrTy, IntptrOriginPtr, i) in paintOrigin()
714 Value *Fn = MS.MaybeStoreOriginFn[SizeIndex]; in storeOrigin()
724 Cmp, &*IRB.GetInsertPoint(), false, MS.OriginStoreWeights); in storeOrigin()
752 if (MS.TrackOrigins && !SI.isAtomic()) in materializeStores()
768 if (MS.TrackOrigins) { in materializeOneCheck()
770 MS.OriginTLS); in materializeOneCheck()
772 IRB.CreateCall(MS.WarningFn, {}); in materializeOneCheck()
773 IRB.CreateCall(MS.EmptyAsm, {}); in materializeOneCheck()
786 Value *Fn = MS.MaybeWarningFn[SizeIndex]; in materializeOneCheck()
789 IRB.CreateCall(Fn, {ConvertedShadow2, MS.TrackOrigins && Origin in materializeOneCheck()
797 /* Unreachable */ !ClKeepGoing, MS.ColdCallWeights); in materializeOneCheck()
800 if (MS.TrackOrigins) { in materializeOneCheck()
802 MS.OriginTLS); in materializeOneCheck()
804 IRB.CreateCall(MS.WarningFn, {}); in materializeOneCheck()
805 IRB.CreateCall(MS.EmptyAsm, {}); in materializeOneCheck()
822 MS.initializeCallbacks(*F.getParent()); in runOnFunction()
840 PHINode *PNO = MS.TrackOrigins ? cast<PHINode>(getOrigin(PN)) : nullptr; in runOnFunction()
881 return VectorType::get(IntegerType::get(*MS.C, EltSize), in getShadowTy()
892 StructType *Res = StructType::get(*MS.C, Elements, ST->isPacked()); in getShadowTy()
897 return IntegerType::get(*MS.C, TypeSize); in getShadowTy()
903 return IntegerType::get(*MS.C, vt->getBitWidth()); in getShadowTyNoVec()
920 Value *OffsetLong = IRB.CreatePointerCast(Addr, MS.IntptrTy); in getShadowPtrOffset()
922 uint64_t AndMask = MS.MapParams->AndMask; in getShadowPtrOffset()
925 IRB.CreateAnd(OffsetLong, ConstantInt::get(MS.IntptrTy, ~AndMask)); in getShadowPtrOffset()
927 uint64_t XorMask = MS.MapParams->XorMask; in getShadowPtrOffset()
930 IRB.CreateXor(OffsetLong, ConstantInt::get(MS.IntptrTy, XorMask)); in getShadowPtrOffset()
941 uint64_t ShadowBase = MS.MapParams->ShadowBase; in getShadowPtr()
945 ConstantInt::get(MS.IntptrTy, ShadowBase)); in getShadowPtr()
955 uint64_t OriginBase = MS.MapParams->OriginBase; in getOriginPtr()
959 ConstantInt::get(MS.IntptrTy, OriginBase)); in getOriginPtr()
963 ConstantInt::get(MS.IntptrTy, ~Mask)); in getOriginPtr()
974 Value *Base = IRB.CreatePointerCast(MS.ParamTLS, MS.IntptrTy); in getShadowPtrForArgument()
975 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForArgument()
983 if (!MS.TrackOrigins) return nullptr; in getOriginPtrForArgument()
984 Value *Base = IRB.CreatePointerCast(MS.ParamOriginTLS, MS.IntptrTy); in getOriginPtrForArgument()
985 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getOriginPtrForArgument()
986 return IRB.CreateIntToPtr(Base, PointerType::get(MS.OriginTy, 0), in getOriginPtrForArgument()
992 Value *Base = IRB.CreatePointerCast(MS.RetvalTLS, MS.IntptrTy); in getShadowPtrForRetval()
1000 return MS.RetvalOriginTLS; in getOriginPtrForRetval()
1011 if (!MS.TrackOrigins) return; in setOrigin()
1057 return Constant::getNullValue(MS.OriginTy); in getCleanOrigin()
1137 if (MS.TrackOrigins && !Overflow) { in getShadow()
1161 if (!MS.TrackOrigins) return nullptr; in getOrigin()
1270 if (MS.TrackOrigins) { in visitLoadInst()
1486 if (MSV->MS.TrackOrigins) { in Add()
1507 Value *OpOrigin = MSV->MS.TrackOrigins ? MSV->getOrigin(V) : nullptr; in Add()
1519 if (MSV->MS.TrackOrigins) { in Done()
1531 if (!MS.TrackOrigins) return; in setOriginForNaryOp()
1559 Value *V1 = IRB.CreateBitCast(V, Type::getIntNTy(*MS.C, srcSizeInBits)); in CreateShadowCast()
1561 IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), Signed); in CreateShadowCast()
1865 MS.MemmoveFn, in visitMemMoveInst()
1868 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemMoveInst()
1879 MS.MemcpyFn, in visitMemCpyInst()
1882 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemCpyInst()
1890 MS.MemsetFn, in visitMemSetInst()
1893 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemSetInst()
1924 if (MS.TrackOrigins) in handleVectorStoreIntrinsic()
1950 if (MS.TrackOrigins) { in handleVectorLoadIntrinsic()
2161 return VectorType::get(IntegerType::get(*MS.C, EltSizeInBits), in getMMXVectorTy()
2224 Type *X86_MMXTy = Type::getX86_MMXTy(*MS.C); in handleVectorPackIntrinsic()
2243 Type *ResTy = isX86_MMX ? IntegerType::get(*MS.C, 64) : I.getType(); in handleVectorSadIntrinsic()
2485 getShadowPtr(A, Type::getInt8Ty(*MS.C), IRB), in visitCallSite()
2495 if (MS.TrackOrigins && !ArgIsInitialized) in visitCallSite()
2542 if (MS.TrackOrigins) in visitCallSite()
2571 if (MS.TrackOrigins) in visitReturnInst()
2587 if (MS.TrackOrigins) in visitPHINode()
2588 setOrigin(&I, IRB.CreatePHI(MS.OriginTy, I.getNumIncomingValues(), in visitPHINode()
2599 IRB.CreateCall(MS.MsanPoisonStackFn, in visitAllocaInst()
2601 ConstantInt::get(MS.IntptrTy, Size)}); in visitAllocaInst()
2603 Value *ShadowBase = getShadowPtr(&I, Type::getInt8PtrTy(*MS.C), IRB); in visitAllocaInst()
2608 if (PoisonStack && MS.TrackOrigins) { in visitAllocaInst()
2621 IRB.CreateCall(MS.MsanSetAllocaOrigin4Fn, in visitAllocaInst()
2623 ConstantInt::get(MS.IntptrTy, Size), in visitAllocaInst()
2625 IRB.CreatePointerCast(&F, MS.IntptrTy)}); in visitAllocaInst()
2662 if (MS.TrackOrigins) { in visitSelectInst()
2771 MemorySanitizer &MS; member
2778 VarArgAMD64Helper(Function &F, MemorySanitizer &MS, in VarArgAMD64Helper()
2780 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgAMD64Helper()
2850 IRB.CreateStore(OverflowSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
2856 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
2857 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
2896 VAArgOverflowSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
2898 IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AMD64FpEndOffset), in finalizeInstrumentation()
2900 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
2901 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
2913 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
2914 ConstantInt::get(MS.IntptrTy, 16)), in finalizeInstrumentation()
2915 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
2924 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
2925 ConstantInt::get(MS.IntptrTy, 8)), in finalizeInstrumentation()
2926 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
2940 MemorySanitizer &MS; member
2947 VarArgMIPS64Helper(Function &F, MemorySanitizer &MS, in VarArgMIPS64Helper()
2949 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgMIPS64Helper()
2975 IRB.CreateStore(TotalVAArgSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
2981 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
2982 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
3010 VAArgSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
3011 Value *CopySize = IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, 0), in finalizeInstrumentation()
3017 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
3018 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
3028 IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
3029 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
3053 MemorySanitizer &MS; member
3060 VarArgAArch64Helper(Function &F, MemorySanitizer &MS, in VarArgAArch64Helper()
3062 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgAArch64Helper()
3120 IRB.CreateStore(OverflowSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
3126 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
3127 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
3157 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in getVAField64()
3158 ConstantInt::get(MS.IntptrTy, offset)), in getVAField64()
3159 Type::getInt64PtrTy(*MS.C)); in getVAField64()
3167 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in getVAField32()
3168 ConstantInt::get(MS.IntptrTy, offset)), in getVAField32()
3169 Type::getInt32PtrTy(*MS.C)); in getVAField32()
3171 return IRB.CreateSExt(SaveArea32, MS.IntptrTy); in getVAField32()
3181 VAArgOverflowSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
3183 IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AArch64VAEndOffset), in finalizeInstrumentation()
3185 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
3186 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
3189 Value *GrArgSize = ConstantInt::get(MS.IntptrTy, kAArch64GrArgSize); in finalizeInstrumentation()
3190 Value *VrArgSize = ConstantInt::get(MS.IntptrTy, kAArch64VrArgSize); in finalizeInstrumentation()
3276 VarArgNoOpHelper(Function &F, MemorySanitizer &MS, in VarArgNoOpHelper()