LLVM 24.0.0git
NumericalStabilitySanitizer.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "nsan"
#define MOVE_FLAG(attr, setter)

Enumerations

enum class  ContinuationType { ContinueWithShadow = 0 , ResumeFromValue = 1 }

Functions

 STATISTIC (NumInstrumentedFTLoads, "Number of instrumented floating-point loads")
 STATISTIC (NumInstrumentedFTCalls, "Number of instrumented floating-point calls")
 STATISTIC (NumInstrumentedFTRets, "Number of instrumented floating-point returns")
 STATISTIC (NumInstrumentedFTStores, "Number of instrumented floating-point stores")
 STATISTIC (NumInstrumentedNonFTStores, "Number of instrumented non floating-point stores")
 STATISTIC (NumInstrumentedNonFTMemcpyStores, "Number of instrumented non floating-point stores with memcpy semantics")
 STATISTIC (NumInstrumentedFCmp, "Number of instrumented fcmps")
constexpr StringLiteral kNsanModuleCtorName ("nsan.module_ctor")
constexpr StringLiteral kNsanInitName ("__nsan_init")
static GlobalValue * createThreadLocalGV (const char *Name, Module &M, Type *Ty)
static bool shouldCheckArgs (CallBase &CI, const TargetLibraryInfo &TLI, const std::optional< Regex > &CheckFunctionsFilter)
static FunctionType * makeDoubleDouble (LLVMContext &C)
static FunctionType * makeX86FP80X86FP80 (LLVMContext &C)
static FunctionType * makeDoubleDoubleI32 (LLVMContext &C)
static FunctionType * makeX86FP80X86FP80I32 (LLVMContext &C)
static FunctionType * makeDoubleDoubleDouble (LLVMContext &C)
static FunctionType * makeX86FP80X86FP80X86FP80 (LLVMContext &C)
static FunctionType * makeDoubleDoubleDoubleDouble (LLVMContext &C)
static FunctionType * makeX86FP80X86FP80X86FP80X86FP80 (LLVMContext &C)
static const char * getIntrinsicFromLibfunc (Function &Fn, Type *VT, const TargetLibraryInfo &TLI)
static void moveFastMathFlags (Function &F, std::vector< Instruction * > &Instructions)
static uint64_t GetMemOpSize (Value *V)

Variables

constexpr int kShadowScale = 2
constexpr int kMaxVectorWidth = 8
constexpr int kMaxNumArgs = 128
constexpr int kMaxShadowTypeSizeBytes = 16

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "nsan"

Definition at line 47 of file NumericalStabilitySanitizer.cpp.

◆ MOVE_FLAG

#define MOVE_FLAG ( attr,
setter )
Value:
if (F.getFnAttribute(attr).getValueAsString() == "true") { \
F.removeFnAttr(attr); \
FMF.set##setter(); \
}
#define F(x, y, z)
Definition MD5.cpp:54

Referenced by moveFastMathFlags().

Enumeration Type Documentation

◆ ContinuationType

enum class ContinuationType
strong
Enumerator
ContinueWithShadow 
ResumeFromValue 

Definition at line 824 of file NumericalStabilitySanitizer.cpp.

Function Documentation

◆ createThreadLocalGV()

GlobalValue * createThreadLocalGV ( const char * Name,
Module & M,
Type * Ty )
static

◆ getIntrinsicFromLibfunc()

const char * getIntrinsicFromLibfunc ( Function & Fn,
Type * VT,
const TargetLibraryInfo & TLI )
static

◆ GetMemOpSize()

uint64_t GetMemOpSize ( Value * V)
static

Definition at line 2093 of file NumericalStabilitySanitizer.cpp.

References C(), llvm::dyn_cast(), and uint64_t.

◆ kNsanInitName()

StringLiteral kNsanInitName ( "__nsan_init" )
constexpr

◆ kNsanModuleCtorName()

StringLiteral kNsanModuleCtorName ( "nsan.module_ctor" )
constexpr

◆ makeDoubleDouble()

FunctionType * makeDoubleDouble ( LLVMContext & C)
static

◆ makeDoubleDoubleDouble()

FunctionType * makeDoubleDoubleDouble ( LLVMContext & C)
static

◆ makeDoubleDoubleDoubleDouble()

FunctionType * makeDoubleDoubleDoubleDouble ( LLVMContext & C)
static

◆ makeDoubleDoubleI32()

FunctionType * makeDoubleDoubleI32 ( LLVMContext & C)
static

◆ makeX86FP80X86FP80()

FunctionType * makeX86FP80X86FP80 ( LLVMContext & C)
static

◆ makeX86FP80X86FP80I32()

FunctionType * makeX86FP80X86FP80I32 ( LLVMContext & C)
static

◆ makeX86FP80X86FP80X86FP80()

FunctionType * makeX86FP80X86FP80X86FP80 ( LLVMContext & C)
static

◆ makeX86FP80X86FP80X86FP80X86FP80()

FunctionType * makeX86FP80X86FP80X86FP80X86FP80 ( LLVMContext & C)
static

◆ moveFastMathFlags()

void moveFastMathFlags ( Function & F,
std::vector< Instruction * > & Instructions )
static

Definition at line 1928 of file NumericalStabilitySanitizer.cpp.

References F, I, llvm::isa(), and MOVE_FLAG.

◆ shouldCheckArgs()

◆ STATISTIC() [1/7]

STATISTIC ( NumInstrumentedFCmp ,
"Number of instrumented fcmps"  )

◆ STATISTIC() [2/7]

STATISTIC ( NumInstrumentedFTCalls ,
"Number of instrumented floating-point calls"  )

◆ STATISTIC() [3/7]

STATISTIC ( NumInstrumentedFTLoads ,
"Number of instrumented floating-point loads"  )

◆ STATISTIC() [4/7]

STATISTIC ( NumInstrumentedFTRets ,
"Number of instrumented floating-point returns"  )

◆ STATISTIC() [5/7]

STATISTIC ( NumInstrumentedFTStores ,
"Number of instrumented floating-point stores"  )

◆ STATISTIC() [6/7]

STATISTIC ( NumInstrumentedNonFTMemcpyStores ,
"Number of instrumented non floating-point stores with memcpy semantics"  )

◆ STATISTIC() [7/7]

STATISTIC ( NumInstrumentedNonFTStores ,
"Number of instrumented non floating-point stores"  )

Variable Documentation

◆ kMaxNumArgs

int kMaxNumArgs = 128
constexpr

Definition at line 71 of file NumericalStabilitySanitizer.cpp.

◆ kMaxShadowTypeSizeBytes

int kMaxShadowTypeSizeBytes = 16
constexpr

Definition at line 72 of file NumericalStabilitySanitizer.cpp.

◆ kMaxVectorWidth

int kMaxVectorWidth = 8
constexpr

Definition at line 70 of file NumericalStabilitySanitizer.cpp.

◆ kShadowScale

int kShadowScale = 2
constexpr

Definition at line 69 of file NumericalStabilitySanitizer.cpp.