CIRCT 24.0.0git
Loading...
Searching...
No Matches
UnrollLoops.cpp File Reference
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/LLHD/LLHDOps.h"
#include "circt/Dialect/LLHD/LLHDPasses.h"
#include "circt/Support/UnusedOpPruner.h"
#include "mlir/Analysis/CFGLoopInfo.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/Matchers.h"
#include "mlir/Pass/Pass.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Support/Debug.h"
#include "circt/Dialect/LLHD/LLHDPasses.h.inc"
Include dependency graph for UnrollLoops.cpp:

Go to the source code of this file.

Namespaces

namespace  circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
namespace  circt::llhd

Macros

#define DEBUG_TYPE   "llhd-unroll-loops"
#define GEN_PASS_DEF_UNROLLLOOPSPASS

Functions

static void cloneBlocks (ArrayRef< Block * > blocks, Region &region, Region::iterator before, IRMapping &mapper)
 Clone a list of blocks into a region before the given block.
static llvm::raw_ostream & operator<< (llvm::raw_ostream &os, const Loop &loop)
static std::optional< bool > evaluatePredicate (comb::ICmpPredicate predicate, const APInt &lhs, const APInt &rhs)
 Evaluate a comparison predicate on two constants.

Variables

static constexpr unsigned kMaxTripCount = 1024
 The largest number of iterations the unroller copies a loop body for.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "llhd-unroll-loops"

Definition at line 23 of file UnrollLoops.cpp.

◆ GEN_PASS_DEF_UNROLLLOOPSPASS

#define GEN_PASS_DEF_UNROLLLOOPSPASS

Definition at line 27 of file UnrollLoops.cpp.

Function Documentation

◆ cloneBlocks()

void cloneBlocks ( ArrayRef< Block * > blocks,
Region & region,
Region::iterator before,
IRMapping & mapper )
static

Clone a list of blocks into a region before the given block.

See Region::cloneInto for the original code that clones an entire region.

Definition at line 45 of file UnrollLoops.cpp.

◆ evaluatePredicate()

std::optional< bool > evaluatePredicate ( comb::ICmpPredicate predicate,
const APInt & lhs,
const APInt & rhs )
static

Evaluate a comparison predicate on two constants.

Returns std::nullopt for the four-valued predicates, which never control a loop we unroll.

Definition at line 155 of file UnrollLoops.cpp.

◆ operator<<()

llvm::raw_ostream & operator<< ( llvm::raw_ostream & os,
const Loop & loop )
static

Definition at line 138 of file UnrollLoops.cpp.

Variable Documentation

◆ kMaxTripCount

unsigned kMaxTripCount = 1024
staticconstexpr

The largest number of iterations the unroller copies a loop body for.

Definition at line 185 of file UnrollLoops.cpp.