LLVM 20.0.0git
|
#include "llvm/Transforms/Instrumentation/PoisonChecking.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "poison-checking" |
Functions | |
static bool | isConstantFalse (Value *V) |
static Value * | buildOrChain (IRBuilder<> &B, ArrayRef< Value * > Ops) |
static void | generateCreationChecksForBinOp (Instruction &I, SmallVectorImpl< Value * > &Checks) |
static void | generateCreationChecks (Instruction &I, SmallVectorImpl< Value * > &Checks) |
Given an instruction which can produce poison on non-poison inputs (i.e. | |
static Value * | getPoisonFor (DenseMap< Value *, Value * > &ValToPoison, Value *V) |
static void | CreateAssert (IRBuilder<> &B, Value *Cond) |
static void | CreateAssertNot (IRBuilder<> &B, Value *Cond) |
static bool | rewrite (Function &F) |
Variables | |
static cl::opt< bool > | LocalCheck ("poison-checking-function-local", cl::init(false), cl::desc("Check that returns are non-poison (for testing)")) |
#define DEBUG_TYPE "poison-checking" |
Definition at line 70 of file PoisonChecking.cpp.
Definition at line 85 of file PoisonChecking.cpp.
References B, llvm::drop_begin(), isConstantFalse(), and llvm::ArrayRef< T >::size().
Referenced by rewrite().
Definition at line 237 of file PoisonChecking.cpp.
References assert(), B, Cond, llvm::Type::getInt1Ty(), and llvm::Type::getVoidTy().
Referenced by CreateAssertNot().
Definition at line 251 of file PoisonChecking.cpp.
References assert(), B, Cond, and CreateAssert().
Referenced by rewrite().
|
static |
Given an instruction which can produce poison on non-poison inputs (i.e.
canCreatePoison returns true), generate runtime checks to produce boolean indicators of when poison would result.
Definition at line 182 of file PoisonChecking.cpp.
References B, Check, generateCreationChecksForBinOp(), llvm::Value::getType(), I, Idx, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by rewrite().
|
static |
Definition at line 99 of file PoisonChecking.cpp.
References assert(), B, Check, llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), I, LHS, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and RHS.
Referenced by generateCreationChecks().
Definition at line 223 of file PoisonChecking.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and llvm::ConstantInt::getFalse().
Referenced by rewrite().
Definition at line 78 of file PoisonChecking.cpp.
References assert().
Referenced by buildOrChain().
Definition at line 256 of file PoisonChecking.cpp.
References B, buildOrChain(), llvm::canCreatePoison(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::PHINode::Create(), CreateAssertNot(), F, generateCreationChecks(), llvm::UndefValue::get(), llvm::getGuaranteedNonPoisonOps(), llvm::Type::getInt1Ty(), getPoisonFor(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), LocalCheck, llvm::propagatesPoison(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::ScalarEvolution::getLosslessPtrToIntExpr(), and llvm::PoisonCheckingPass::run().