|
LLVM 24.0.0git
|
#include "llvm/Transforms/Instrumentation/NumericalStabilitySanitizer.h"#include "InstrumentationOptions.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringExtras.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/Function.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/Metadata.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/Support/Debug.h"#include "llvm/Support/Regex.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include "llvm/Transforms/Utils/Instrumentation.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/ModuleUtils.h"#include <cstdint>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 |
| #define DEBUG_TYPE "nsan" |
Definition at line 47 of file NumericalStabilitySanitizer.cpp.
| #define MOVE_FLAG | ( | attr, | |
| setter ) |
Referenced by moveFastMathFlags().
|
strong |
| Enumerator | |
|---|---|
| ContinueWithShadow | |
| ResumeFromValue | |
Definition at line 824 of file NumericalStabilitySanitizer.cpp.
|
static |
Definition at line 580 of file NumericalStabilitySanitizer.cpp.
References llvm::GlobalValue::ExternalLinkage, and llvm::GlobalValue::InitialExecTLSModel.
|
static |
Definition at line 1469 of file NumericalStabilitySanitizer.cpp.
References llvm::errs(), llvm::TargetLibraryInfo::getLibFunc(), llvm::TargetLibraryInfo::getName(), and LLVM_DEBUG.
Definition at line 2093 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::dyn_cast(), and uint64_t.
|
constexpr |
Referenced by llvm::NumericalStabilitySanitizerPass::run().
|
constexpr |
Referenced by llvm::NumericalStabilitySanitizerPass::run().
|
static |
Definition at line 1252 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::FunctionType::get(), and llvm::Type::getDoubleTy().
|
static |
Definition at line 1272 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::FunctionType::get(), and llvm::Type::getDoubleTy().
|
static |
Definition at line 1283 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::FunctionType::get(), and llvm::Type::getDoubleTy().
|
static |
Definition at line 1261 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::FunctionType::get(), llvm::Type::getDoubleTy(), and llvm::Type::getInt32Ty().
|
static |
Definition at line 1256 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::FunctionType::get(), and llvm::Type::getX86_FP80Ty().
|
static |
Definition at line 1266 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::FunctionType::get(), llvm::Type::getInt32Ty(), and llvm::Type::getX86_FP80Ty().
|
static |
Definition at line 1277 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::FunctionType::get(), and llvm::Type::getX86_FP80Ty().
|
static |
Definition at line 1290 of file NumericalStabilitySanitizer.cpp.
References C(), llvm::FunctionType::get(), and llvm::Type::getX86_FP80Ty().
|
static |
Definition at line 1928 of file NumericalStabilitySanitizer.cpp.
References F, I, llvm::isa(), and MOVE_FLAG.
|
static |
Definition at line 729 of file NumericalStabilitySanitizer.cpp.
References llvm::CallBase::getCalledFunction(), llvm::Function::getIntrinsicID(), llvm::TargetLibraryInfo::getLibFunc(), llvm::Value::getName(), llvm::isa(), llvm::StringRef::starts_with(), and llvm::Instruction::users().
| STATISTIC | ( | NumInstrumentedFCmp | , |
| "Number of instrumented fcmps" | ) |
| STATISTIC | ( | NumInstrumentedFTCalls | , |
| "Number of instrumented floating-point calls" | ) |
| STATISTIC | ( | NumInstrumentedFTLoads | , |
| "Number of instrumented floating-point loads" | ) |
| STATISTIC | ( | NumInstrumentedFTRets | , |
| "Number of instrumented floating-point returns" | ) |
| STATISTIC | ( | NumInstrumentedFTStores | , |
| "Number of instrumented floating-point stores" | ) |
| STATISTIC | ( | NumInstrumentedNonFTMemcpyStores | , |
| "Number of instrumented non floating-point stores with memcpy semantics" | ) |
| STATISTIC | ( | NumInstrumentedNonFTStores | , |
| "Number of instrumented non floating-point stores" | ) |
|
constexpr |
Definition at line 71 of file NumericalStabilitySanitizer.cpp.
|
constexpr |
Definition at line 72 of file NumericalStabilitySanitizer.cpp.
|
constexpr |
Definition at line 70 of file NumericalStabilitySanitizer.cpp.
|
constexpr |
Definition at line 69 of file NumericalStabilitySanitizer.cpp.