LLVM: lib/Transforms/Scalar/GuardWidening.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "guard-widening"
Functions
STATISTIC (GuardsEliminated, "Number of eliminated guards")
STATISTIC (CondBranchEliminated, "Number of eliminated conditional branches")
STATISTIC (FreezeAdded, "Number of freeze instruction introduced")
static Value * getCondition (Instruction *I)
static void setCondition (Instruction *I, Value *NewCond)
static void eliminateGuard (Instruction *GuardInst, MemorySSAUpdater *MSSAU)
static std::optional< BasicBlock::iterator > findInsertionPointForWideCondition (Instruction *WCOrGuard)
Find a point at which the widened condition of Guard should be inserted.
static bool isSupportedGuardInstruction (const Instruction *Insn)
static std::optional< BasicBlock::iterator > getFreezeInsertPt (Value *V, const DominatorTree &DT)
Variables
static cl::opt< bool > WidenBranchGuards ("guard-widening-widen-branch-guards", cl::Hidden, cl::desc("Whether or not we should widen guards " "expressed as branches by widenable conditions"), cl::init(true))

DEBUG_TYPE

#define DEBUG_TYPE "guard-widening"

eliminateGuard()

findInsertionPointForWideCondition()

getCondition()

Definition at line 79 of file GuardWidening.cpp.

References assert(), llvm::cast(), Cond, llvm::dyn_cast(), I, and llvm::parseWidenableBranch().

Referenced by foldICmpWithDominatingICmp(), handleGuaranteedWellDefinedOps(), llvm::AArch64TTIImpl::isProfitableToSinkOperands(), LLVMGetCondition(), negateICmpIfUsedByBranchOrSelectOnly(), llvm::PredicateSwitch::PredicateSwitch(), shouldInsertFreeze(), and SimplifyCondBranchToCondBranch().

getFreezeInsertPt()

isSupportedGuardInstruction()

setCondition()

STATISTIC() [1/3]

STATISTIC ( CondBranchEliminated ,
"Number of eliminated conditional branches" )

STATISTIC() [2/3]

STATISTIC ( FreezeAdded ,
"Number of freeze instruction introduced" )

STATISTIC() [3/3]

STATISTIC ( GuardsEliminated ,
"Number of eliminated guards" )

WidenBranchGuards

cl::opt< bool > WidenBranchGuards("guard-widening-widen-branch-guards", cl::Hidden, cl::desc("Whether or not we should widen guards " "expressed as branches by widenable conditions"), cl::init(true)) ( "guard-widening-widen-branch-guards" , cl::Hidden , cl::desc("Whether or not we should widen guards " "expressed as branches by widenable conditions") , cl::init(true) ) static