|
LLVM
5.0.0
|
#include "llvm/ADT/DenseSet.h"#include "llvm/ADT/SetOperations.h"#include "llvm/ADT/SetVector.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Module.h"#include "llvm/IR/Value.h"#include "llvm/IR/SafepointIRVerifier.h"#include "llvm/IR/Statepoint.h"#include "llvm/Support/Debug.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/raw_ostream.h"Go to the source code of this file.
Classes | |
| struct | SafepointIRVerifier |
| struct | BasicBlockState |
| The verifier algorithm is phrased in terms of availability. More... | |
Macros | |
| #define | DEBUG_TYPE "safepoint-ir-verifier" |
Enumerations | |
| enum | BaseType { NonConstant = 1, ExclusivelyNull, ExclusivelySomeConstant } |
| A given derived pointer can have multiple base pointers through phi/selects. More... | |
Functions | |
| static void | Verify (const Function &F, const DominatorTree &DT) |
| INITIALIZE_PASS_BEGIN (SafepointIRVerifier,"verify-safepoint-ir","Safepoint IR Verifier", false, true) INITIALIZE_PASS_END(SafepointIRVerifier | |
| verify safepoint Safepoint IR static true bool | isGCPointerType (Type *T) |
| static bool | containsGCPtrType (Type *Ty) |
| template<typename IteratorTy > | |
| static void | PrintValueSet (raw_ostream &OS, IteratorTy Begin, IteratorTy End) |
| static void | GatherDominatingDefs (const BasicBlock *BB, DenseSet< const Value * > &Result, const DominatorTree &DT, DenseMap< const BasicBlock *, BasicBlockState * > &BlockMap) |
| Gather all the definitions dominating the start of BB into Result. More... | |
| static void | TransferInstruction (const Instruction &I, bool &Cleared, DenseSet< const Value * > &Available) |
| Model the effect of an instruction on the set of available values. More... | |
| static void | TransferBlock (const BasicBlock *BB, BasicBlockState &BBS, bool FirstPass) |
| Compute the AvailableOut set for BB, based on the BasicBlockState BBS, which is the BasicBlockState for BB. More... | |
| static enum BaseType | getBaseType (const Value *Val) |
| Return the baseType for Val which states whether Val is exclusively derived from constant/null, or not exclusively derived from constant. More... | |
Variables | |
| static cl::opt< bool > | PrintOnly ("safepoint-ir-verifier-print-only", cl::init(false)) |
| This option is used for writing test cases. More... | |
| verify safepoint | ir |
| verify safepoint Safepoint IR | Verifier |
| verify safepoint Safepoint IR | false |
| #define DEBUG_TYPE "safepoint-ir-verifier" |
Definition at line 51 of file SafepointIRVerifier.cpp.
| enum BaseType |
A given derived pointer can have multiple base pointers through phi/selects.
This type indicates when the base pointer is exclusively constant (ExclusivelySomeConstant), and if that constant is proven to be exclusively null, we record that as ExclusivelyNull. In all other cases, the BaseType is NonConstant.
| Enumerator | |
|---|---|
| NonConstant | |
| ExclusivelyNull | |
| ExclusivelySomeConstant | |
Definition at line 228 of file SafepointIRVerifier.cpp.
Definition at line 108 of file SafepointIRVerifier.cpp.
References llvm::any_of(), isGCPointerType(), and llvm::ARM_MB::ST.
Referenced by GatherDominatingDefs(), TransferInstruction(), and Verify().
|
static |
Gather all the definitions dominating the start of BB into Result.
This is simply the Defs introduced by every dominating basic block and the function arguments.
Definition at line 158 of file SafepointIRVerifier.cpp.
References A, llvm::Function::args(), containsGCPtrType(), llvm::DomTreeNodeBase< NodeT >::getBlock(), llvm::DomTreeNodeBase< NodeT >::getIDom(), llvm::BasicBlock::getParent(), and llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert().
Referenced by Verify().
Return the baseType for Val which states whether Val is exclusively derived from constant/null, or not exclusively derived from constant.
Val is exclusively derived off a constant base when all operands of phi and selects are derived off a constant base.
Definition at line 240 of file SafepointIRVerifier.cpp.
References llvm::SmallVectorBase::empty(), ExclusivelyNull, ExclusivelySomeConstant, GEP, llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), NonConstant, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and SI.
Referenced by llvm::DwarfUnit::getOrCreateTypeDIE(), llvm::DbgVariable::getType(), and Verify().
| INITIALIZE_PASS_BEGIN | ( | SafepointIRVerifier | , |
| "verify-safepoint-ir" | , | ||
| "Safepoint IR Verifier" | , | ||
| false | , | ||
| true | |||
| ) |
Definition at line 99 of file SafepointIRVerifier.cpp.
Referenced by containsGCPtrType().
|
static |
Definition at line 123 of file SafepointIRVerifier.cpp.
Referenced by TransferBlock().
|
static |
Compute the AvailableOut set for BB, based on the BasicBlockState BBS, which is the BasicBlockState for BB.
FirstPass is set when the verifier runs for the first time computing the AvailableOut set for BB.
Definition at line 195 of file SafepointIRVerifier.cpp.
References BasicBlockState::AvailableIn, BasicBlockState::AvailableOut, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::begin(), BasicBlockState::Cleared, BasicBlockState::Contribution, llvm::dbgs(), DEBUG, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::end(), llvm::Value::getName(), PrintValueSet(), and llvm::set_union().
Referenced by Verify().
|
static |
Model the effect of an instruction on the set of available values.
Definition at line 182 of file SafepointIRVerifier.cpp.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::clear(), containsGCPtrType(), llvm::Value::getType(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), and llvm::isStatepoint().
Referenced by Verify().
|
static |
Definition at line 294 of file SafepointIRVerifier.cpp.
References llvm::SpecificBumpPtrAllocator< T >::Allocate(), assert(), BasicBlockState::AvailableIn, BasicBlockState::AvailableOut, BasicBlockState::Cleared, containsGCPtrType(), BasicBlockState::Contribution, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), llvm::dbgs(), DEBUG, llvm::SetVector< T, Vector, Set >::empty(), llvm::errs(), ExclusivelySomeConstant, GatherDominatingDefs(), getBaseType(), llvm::Value::getName(), llvm::Value::getType(), I, llvm::SetVector< T, Vector, Set >::insert(), NonConstant, llvm::SetVector< T, Vector, Set >::pop_back_val(), llvm::predecessors(), PrintOnly, llvm::set_intersect(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::size(), llvm::succ_begin(), llvm::succ_end(), TransferBlock(), and TransferInstruction().
Referenced by SafepointIRVerifier::runOnFunction().
Definition at line 96 of file SafepointIRVerifier.cpp.
| verify safepoint ir |
Definition at line 96 of file SafepointIRVerifier.cpp.
This option is used for writing test cases.
Instead of crashing the program when verification fails, report a message to the console (for FileCheck usage) and continue execution as if nothing happened.
Referenced by Verify().
Definition at line 96 of file SafepointIRVerifier.cpp.
Referenced by llvm::verifyFunction(), and llvm::verifyModule().
1.8.6