Fix outdated comments
authorUday Bondhugula <bondhugula@google.com>
Tue, 15 Jan 2019 03:28:04 +0000 (19:28 -0800)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 22:16:08 +0000 (15:16 -0700)
PiperOrigin-RevId: 229300301

mlir/include/mlir/IR/IntegerSet.h
mlir/include/mlir/StandardOps/StandardOps.h
mlir/include/mlir/Target/LLVMIR.h
mlir/include/mlir/Transforms/Passes.h
mlir/lib/Analysis/Dominance.cpp
mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp
mlir/lib/Transforms/LoopUnrollAndJam.cpp
mlir/lib/Transforms/LowerAffine.cpp

index dc7eff7f5725b67681913935d68b9028610ff7d5..d0d82220922b1fab568e963ecd2cb9ac592d0684 100644 (file)
 //
 // 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;
index bb368bd2ef82d66e9c70716891960acb7a09ee14..4c7744c78fafc7f6aefc4b13afb804f086032e7e 100644 (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>,
index 353abe89fb15d324262cb08395b54ccc86041ea0..8c2019c3dfbc185b470af1b15d8d920b2bc95936 100644 (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);
 
index 0c4d4dcde792673fe55bdd8b61b093daf00f753d..e3ae1ac39a10e760825007a079bea31affc39dfd 100644 (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
index 13bf2827a63aa8a765aea806050888486d0e66f2..a5f3be4aa021fa77600eddff6dd61f5a197c4e2e 100644 (file)
@@ -1,4 +1,4 @@
-//===- Dominance.cpp - Dominator analysis for CFG Functions ---------------===//
+//===- Dominance.cpp - Dominator analysis for functions -------------------===//
 //
 // Copyright 2019 The MLIR Authors.
 //
index bcb3c5cb01b17fe973ab965d3684d69167b7b84d..9dfa86c9d94e889bc7aac2cda50ee3a1e8334de0 100644 (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;
 }
 
index 129756083709e6a7c23fce2a50a36743be43de1a..6016617ae536d47f0df59a94243d0b42ae5379aa 100644 (file)
 // 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:
 //
index 1756b3fdd2c4b7023d1ed0d20a3bff0fb1f80261..99ee603bb05edc4ed2dc74176e3ebe53a7995f26 100644 (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.