|
LLVM 24.0.0git
|
#include "ScalarOptions.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/AssumptionCache.h"#include "llvm/Analysis/CFG.h"#include "llvm/Analysis/DomTreeUpdater.h"#include "llvm/Analysis/GlobalsModRef.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/CFG.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/ValueHandle.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/Transforms/Scalar.h"#include "llvm/Transforms/Scalar/SimplifyCFG.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/SimplifyCFGOptions.h"#include <utility>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "simplifycfg" |
Functions | |
| STATISTIC (NumSimpl, "Number of blocks simplified") | |
| static bool | performBlockTailMerging (Function &F, ArrayRef< BasicBlock * > BBs, std::vector< DominatorTree::UpdateType > *Updates) |
| static bool | tailMergeBlocksWithSimilarFunctionTerminators (Function &F, DomTreeUpdater *DTU) |
| static bool | iterativelySimplifyCFG (Function &F, const TargetTransformInfo &TTI, DomTreeUpdater *DTU, const SimplifyCFGOptions &Options) |
| Call SimplifyCFG on all the blocks in the function, iterating until no more changes are made. | |
| static bool | simplifyFunctionCFGImpl (Function &F, const TargetTransformInfo &TTI, DominatorTree *DT, const SimplifyCFGOptions &Options) |
| static bool | simplifyFunctionCFG (Function &F, const TargetTransformInfo &TTI, DominatorTree *DT, const SimplifyCFGOptions &Options) |
| static void | applyCommandLineOverridesToOptions (SimplifyCFGOptions &Options) |
| INITIALIZE_PASS_BEGIN (CFGSimplifyPass, "simplifycfg", "Simplify the CFG", false, false) INITIALIZE_PASS_END(CFGSimplifyPass | |
Variables | |
| simplifycfg | |
| Simplify the | CFG |
| Simplify the | false |
| #define DEBUG_TYPE "simplifycfg" |
Definition at line 47 of file SimplifyCFGPass.cpp.
|
static |
Definition at line 284 of file SimplifyCFGPass.cpp.
References Options, and llvm::valueOr().
Referenced by llvm::SimplifyCFGPass::SimplifyCFGPass(), and llvm::SimplifyCFGPass::SimplifyCFGPass().
| INITIALIZE_PASS_BEGIN | ( | CFGSimplifyPass | , |
| "simplifycfg" | , | ||
| "Simplify the CFG" | , | ||
| false | , | ||
| false | ) |
References INITIALIZE_PASS_DEPENDENCY.
|
static |
Call SimplifyCFG on all the blocks in the function, iterating until no more changes are made.
Definition at line 191 of file SimplifyCFGPass.cpp.
References assert(), llvm::SmallPtrSetImpl< PtrType >::begin(), Changed, llvm::SmallPtrSetImpl< PtrType >::end(), F, llvm::FindFunctionBackedges(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::GenericDomTreeUpdater< DerivedT, DomTreeT, PostDomTreeT >::isBBPendingDeletion(), Options, and llvm::simplifyCFG().
Referenced by simplifyFunctionCFGImpl().
|
static |
Definition at line 52 of file SimplifyCFGPass.cpp.
References assert(), llvm::BasicBlock::Create(), llvm::PHINode::Create(), llvm::UncondBrInst::Create(), llvm::BasicBlock::end(), F, llvm::DebugLoc::getMergedLocation(), llvm::Value::getName(), llvm::Instruction::getOpcode(), getType(), I, llvm::DominatorTreeBase< BasicBlock, false >::Insert, llvm::Instruction::insertInto(), llvm::User::operands(), llvm::SmallVectorImpl< T >::resize(), llvm::Instruction::setDebugLoc(), llvm::ArrayRef< T >::size(), and llvm::zip().
Referenced by tailMergeBlocksWithSimilarFunctionTerminators().
|
static |
Definition at line 267 of file SimplifyCFGPass.cpp.
References assert(), Changed, F, Options, llvm::RequireAndPreserveDomTree, simplifyFunctionCFGImpl(), and llvm::DominatorTreeBase< NodeT, IsPostDom >::verify().
Referenced by llvm::SimplifyCFGPass::run().
|
static |
Definition at line 234 of file SimplifyCFGPass.cpp.
References F, iterativelySimplifyCFG(), Options, llvm::removeUnreachableBlocks(), and tailMergeBlocksWithSimilarFunctionTerminators().
Referenced by simplifyFunctionCFG().
| STATISTIC | ( | NumSimpl | , |
| "Number of blocks simplified" | ) |
|
static |
Definition at line 126 of file SimplifyCFGPass.cpp.
References llvm::any_of(), llvm::GenericDomTreeUpdater< DerivedT, DomTreeT, PostDomTreeT >::applyUpdates(), Changed, llvm::dyn_cast_or_null(), F, llvm::GenericDomTreeUpdater< DerivedT, DomTreeT, PostDomTreeT >::isBBPendingDeletion(), llvm::make_second_range(), performBlockTailMerging(), and llvm::succ_empty().
Referenced by simplifyFunctionCFGImpl().
| Simplify the CFG |
Definition at line 406 of file SimplifyCFGPass.cpp.
| Simplify the false |
Definition at line 406 of file SimplifyCFGPass.cpp.
| simplifycfg |
Definition at line 406 of file SimplifyCFGPass.cpp.