class SimplifyCFGPass

Declaration

class SimplifyCFGPass : public PassInfoMixin { /* full declaration omitted */ };

Description

A pass to simplify and canonicalize the CFG of a function. This pass iteratively simplifies the entire CFG of a function. It may change or remove control flow to put the CFG into a canonical form expected by other passes of the mid-level optimizer. Depending on the specified options, it may further optimize control-flow to create non-canonical forms.

Declared at: llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h:29

Inherits from: PassInfoMixin

Member Variables

private llvm::SimplifyCFGOptions Options

Method Overview

  • public SimplifyCFGPass()
  • public SimplifyCFGPass(const llvm::SimplifyCFGOptions & PassOptions)
  • public void printPipeline(llvm::raw_ostream & OS, function_ref<llvm::StringRef (llvm::StringRef)> MapClassName2PassName)
  • public llvm::PreservedAnalyses run(llvm::Function & F, llvm::FunctionAnalysisManager & AM)

Methods

SimplifyCFGPass()

Description

The default constructor sets the pass options to create canonical IR, rather than optimal IR. That is, by default we bypass transformations that are likely to improve performance but make analysis for other passes more difficult.

Declared at: llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h:37

SimplifyCFGPass(
    const llvm::SimplifyCFGOptions& PassOptions)

Description

Construct a pass with optional optimizations.

Declared at: llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h:40

Parameters

const llvm::SimplifyCFGOptions& PassOptions

void printPipeline(
    llvm::raw_ostream& OS,
    function_ref<llvm::StringRef(llvm::StringRef)>
        MapClassName2PassName)

Declared at: llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h:45

Parameters

llvm::raw_ostream& OS
function_ref<llvm::StringRef(llvm::StringRef)> MapClassName2PassName

llvm::PreservedAnalyses run(
    llvm::Function& F,
    llvm::FunctionAnalysisManager& AM)

Description

Run the pass over the function.

Declared at: llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h:43

Parameters

llvm::Function& F
llvm::FunctionAnalysisManager& AM