|
LLVM
10.0.0
|
#include "llvm/Transforms/Instrumentation/PoisonChecking.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/MemoryBuiltins.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstVisitor.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/PatternMatch.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.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 | generatePoisonChecksForBinOp (Instruction &I, SmallVector< Value *, 2 > &Checks) |
| static Value * | generatePoisonChecks (Instruction &I) |
| 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 77 of file PoisonChecking.cpp.
Definition at line 92 of file PoisonChecking.cpp.
References llvm::IRBuilder< T, Inserter >::CreateOr(), llvm::IRBuilderBase::getFalse(), isConstantFalse(), and llvm::ArrayRef< T >::size().
Referenced by generatePoisonChecks(), and rewrite().
Definition at line 238 of file PoisonChecking.cpp.
Definition at line 252 of file PoisonChecking.cpp.
Referenced by rewrite().
|
static |
Definition at line 186 of file PoisonChecking.cpp.
References B, buildOrChain(), Check(), llvm::IRBuilder< T, Inserter >::CreateICmp(), generatePoisonChecksForBinOp(), llvm::ConstantInt::get(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getVectorIsScalable(), llvm::Type::getVectorNumElements(), llvm::CmpInst::ICMP_UGE, llvm::Type::isVectorTy(), and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by rewrite().
|
static |
Definition at line 106 of file PoisonChecking.cpp.
References llvm::MCID::Add, assert(), B, Check(), llvm::IRBuilderBase::CreateBinaryIntrinsic(), llvm::IRBuilder< T, Inserter >::CreateExtractValue(), llvm::IRBuilder< T, Inserter >::CreateICmp(), llvm::IRBuilder< T, Inserter >::CreateSRem(), llvm::IRBuilder< T, Inserter >::CreateURem(), llvm::ConstantInt::get(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_UGE, llvm::Instruction::isExact(), and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by generatePoisonChecks().
Definition at line 224 of file PoisonChecking.cpp.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::Value::getContext(), llvm::ConstantInt::getFalse(), and if().
Referenced by rewrite().
Definition at line 85 of file PoisonChecking.cpp.
References assert(), llvm::Value::getType(), and llvm::Type::isIntegerTy().
Referenced by buildOrChain().
Definition at line 257 of file PoisonChecking.cpp.
References llvm::PHINode::addIncoming(), B, buildOrChain(), Check(), llvm::PHINode::Create(), CreateAssertNot(), generatePoisonChecks(), llvm::UndefValue::get(), llvm::Function::getContext(), llvm::getGuaranteedNonFullPoisonOp(), llvm::Type::getInt1Ty(), getPoisonFor(), I, LocalCheck, llvm::propagatesFullPoison(), and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by llvm::PredicatedScalarEvolution::areAddRecsEqualWithPreds(), llvm::ScalarEvolution::convertSCEVToAddRecWithPredicates(), llvm::VirtRegMap::dump(), llvm::ScalarEvolution::getWrapPredicate(), INITIALIZE_PASS(), PushDefUseChildren(), llvm::ScalarEvolution::rewriteUsingPredicate(), llvm::PoisonCheckingPass::run(), llvm::ScalarEvolution::SplitIntoInitAndPostInc(), and llvm::sroa::AllocaSliceRewriter::visit().
1.8.13