summaryrefslogtreecommitdiffstats
path: root/mlir/lib
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-02-06 12:59:50 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 16:18:59 -0700
commitfd2d7c857b9cfecb91346a6ef6dc6bf13b98ae1d (patch)
treedf2d981ec1b959ceaf168ba36a6114bee029e0d2 /mlir/lib
parent888b9fa8a6bc828814dc2df7e57abcc443f6517e (diff)
downloadbcm5719-llvm-fd2d7c857b9cfecb91346a6ef6dc6bf13b98ae1d.tar.gz
bcm5719-llvm-fd2d7c857b9cfecb91346a6ef6dc6bf13b98ae1d.zip
Rename the 'if' operation in the AffineOps dialect to 'affine.if' and namespace
the AffineOps dialect with 'affine'. PiperOrigin-RevId: 232728977
Diffstat (limited to 'mlir/lib')
-rw-r--r--mlir/lib/AffineOps/AffineOps.cpp6
-rw-r--r--mlir/lib/Analysis/Utils.cpp2
-rw-r--r--mlir/lib/IR/Block.cpp2
-rw-r--r--mlir/lib/Transforms/DmaGeneration.cpp6
-rw-r--r--mlir/lib/Transforms/LowerAffine.cpp32
-rw-r--r--mlir/lib/Transforms/MemRefDataFlowOpt.cpp2
6 files changed, 25 insertions, 25 deletions
diff --git a/mlir/lib/AffineOps/AffineOps.cpp b/mlir/lib/AffineOps/AffineOps.cpp
index be5a2f14628..858b8bd791d 100644
--- a/mlir/lib/AffineOps/AffineOps.cpp
+++ b/mlir/lib/AffineOps/AffineOps.cpp
@@ -35,7 +35,7 @@ using llvm::dbgs;
//===----------------------------------------------------------------------===//
AffineOpsDialect::AffineOpsDialect(MLIRContext *context)
- : Dialect(/*namePrefix=*/"", context) {
+ : Dialect(/*namePrefix=*/"affine", context) {
addOperations<AffineApplyOp, AffineForOp, AffineIfOp>();
}
@@ -1102,7 +1102,7 @@ bool AffineIfOp::verify() const {
// block lists.
if (std::next(blockList.begin()) != blockList.end())
return emitOpError(
- "expects only one block per 'if' or 'else' block list");
+ "expects only one block per 'affine.if' or 'else' block list");
if (blockList.front().getTerminator())
return emitOpError("expects region block to not have a terminator");
@@ -1151,7 +1151,7 @@ bool AffineIfOp::parse(OpAsmParser *parser, OperationState *result) {
void AffineIfOp::print(OpAsmPrinter *p) const {
auto conditionAttr = getAttrOfType<IntegerSetAttr>(getConditionAttrName());
- *p << "if " << conditionAttr;
+ *p << "affine.if " << conditionAttr;
printDimAndSymbolList(operand_begin(), operand_end(),
conditionAttr.getValue().getNumDims(), p);
p->printBlockList(getInstruction()->getBlockList(0));
diff --git a/mlir/lib/Analysis/Utils.cpp b/mlir/lib/Analysis/Utils.cpp
index a48f39c2aac..823fbbe9fcd 100644
--- a/mlir/lib/Analysis/Utils.cpp
+++ b/mlir/lib/Analysis/Utils.cpp
@@ -42,7 +42,7 @@ void mlir::getLoopIVs(const Instruction &inst,
auto *currInst = inst.getParentInst();
OpPointer<AffineForOp> currAffineForOp;
// Traverse up the hierarchy collecing all 'affine.for' instruction while
- // skipping over 'if' instructions.
+ // skipping over 'affine.if' instructions.
while (currInst && ((currAffineForOp = currInst->dyn_cast<AffineForOp>()) ||
currInst->isa<AffineIfOp>())) {
if (currAffineForOp)
diff --git a/mlir/lib/IR/Block.cpp b/mlir/lib/IR/Block.cpp
index 83e15097942..90bc0b76efc 100644
--- a/mlir/lib/IR/Block.cpp
+++ b/mlir/lib/IR/Block.cpp
@@ -189,7 +189,7 @@ unsigned Block::getNumSuccessors() const {
return terminator->getNumSuccessors();
}
assert(getParent() && "top-level block with no terminator");
- // Blocks inside 'affine.for'/'if' instructions don't have successors.
+ // Blocks inside 'affine.for'/'affine.if' instructions don't have successors.
return 0;
}
diff --git a/mlir/lib/Transforms/DmaGeneration.cpp b/mlir/lib/Transforms/DmaGeneration.cpp
index 631ebf939ea..dcb4828d0bf 100644
--- a/mlir/lib/Transforms/DmaGeneration.cpp
+++ b/mlir/lib/Transforms/DmaGeneration.cpp
@@ -456,9 +456,9 @@ bool DmaGeneration::runOnBlock(Block *block, uint64_t consumedCapacityBytes) {
// instructions) are always assumed to not exhaust memory. As a result, this
// approach is conservative in some cases at the moment, we do a check later
// and report an error with location info.
- // TODO(bondhugula): An 'if' instruction is being treated similar to an
- // operation instruction. 'if''s could have 'affine.for's in them; treat them
- // separately.
+ // TODO(bondhugula): An 'affine.if' instruction is being treated similar to an
+ // operation instruction. 'affine.if''s could have 'affine.for's in them;
+ // treat them separately.
// Get to the first load, store, or for op.
auto curBegin =
diff --git a/mlir/lib/Transforms/LowerAffine.cpp b/mlir/lib/Transforms/LowerAffine.cpp
index ef45891c26f..5ce8a6258f4 100644
--- a/mlir/lib/Transforms/LowerAffine.cpp
+++ b/mlir/lib/Transforms/LowerAffine.cpp
@@ -402,16 +402,16 @@ bool LowerAffinePass::lowerAffineFor(OpPointer<AffineForOp> forOp) {
return false;
}
-// Convert an "if" instruction into a flow of basic blocks.
+// Convert an "affine.if" instruction into a flow of basic blocks.
//
// Create an SESE region for the if instruction (including its "then" and
// optional "else" instruction blocks) and append it to the end of the current
// region. The conditional region consists of a sequence of condition-checking
// blocks that implement the short-circuit scheme, followed by a "then" SESE
// region and an "else" SESE region, and the continuation block that
-// post-dominates all blocks of the "if" instruction. The flow of blocks that
-// correspond to the "then" and "else" clauses are constructed recursively,
-// enabling easy nesting of "if" instructions and if-then-else-if chains.
+// post-dominates all blocks of the "affine.if" instruction. The flow of blocks
+// that correspond to the "then" and "else" clauses are constructed recursively,
+// enabling easy nesting of "affine.if" instructions and if-then-else-if chains.
//
// +--------------------------------+
// | <code before the AffineIfOp> |
@@ -465,9 +465,9 @@ bool LowerAffinePass::lowerAffineIf(AffineIfOp *ifOp) {
auto *ifInst = ifOp->getInstruction();
auto loc = ifInst->getLoc();
- // Start by splitting the block containing the 'if' into two parts. The part
- // before will contain the condition, the part after will be the continuation
- // point.
+ // Start by splitting the block containing the 'affine.if' into two parts. The
+ // part before will contain the condition, the part after will be the
+ // continuation point.
auto *condBlock = ifInst->getBlock();
auto *continueBlock = condBlock->splitBlock(ifInst);
@@ -517,15 +517,15 @@ bool LowerAffinePass::lowerAffineIf(AffineIfOp *ifOp) {
// Ok, now we just have to handle the condition logic.
auto integerSet = ifOp->getIntegerSet();
- // Implement short-circuit logic. For each affine expression in the 'if'
- // condition, convert it into an affine map and call `affine.apply` to obtain
- // the resulting value. Perform the equality or the greater-than-or-equality
- // test between this value and zero depending on the equality flag of the
- // condition. If the test fails, jump immediately to the false branch, which
- // may be the else block if it is present or the continuation block otherwise.
- // If the test succeeds, jump to the next block testing the next conjunct of
- // the condition in the similar way. When all conjuncts have been handled,
- // jump to the 'then' block instead.
+ // Implement short-circuit logic. For each affine expression in the
+ // 'affine.if' condition, convert it into an affine map and call
+ // `affine.apply` to obtain the resulting value. Perform the equality or the
+ // greater-than-or-equality test between this value and zero depending on the
+ // equality flag of the condition. If the test fails, jump immediately to the
+ // false branch, which may be the else block if it is present or the
+ // continuation block otherwise. If the test succeeds, jump to the next block
+ // testing the next conjunct of the condition in the similar way. When all
+ // conjuncts have been handled, jump to the 'then' block instead.
builder.setInsertionPointToEnd(condBlock);
Value *zeroConstant = builder.create<ConstantIndexOp>(loc, 0);
diff --git a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp
index 3141d748750..91a17764358 100644
--- a/mlir/lib/Transforms/MemRefDataFlowOpt.cpp
+++ b/mlir/lib/Transforms/MemRefDataFlowOpt.cpp
@@ -19,7 +19,7 @@
// potentially getting rid of intermediate memref's entirely.
// TODO(mlir-team): In the future, similar techniques could be used to eliminate
// dead memref store's and perform more complex forwarding when support for
-// SSA scalars live out of 'affine.for'/'if' statements is available.
+// SSA scalars live out of 'affine.for'/'affine.if' statements is available.
//===----------------------------------------------------------------------===//
#include "mlir/Analysis/AffineAnalysis.h"
OpenPOWER on IntegriCloud