Fix outdated comments

PiperOrigin-RevId: 229300301
This commit is contained in:
Uday Bondhugula 2019-01-14 19:28:04 -08:00 committed by jpienaar
parent 3bb35ad0dc
commit 6e4f3e40c7
8 changed files with 39 additions and 46 deletions

View File

@ -17,16 +17,15 @@
//
// Integer sets are sets of points from the integer lattice constrained by
// affine equality/inequality constraints. This class is meant to represent
// affine equality/inequality conditions for MLFunctions' if instructions. As
// such, it is only expected to contain a handful of affine constraints, and it
// is immutable like an Affine Map. Integer sets are however not unique'd -
// although affine expressions that make up the equalities and inequalites of an
// integer set are themselves unique.
// integer sets in the IR - for 'if' instructions and as attributes of other
// instructions. It is typically expected to contain only a handful of affine
// constraints, and is immutable like an affine map. Integer sets are not
// unique'd - although affine expressions that make up its equalities and
// inequalites are themselves unique.
// This class is not meant for affine analysis and operations like set
// operations, emptiness checks, or other math operations for analysis and
// transformation. Another data structure (TODO(bondhugula)) will be used to
// create and operate on such temporary constaint systems.
// transformation. For the latter, use FlatAffineConstraints.
//
//===----------------------------------------------------------------------===//
@ -44,11 +43,11 @@ struct IntegerSetStorage;
class MLIRContext;
/// An integer set representing a conjunction of affine equalities and
/// inequalities. An integer set in the IR is immutable like the affine map, but
/// integer sets are not unique'd. The affine expressions that make up the
/// equalities and inequalities of an integer set are themselves unique and live
/// in the bump allocator.
/// An integer set representing a conjunction of one or more affine equalities
/// and inequalities. An integer set in the IR is immutable like the affine map,
/// but integer sets are not unique'd. The affine expressions that make up the
/// equalities and inequalities of an integer set are themselves unique and are
/// allocated by the bump pointer allocator.
class IntegerSet {
public:
using ImplType = detail::IntegerSetStorage;

View File

@ -280,9 +280,9 @@ private:
// at the end, a stride and a number_of_elements_per_stride arguments. The tag
// location is used by a DmaWaitOp to check for completion. The indices of the
// source memref, destination memref, and the tag memref have the same
// restrictions as any load/store in MLFunctions. The optional stride arguments
// should be of 'index' type, and specify a stride for the slower memory space
// (memory space with a lower memory space id), tranferring chunks of
// restrictions as any load/store. The optional stride arguments should be of
// 'index' type, and specify a stride for the slower memory space (memory space
// with a lower memory space id), tranferring chunks of
// number_of_elements_per_stride every stride until %num_elements are
// transferred. Either both or no stride arguments should be specified.
//
@ -435,9 +435,8 @@ protected:
// DmaWaitOp blocks until the completion of a DMA operation associated with the
// tag element '%tag[%index]'. %tag is a memref, and %index has to be an index
// with the same restrictions as any load/store index in MLFunctions.
// %num_elements is the number of elements associated with the DMA operation.
// For example:
// with the same restrictions as any load/store index. %num_elements is the
// number of elements associated with the DMA operation. For example:
//
// dma_start %src[%i, %j], %dst[%k, %l], %num_elements, %tag[%index] :
// memref<2048 x f32>, (d0) -> (d0), 0>,

View File

@ -35,11 +35,9 @@ namespace mlir {
class Module;
/// Convert the given MLIR module into LLVM IR. Create an LLVM IR module in
/// "llvmContext" and return a unique pointer to it. The MLIR module is not
/// allowed to contain MLFunctions, lower them to CFGFunctions beforehand using
/// an appropriate pass. In case of error, report it to the error handler
/// registered with the MLIR context, if any (obtained from the MLIR module),
/// and return `nullptr`.
/// "llvmContext" and return a unique pointer to it. In case of error, report it
/// to the error handler registered with the MLIR context, if any (obtained from
/// the MLIR module), and return `nullptr`.
std::unique_ptr<llvm::Module>
convertModuleToLLVMIR(Module &module, llvm::LLVMContext &llvmContext);

View File

@ -69,7 +69,7 @@ FunctionPass *createLoopUnrollAndJamPass(int unrollJamFactor = -1);
/// Creates an simplification pass for affine structures.
FunctionPass *createSimplifyAffineStructuresPass();
/// Creates a loop fusion pass which fuses loops in MLFunctions.
/// Creates a loop fusion pass which fuses loops.
FunctionPass *createLoopFusionPass();
/// Creates a pass to pipeline explicit movement of data across levels of the

View File

@ -1,4 +1,4 @@
//===- Dominance.cpp - Dominator analysis for CFG Functions ---------------===//
//===- Dominance.cpp - Dominator analysis for functions -------------------===//
//
// Copyright 2019 The MLIR Authors.
//

View File

@ -15,8 +15,7 @@
// limitations under the License.
// =============================================================================
//
// This file implements a pass that converts CFG function to LLVM IR. No ML
// functions must be presented in MLIR.
// This file implements a pass that converts MLIR functions to LLVM IR.
//
//===----------------------------------------------------------------------===//
@ -54,11 +53,11 @@ public:
private:
bool convertBlock(const Block &bb, bool ignoreArguments = false);
bool convertFunction(const Function &cfgFunc, llvm::Function &llvmFunc);
bool convertFunction(const Function &func, llvm::Function &llvmFunc);
bool convertFunctions(const Module &mlirModule, llvm::Module &llvmModule);
bool convertInstruction(const OperationInst &inst);
void connectPHINodes(const Function &cfgFunc);
void connectPHINodes(const Function &func);
/// Type conversion functions. If any conversion fails, report errors to the
/// context of the MLIR type and return nullptr.
@ -822,11 +821,10 @@ static const Value *getPHISourceValue(const Block *current, const Block *pred,
return nullptr;
}
void ModuleLowerer::connectPHINodes(const Function &cfgFunc) {
void ModuleLowerer::connectPHINodes(const Function &func) {
// Skip the first block, it cannot be branched to and its arguments correspond
// to the arguments of the LLVM function.
for (auto it = std::next(cfgFunc.begin()), eit = cfgFunc.end(); it != eit;
++it) {
for (auto it = std::next(func.begin()), eit = func.end(); it != eit; ++it) {
const Block *bb = &*it;
llvm::BasicBlock *llvmBB = blockMapping[bb];
auto phis = llvmBB->phis();
@ -844,21 +842,21 @@ void ModuleLowerer::connectPHINodes(const Function &cfgFunc) {
}
}
bool ModuleLowerer::convertFunction(const Function &cfgFunc,
bool ModuleLowerer::convertFunction(const Function &func,
llvm::Function &llvmFunc) {
// Clear the block mapping. Blocks belong to a function, no need to keep
// blocks from the previous functions around. Furthermore, we use this
// mapping to connect PHI nodes inside the function later.
blockMapping.clear();
// First, create all blocks so we can jump to them.
for (const auto &bb : cfgFunc) {
for (const auto &bb : func) {
auto *llvmBB = llvm::BasicBlock::Create(llvmContext);
llvmBB->insertInto(&llvmFunc);
blockMapping[&bb] = llvmBB;
}
// Then, convert blocks one by one.
for (auto indexedBB : llvm::enumerate(cfgFunc)) {
for (auto indexedBB : llvm::enumerate(func)) {
const auto &bb = indexedBB.value();
if (convertBlock(bb, /*ignoreArguments=*/indexedBB.index() == 0))
return true;
@ -866,7 +864,7 @@ bool ModuleLowerer::convertFunction(const Function &cfgFunc,
// Finally, after all blocks have been traversed and values mapped, connect
// the PHI nodes to the results of preceding blocks.
connectPHINodes(cfgFunc);
connectPHINodes(func);
return false;
}

View File

@ -15,12 +15,11 @@
// limitations under the License.
// =============================================================================
//
// This file implements loop unroll and jam for MLFunctions. Unroll and jam is a
// transformation that improves locality, in particular, register reuse, while
// also improving instruction level parallelism. The example below shows what it
// does in nearly the general case. Loop unroll and jam currently works if the
// bounds of the loops inner to the loop being unroll-jammed do not depend on
// the latter.
// This file implements loop unroll and jam. Unroll and jam is a transformation
// that improves locality, in particular, register reuse, while also improving
// instruction level parallelism. The example below shows what it does in nearly
// the general case. Loop unroll and jam currently works if the bounds of the
// loops inner to the loop being unroll-jammed do not depend on the latter.
//
// Before After unroll and jam of i by factor 2:
//

View File

@ -286,10 +286,10 @@ static Value *buildMinMaxReductionSeq(Location loc, CmpIPredicate predicate,
// Create an SESE region for the loop (including its body) and append it to the
// end of the current region. The loop region consists of the initialization
// block that sets up the initial value of the loop induction variable (%iv) and
// computes the loop bounds that are loop-invariant in MLFunctions; the
// condition block that checks the exit condition of the loop; the body SESE
// region; and the end block that post-dominates the loop. The end block of the
// loop becomes the new end of the current SESE region. The body of the loop is
// computes the loop bounds that are loop-invariant in functions; the condition
// block that checks the exit condition of the loop; the body SESE region; and
// the end block that post-dominates the loop. The end block of the loop
// becomes the new end of the current SESE region. The body of the loop is
// constructed recursively after starting a new region (it may be, for example,
// a nested loop). Induction variable modification is appended to the body SESE
// region that always loops back to the condition block.