Captures loop safety information. It keep information for loop blocks may throw exception or otherwise exit abnormally on any iteration of the loop which might actually execute at runtime. The primary way to consume this information is via isGuaranteedToExecute below, but some callers bailout or fallback to alternate reasoning if a loop contains any implicit control flow. NOTE: LoopSafetyInfo contains cached information regarding loops and their particular blocks. This information is only dropped on invocation of computeLoopSafetyInfo. If the loop or any of its block is deleted, or if any thrower instructions have been added or removed from them, or if the control flow has changed, or in case of other meaningful modifications, the LoopSafetyInfo needs to be recomputed. If a meaningful modifications to the loop were made and the info wasn't recomputed properly, the behavior of all methods except for computeLoopSafetyInfo is undefined.
Declared in <llvm/Analysis/MustExecute.h>
class LoopSafetyInfo;
| Name | Description |
|---|---|
LoopSafetyInfo [constructor] | Default constructor |
~LoopSafetyInfo [destructor] [virtual] | Destructor |
allLoopPathsLeadToBlock | Return true if we must reach the block BB under assumption that the loop CurLoop is entered. |
allLoopPathsLeadToBlockImpl | |
anyBlockMayThrow [virtual] | Returns true iff any block of the loop for which this info is contains an instruction that may throw or otherwise exit abnormally. |
blockMayThrow [virtual] | Returns true iff the block BB potentially may throw exception. It can be false-positive in cases when we want to avoid complex analysis. |
computeLoopSafetyInfo [virtual] | Computes safety information for a loop checks loop body & header for the possibility of may throw exception, it takes LoopSafetyInfo and loop as argument. Updates safety information in LoopSafetyInfo argument. Note: This is defined to clear and reinitialize an already initialized LoopSafetyInfo. Some callers rely on this fact. |
copyColors | Copy colors of block Old into the block New. |
getBlockColors | Returns block colors map that is used to update funclet operand bundles. |
isGuaranteedToExecute [virtual] | Returns true if the instruction in a loop is guaranteed to execute at least once (under the assumption that the loop is entered). |
| Name | Description |
|---|---|
computeBlockColors | Computes block colors. |
| Name | Description |
|---|---|
ICFLoopSafetyInfo | This implementation of LoopSafetyInfo use ImplicitControlFlowTracking to give precise answers on "may throw" queries. This implementation uses cache that should be invalidated by calling the methods insertInstructionTo and removeInstruction whenever we modify a basic block's contents by adding or removing instructions. |
SimpleLoopSafetyInfo | Simple and conservative implementation of LoopSafetyInfo that can give false-positive answers to its queries in order to avoid complicated analysis. |