• Home
  • Raw
  • Download

Lines Matching refs:MS

624   MemorySanitizer &MS;  member
648 MemorySanitizerVisitor(Function &F, MemorySanitizer &MS) in MemorySanitizerVisitor()
649 : F(F), MS(MS), VAHelper(CreateVarArgHelper(F, MS, *this)) { in MemorySanitizerVisitor()
658 TLI = &MS.getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(); in MemorySanitizerVisitor()
666 if (MS.TrackOrigins <= 1) return V; in updateOrigin()
667 return IRB.CreateCall(MS.MsanChainOriginFn, V); in updateOrigin()
672 unsigned IntptrSize = DL.getTypeStoreSize(MS.IntptrTy); in originToIntptr()
675 Origin = IRB.CreateIntCast(Origin, MS.IntptrTy, /* isSigned */ false); in originToIntptr()
683 unsigned IntptrAlignment = DL.getABITypeAlignment(MS.IntptrTy); in paintOrigin()
684 unsigned IntptrSize = DL.getTypeStoreSize(MS.IntptrTy); in paintOrigin()
693 IRB.CreatePointerCast(OriginPtr, PointerType::get(MS.IntptrTy, 0)); in paintOrigin()
695 Value *Ptr = i ? IRB.CreateConstGEP1_32(MS.IntptrTy, IntptrOriginPtr, i) in paintOrigin()
735 Value *Fn = MS.MaybeStoreOriginFn[SizeIndex]; in storeOrigin()
745 Cmp, &*IRB.GetInsertPoint(), false, MS.OriginStoreWeights); in storeOrigin()
773 if (MS.TrackOrigins && !SI->isAtomic()) in materializeStores()
789 if (MS.TrackOrigins) { in materializeOneCheck()
791 MS.OriginTLS); in materializeOneCheck()
793 IRB.CreateCall(MS.WarningFn, {}); in materializeOneCheck()
794 IRB.CreateCall(MS.EmptyAsm, {}); in materializeOneCheck()
807 Value *Fn = MS.MaybeWarningFn[SizeIndex]; in materializeOneCheck()
810 IRB.CreateCall(Fn, {ConvertedShadow2, MS.TrackOrigins && Origin in materializeOneCheck()
818 /* Unreachable */ !ClKeepGoing, MS.ColdCallWeights); in materializeOneCheck()
821 if (MS.TrackOrigins) { in materializeOneCheck()
823 MS.OriginTLS); in materializeOneCheck()
825 IRB.CreateCall(MS.WarningFn, {}); in materializeOneCheck()
826 IRB.CreateCall(MS.EmptyAsm, {}); in materializeOneCheck()
843 MS.initializeCallbacks(*F.getParent()); in runOnFunction()
861 PHINode *PNO = MS.TrackOrigins ? cast<PHINode>(getOrigin(PN)) : nullptr; in runOnFunction()
902 return VectorType::get(IntegerType::get(*MS.C, EltSize), in getShadowTy()
913 StructType *Res = StructType::get(*MS.C, Elements, ST->isPacked()); in getShadowTy()
918 return IntegerType::get(*MS.C, TypeSize); in getShadowTy()
924 return IntegerType::get(*MS.C, vt->getBitWidth()); in getShadowTyNoVec()
941 Value *OffsetLong = IRB.CreatePointerCast(Addr, MS.IntptrTy); in getShadowPtrOffset()
943 uint64_t AndMask = MS.MapParams->AndMask; in getShadowPtrOffset()
946 IRB.CreateAnd(OffsetLong, ConstantInt::get(MS.IntptrTy, ~AndMask)); in getShadowPtrOffset()
948 uint64_t XorMask = MS.MapParams->XorMask; in getShadowPtrOffset()
951 IRB.CreateXor(OffsetLong, ConstantInt::get(MS.IntptrTy, XorMask)); in getShadowPtrOffset()
962 uint64_t ShadowBase = MS.MapParams->ShadowBase; in getShadowPtr()
966 ConstantInt::get(MS.IntptrTy, ShadowBase)); in getShadowPtr()
976 uint64_t OriginBase = MS.MapParams->OriginBase; in getOriginPtr()
980 ConstantInt::get(MS.IntptrTy, OriginBase)); in getOriginPtr()
984 ConstantInt::get(MS.IntptrTy, ~Mask)); in getOriginPtr()
995 Value *Base = IRB.CreatePointerCast(MS.ParamTLS, MS.IntptrTy); in getShadowPtrForArgument()
996 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForArgument()
1004 if (!MS.TrackOrigins) return nullptr; in getOriginPtrForArgument()
1005 Value *Base = IRB.CreatePointerCast(MS.ParamOriginTLS, MS.IntptrTy); in getOriginPtrForArgument()
1006 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getOriginPtrForArgument()
1007 return IRB.CreateIntToPtr(Base, PointerType::get(MS.OriginTy, 0), in getOriginPtrForArgument()
1013 Value *Base = IRB.CreatePointerCast(MS.RetvalTLS, MS.IntptrTy); in getShadowPtrForRetval()
1021 return MS.RetvalOriginTLS; in getOriginPtrForRetval()
1032 if (!MS.TrackOrigins) return; in setOrigin()
1078 return Constant::getNullValue(MS.OriginTy); in getCleanOrigin()
1158 if (MS.TrackOrigins && !Overflow) { in getShadow()
1182 if (!MS.TrackOrigins) return nullptr; in getOrigin()
1291 if (MS.TrackOrigins) { in visitLoadInst()
1507 if (MSV->MS.TrackOrigins) { in Add()
1528 Value *OpOrigin = MSV->MS.TrackOrigins ? MSV->getOrigin(V) : nullptr; in Add()
1540 if (MSV->MS.TrackOrigins) { in Done()
1552 if (!MS.TrackOrigins) return; in setOriginForNaryOp()
1580 Value *V1 = IRB.CreateBitCast(V, Type::getIntNTy(*MS.C, srcSizeInBits)); in CreateShadowCast()
1582 IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), Signed); in CreateShadowCast()
1886 MS.MemmoveFn, in visitMemMoveInst()
1889 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemMoveInst()
1900 MS.MemcpyFn, in visitMemCpyInst()
1903 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemCpyInst()
1911 MS.MemsetFn, in visitMemSetInst()
1914 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false)}); in visitMemSetInst()
1945 if (MS.TrackOrigins) in handleVectorStoreIntrinsic()
1971 if (MS.TrackOrigins) { in handleVectorLoadIntrinsic()
2190 return VectorType::get(IntegerType::get(*MS.C, EltSizeInBits), in getMMXVectorTy()
2253 Type *X86_MMXTy = Type::getX86_MMXTy(*MS.C); in handleVectorPackIntrinsic()
2272 Type *ResTy = isX86_MMX ? IntegerType::get(*MS.C, 64) : I.getType(); in handleVectorSadIntrinsic()
2575 getShadowPtr(A, Type::getInt8Ty(*MS.C), IRB), in visitCallSite()
2585 if (MS.TrackOrigins && !ArgIsInitialized) in visitCallSite()
2632 if (MS.TrackOrigins) in visitCallSite()
2661 if (MS.TrackOrigins) in visitReturnInst()
2677 if (MS.TrackOrigins) in visitPHINode()
2678 setOrigin(&I, IRB.CreatePHI(MS.OriginTy, I.getNumIncomingValues(), in visitPHINode()
2689 IRB.CreateCall(MS.MsanPoisonStackFn, in visitAllocaInst()
2691 ConstantInt::get(MS.IntptrTy, Size)}); in visitAllocaInst()
2693 Value *ShadowBase = getShadowPtr(&I, Type::getInt8PtrTy(*MS.C), IRB); in visitAllocaInst()
2698 if (PoisonStack && MS.TrackOrigins) { in visitAllocaInst()
2711 IRB.CreateCall(MS.MsanSetAllocaOrigin4Fn, in visitAllocaInst()
2713 ConstantInt::get(MS.IntptrTy, Size), in visitAllocaInst()
2715 IRB.CreatePointerCast(&F, MS.IntptrTy)}); in visitAllocaInst()
2752 if (MS.TrackOrigins) { in visitSelectInst()
2861 MemorySanitizer &MS; member
2868 VarArgAMD64Helper(Function &F, MemorySanitizer &MS, in VarArgAMD64Helper()
2870 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgAMD64Helper()
2951 IRB.CreateStore(OverflowSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
2957 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
2958 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
2997 VAArgOverflowSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
2999 IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AMD64FpEndOffset), in finalizeInstrumentation()
3001 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
3002 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
3014 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
3015 ConstantInt::get(MS.IntptrTy, 16)), in finalizeInstrumentation()
3016 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
3025 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
3026 ConstantInt::get(MS.IntptrTy, 8)), in finalizeInstrumentation()
3027 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
3041 MemorySanitizer &MS; member
3048 VarArgMIPS64Helper(Function &F, MemorySanitizer &MS, in VarArgMIPS64Helper()
3050 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgMIPS64Helper()
3078 IRB.CreateStore(TotalVAArgSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
3084 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
3085 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
3113 VAArgSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
3114 Value *CopySize = IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, 0), in finalizeInstrumentation()
3120 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
3121 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
3131 IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
3132 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
3156 MemorySanitizer &MS; member
3163 VarArgAArch64Helper(Function &F, MemorySanitizer &MS, in VarArgAArch64Helper()
3165 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgAArch64Helper()
3233 IRB.CreateStore(OverflowSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
3239 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
3240 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
3270 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in getVAField64()
3271 ConstantInt::get(MS.IntptrTy, offset)), in getVAField64()
3272 Type::getInt64PtrTy(*MS.C)); in getVAField64()
3280 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in getVAField32()
3281 ConstantInt::get(MS.IntptrTy, offset)), in getVAField32()
3282 Type::getInt32PtrTy(*MS.C)); in getVAField32()
3284 return IRB.CreateSExt(SaveArea32, MS.IntptrTy); in getVAField32()
3294 VAArgOverflowSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
3296 IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AArch64VAEndOffset), in finalizeInstrumentation()
3298 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
3299 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
3302 Value *GrArgSize = ConstantInt::get(MS.IntptrTy, kAArch64GrArgSize); in finalizeInstrumentation()
3303 Value *VrArgSize = ConstantInt::get(MS.IntptrTy, kAArch64VrArgSize); in finalizeInstrumentation()
3390 MemorySanitizer &MS; member
3397 VarArgPowerPC64Helper(Function &F, MemorySanitizer &MS, in VarArgPowerPC64Helper()
3399 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(nullptr), in VarArgPowerPC64Helper()
3481 IRB.CreateStore(TotalVAArgSize, MS.VAArgOverflowSizeTLS); in visitCallSite()
3487 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy); in getShadowPtrForVAArgument()
3488 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset)); in getShadowPtrForVAArgument()
3516 VAArgSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS); in finalizeInstrumentation()
3517 Value *CopySize = IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, 0), in finalizeInstrumentation()
3523 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize); in finalizeInstrumentation()
3524 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8); in finalizeInstrumentation()
3534 IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy), in finalizeInstrumentation()
3535 Type::getInt64PtrTy(*MS.C)); in finalizeInstrumentation()
3546 VarArgNoOpHelper(Function &F, MemorySanitizer &MS, in VarArgNoOpHelper()