summaryrefslogtreecommitdiffstats
path: root/mlir
diff options
context:
space:
mode:
Diffstat (limited to 'mlir')
-rw-r--r--mlir/lib/AffineOps/AffineOps.cpp6
-rw-r--r--mlir/lib/Analysis/AffineStructures.cpp2
-rw-r--r--mlir/lib/Analysis/Dominance.cpp4
-rw-r--r--mlir/lib/Analysis/MemRefDependenceCheck.cpp8
-rw-r--r--mlir/lib/Analysis/Utils.cpp2
-rw-r--r--mlir/lib/IR/AffineExprDetail.h9
-rw-r--r--mlir/lib/IR/AttributeDetail.h28
-rw-r--r--mlir/lib/StandardOps/Ops.cpp22
-rw-r--r--mlir/lib/Transforms/CSE.cpp4
-rw-r--r--mlir/lib/Transforms/DmaGeneration.cpp2
-rw-r--r--mlir/lib/Transforms/LoopFusion.cpp1
-rw-r--r--mlir/lib/Transforms/LoopTiling.cpp1
-rw-r--r--mlir/lib/Transforms/Utils/Utils.cpp4
-rw-r--r--mlir/test/mlir-tblgen/one-op-one-result.td2
-rw-r--r--mlir/test/mlir-tblgen/pattern-tAttr.td4
-rw-r--r--mlir/tools/mlir-tblgen/RewriterGen.cpp4
16 files changed, 71 insertions, 32 deletions
diff --git a/mlir/lib/AffineOps/AffineOps.cpp b/mlir/lib/AffineOps/AffineOps.cpp
index 16fddb45496..bc8564c7931 100644
--- a/mlir/lib/AffineOps/AffineOps.cpp
+++ b/mlir/lib/AffineOps/AffineOps.cpp
@@ -505,7 +505,7 @@ PatternMatchResult SimplifyAffineApply::match(Instruction *op) const {
composeAffineMapAndOperands(&map, &resultOperands);
if (map != oldMap)
return matchSuccess(
- std::make_unique<SimplifyAffineApplyState>(map, resultOperands));
+ llvm::make_unique<SimplifyAffineApplyState>(map, resultOperands));
return matchFailure();
}
@@ -520,7 +520,7 @@ void SimplifyAffineApply::rewrite(Instruction *op,
void AffineApplyOp::getCanonicalizationPatterns(
OwningRewritePatternList &results, MLIRContext *context) {
- results.push_back(std::make_unique<SimplifyAffineApply>(context));
+ results.push_back(llvm::make_unique<SimplifyAffineApply>(context));
}
//===----------------------------------------------------------------------===//
@@ -867,7 +867,7 @@ struct AffineForLoopBoundFolder : public RewritePattern {
void AffineForOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
- results.push_back(std::make_unique<AffineForLoopBoundFolder>(context));
+ results.push_back(llvm::make_unique<AffineForLoopBoundFolder>(context));
}
Block *AffineForOp::createBody() {
diff --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp
index 68fccf7762c..07ca59846a6 100644
--- a/mlir/lib/Analysis/AffineStructures.cpp
+++ b/mlir/lib/Analysis/AffineStructures.cpp
@@ -309,7 +309,7 @@ FlatAffineConstraints::FlatAffineConstraints(
// Clones this object.
std::unique_ptr<FlatAffineConstraints> FlatAffineConstraints::clone() const {
- return std::make_unique<FlatAffineConstraints>(*this);
+ return llvm::make_unique<FlatAffineConstraints>(*this);
}
// Construct from an IntegerSet.
diff --git a/mlir/lib/Analysis/Dominance.cpp b/mlir/lib/Analysis/Dominance.cpp
index a6f6845e9ef..8ccee5d4e29 100644
--- a/mlir/lib/Analysis/Dominance.cpp
+++ b/mlir/lib/Analysis/Dominance.cpp
@@ -40,7 +40,7 @@ void DominanceInfoBase<IsPostDom>::recalculate(Function *function) {
dominanceInfos.clear();
// Build the top level function dominance.
- auto functionDominance = std::make_unique<base>();
+ auto functionDominance = llvm::make_unique<base>();
functionDominance->recalculate(function->getBody());
dominanceInfos.try_emplace(&function->getBody(),
std::move(functionDominance));
@@ -51,7 +51,7 @@ void DominanceInfoBase<IsPostDom>::recalculate(Function *function) {
// Don't compute dominance if the region is empty.
if (region.empty())
continue;
- auto opDominance = std::make_unique<base>();
+ auto opDominance = llvm::make_unique<base>();
opDominance->recalculate(region);
dominanceInfos.try_emplace(&region, std::move(opDominance));
}
diff --git a/mlir/lib/Analysis/MemRefDependenceCheck.cpp b/mlir/lib/Analysis/MemRefDependenceCheck.cpp
index 0c2a5defe10..87267183a5f 100644
--- a/mlir/lib/Analysis/MemRefDependenceCheck.cpp
+++ b/mlir/lib/Analysis/MemRefDependenceCheck.cpp
@@ -49,22 +49,22 @@ FunctionPassBase *mlir::createMemRefDependenceCheckPass() {
// Returns a result string which represents the direction vector (if there was
// a dependence), returns the string "false" otherwise.
-static string
+static std::string
getDirectionVectorStr(bool ret, unsigned numCommonLoops, unsigned loopNestDepth,
ArrayRef<DependenceComponent> dependenceComponents) {
if (!ret)
return "false";
if (dependenceComponents.empty() || loopNestDepth > numCommonLoops)
return "true";
- string result;
+ std::string result;
for (unsigned i = 0, e = dependenceComponents.size(); i < e; ++i) {
- string lbStr = "-inf";
+ std::string lbStr = "-inf";
if (dependenceComponents[i].lb.hasValue() &&
dependenceComponents[i].lb.getValue() !=
std::numeric_limits<int64_t>::min())
lbStr = std::to_string(dependenceComponents[i].lb.getValue());
- string ubStr = "+inf";
+ std::string ubStr = "+inf";
if (dependenceComponents[i].ub.hasValue() &&
dependenceComponents[i].ub.getValue() !=
std::numeric_limits<int64_t>::max())
diff --git a/mlir/lib/Analysis/Utils.cpp b/mlir/lib/Analysis/Utils.cpp
index 3399c7da88f..7d68b690a2e 100644
--- a/mlir/lib/Analysis/Utils.cpp
+++ b/mlir/lib/Analysis/Utils.cpp
@@ -700,7 +700,7 @@ static Optional<int64_t> getMemoryFootprintBytes(const Block &block,
}
// Compute the memref region symbolic in any IVs enclosing this block.
- auto region = std::make_unique<MemRefRegion>(opInst->getLoc());
+ auto region = llvm::make_unique<MemRefRegion>(opInst->getLoc());
if (failed(
region->compute(opInst,
/*loopDepth=*/getNestingDepth(*block.begin())))) {
diff --git a/mlir/lib/IR/AffineExprDetail.h b/mlir/lib/IR/AffineExprDetail.h
index 53172615a91..bca0957bcb8 100644
--- a/mlir/lib/IR/AffineExprDetail.h
+++ b/mlir/lib/IR/AffineExprDetail.h
@@ -42,6 +42,9 @@ struct AffineExprStorage {
/// A binary operation appearing in an affine expression.
struct AffineBinaryOpExprStorage : public AffineExprStorage {
+ AffineBinaryOpExprStorage(AffineExprStorage base, AffineExpr lhs,
+ AffineExpr rhs)
+ : AffineExprStorage(base), lhs(lhs), rhs(rhs) {}
static AffineExpr get(AffineExprKind kind, AffineExpr lhs, AffineExpr rhs);
AffineExpr lhs;
AffineExpr rhs;
@@ -49,18 +52,24 @@ struct AffineBinaryOpExprStorage : public AffineExprStorage {
/// A dimensional identifier appearing in an affine expression.
struct AffineDimExprStorage : public AffineExprStorage {
+ AffineDimExprStorage(AffineExprStorage base, unsigned position)
+ : AffineExprStorage(base), position(position) {}
/// Position of this identifier in the argument list.
unsigned position;
};
/// A symbolic identifier appearing in an affine expression.
struct AffineSymbolExprStorage : public AffineExprStorage {
+ AffineSymbolExprStorage(AffineExprStorage base, unsigned position)
+ : AffineExprStorage(base), position(position) {}
/// Position of this identifier in the symbol list.
unsigned position;
};
/// An integer constant appearing in affine expression.
struct AffineConstantExprStorage : public AffineExprStorage {
+ AffineConstantExprStorage(AffineExprStorage base, int64_t constant)
+ : AffineExprStorage(base), constant(constant) {}
// The constant.
int64_t constant;
};
diff --git a/mlir/lib/IR/AttributeDetail.h b/mlir/lib/IR/AttributeDetail.h
index 4a4d04370f9..e3f3df9dc81 100644
--- a/mlir/lib/IR/AttributeDetail.h
+++ b/mlir/lib/IR/AttributeDetail.h
@@ -44,6 +44,8 @@ struct AttributeStorage {
/// An attribute representing a boolean value.
struct BoolAttributeStorage : public AttributeStorage {
+ BoolAttributeStorage(AttributeStorage base, Type type, bool value)
+ : AttributeStorage(base), type(type), value(value) {}
const Type type;
bool value;
};
@@ -92,59 +94,85 @@ struct FloatAttributeStorage final
/// An attribute representing a string value.
struct StringAttributeStorage : public AttributeStorage {
+ StringAttributeStorage(AttributeStorage base, StringRef value)
+ : AttributeStorage(base), value(value) {}
StringRef value;
};
/// An attribute representing an array of other attributes.
struct ArrayAttributeStorage : public AttributeStorage {
+ ArrayAttributeStorage(AttributeStorage base, ArrayRef<Attribute> value)
+ : AttributeStorage(base), value(value) {}
ArrayRef<Attribute> value;
};
// An attribute representing a reference to an affine map.
struct AffineMapAttributeStorage : public AttributeStorage {
+ AffineMapAttributeStorage(AttributeStorage base, AffineMap value)
+ : AttributeStorage(base), value(value) {}
AffineMap value;
};
// An attribute representing a reference to an integer set.
struct IntegerSetAttributeStorage : public AttributeStorage {
+ IntegerSetAttributeStorage(AttributeStorage base, IntegerSet value)
+ : AttributeStorage(base), value(value) {}
IntegerSet value;
};
/// An attribute representing a reference to a type.
struct TypeAttributeStorage : public AttributeStorage {
+ TypeAttributeStorage(AttributeStorage base, Type value)
+ : AttributeStorage(base), value(value) {}
Type value;
};
/// An attribute representing a reference to a function.
struct FunctionAttributeStorage : public AttributeStorage {
+ FunctionAttributeStorage(AttributeStorage base, Function *value)
+ : AttributeStorage(base), value(value) {}
Function *value;
};
/// A base attribute representing a reference to a vector or tensor constant.
struct ElementsAttributeStorage : public AttributeStorage {
+ ElementsAttributeStorage(AttributeStorage base, VectorOrTensorType type)
+ : AttributeStorage(base), type(type) {}
VectorOrTensorType type;
};
/// An attribute representing a reference to a vector or tensor constant,
/// inwhich all elements have the same value.
struct SplatElementsAttributeStorage : public ElementsAttributeStorage {
+ SplatElementsAttributeStorage(ElementsAttributeStorage base, Attribute elt)
+ : ElementsAttributeStorage(base), elt(elt) {}
Attribute elt;
};
/// An attribute representing a reference to a dense vector or tensor object.
struct DenseElementsAttributeStorage : public ElementsAttributeStorage {
+ DenseElementsAttributeStorage(ElementsAttributeStorage base,
+ ArrayRef<char> data)
+ : ElementsAttributeStorage(base), data(data) {}
ArrayRef<char> data;
};
/// An attribute representing a reference to a tensor constant with opaque
/// content.
struct OpaqueElementsAttributeStorage : public ElementsAttributeStorage {
+ OpaqueElementsAttributeStorage(ElementsAttributeStorage base,
+ Dialect *dialect, StringRef bytes)
+ : ElementsAttributeStorage(base), dialect(dialect), bytes(bytes) {}
Dialect *dialect;
StringRef bytes;
};
/// An attribute representing a reference to a sparse vector or tensor object.
struct SparseElementsAttributeStorage : public ElementsAttributeStorage {
+ SparseElementsAttributeStorage(ElementsAttributeStorage base,
+ DenseIntElementsAttr indices,
+ DenseElementsAttr values)
+ : ElementsAttributeStorage(base), indices(indices), values(values) {}
DenseIntElementsAttr indices;
DenseElementsAttr values;
};
diff --git a/mlir/lib/StandardOps/Ops.cpp b/mlir/lib/StandardOps/Ops.cpp
index ea84a3360ae..49837e0211d 100644
--- a/mlir/lib/StandardOps/Ops.cpp
+++ b/mlir/lib/StandardOps/Ops.cpp
@@ -371,8 +371,8 @@ struct SimplifyDeadAlloc : public RewritePattern {
void AllocOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
- results.push_back(std::make_unique<SimplifyAllocConst>(context));
- results.push_back(std::make_unique<SimplifyDeadAlloc>(context));
+ results.push_back(llvm::make_unique<SimplifyAllocConst>(context));
+ results.push_back(llvm::make_unique<SimplifyDeadAlloc>(context));
}
//===----------------------------------------------------------------------===//
@@ -578,7 +578,7 @@ bool CallIndirectOp::verify() const {
void CallIndirectOp::getCanonicalizationPatterns(
OwningRewritePatternList &results, MLIRContext *context) {
results.push_back(
- std::make_unique<SimplifyIndirectCallWithKnownCallee>(context));
+ llvm::make_unique<SimplifyIndirectCallWithKnownCallee>(context));
}
//===----------------------------------------------------------------------===//
@@ -887,7 +887,7 @@ bool CondBranchOp::verify() const {
void CondBranchOp::getCanonicalizationPatterns(
OwningRewritePatternList &results, MLIRContext *context) {
- results.push_back(std::make_unique<SimplifyConstCondBranchPred>(context));
+ results.push_back(llvm::make_unique<SimplifyConstCondBranchPred>(context));
}
Block *CondBranchOp::getTrueDest() {
@@ -1143,8 +1143,8 @@ void DeallocOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
/// dealloc(memrefcast) -> dealloc
results.push_back(
- std::make_unique<MemRefCastFolder>(getOperationName(), context));
- results.push_back(std::make_unique<SimplifyDeadDealloc>(context));
+ llvm::make_unique<MemRefCastFolder>(getOperationName(), context));
+ results.push_back(llvm::make_unique<SimplifyDeadDealloc>(context));
}
//===----------------------------------------------------------------------===//
@@ -1424,7 +1424,7 @@ void DmaStartOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
/// dma_start(memrefcast) -> dma_start
results.push_back(
- std::make_unique<MemRefCastFolder>(getOperationName(), context));
+ llvm::make_unique<MemRefCastFolder>(getOperationName(), context));
}
// ---------------------------------------------------------------------------
@@ -1488,7 +1488,7 @@ void DmaWaitOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
/// dma_wait(memrefcast) -> dma_wait
results.push_back(
- std::make_unique<MemRefCastFolder>(getOperationName(), context));
+ llvm::make_unique<MemRefCastFolder>(getOperationName(), context));
}
//===----------------------------------------------------------------------===//
@@ -1643,7 +1643,7 @@ void LoadOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
/// load(memrefcast) -> load
results.push_back(
- std::make_unique<MemRefCastFolder>(getOperationName(), context));
+ llvm::make_unique<MemRefCastFolder>(getOperationName(), context));
}
//===----------------------------------------------------------------------===//
@@ -1964,7 +1964,7 @@ void StoreOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
/// store(memrefcast) -> store
results.push_back(
- std::make_unique<MemRefCastFolder>(getOperationName(), context));
+ llvm::make_unique<MemRefCastFolder>(getOperationName(), context));
}
//===----------------------------------------------------------------------===//
@@ -2013,7 +2013,7 @@ struct SimplifyXMinusX : public RewritePattern {
void SubIOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
- results.push_back(std::make_unique<SimplifyXMinusX>(context));
+ results.push_back(llvm::make_unique<SimplifyXMinusX>(context));
}
//===----------------------------------------------------------------------===//
diff --git a/mlir/lib/Transforms/CSE.cpp b/mlir/lib/Transforms/CSE.cpp
index 02fbda0f680..31f4d48e4ed 100644
--- a/mlir/lib/Transforms/CSE.cpp
+++ b/mlir/lib/Transforms/CSE.cpp
@@ -197,7 +197,7 @@ void CSE::simplifyRegion(DominanceInfo &domInfo, Region &region) {
std::deque<std::unique_ptr<CFGStackNode>> stack;
// Process the nodes of the dom tree for this region.
- stack.emplace_back(std::make_unique<CFGStackNode>(
+ stack.emplace_back(llvm::make_unique<CFGStackNode>(
knownValues, domInfo.getRootNode(&region)));
while (!stack.empty()) {
@@ -213,7 +213,7 @@ void CSE::simplifyRegion(DominanceInfo &domInfo, Region &region) {
if (currentNode->childIterator != currentNode->node->end()) {
auto *childNode = *(currentNode->childIterator++);
stack.emplace_back(
- std::make_unique<CFGStackNode>(knownValues, childNode));
+ llvm::make_unique<CFGStackNode>(knownValues, childNode));
} else {
// Finally, if the node and all of its children have been processed
// then we delete the node.
diff --git a/mlir/lib/Transforms/DmaGeneration.cpp b/mlir/lib/Transforms/DmaGeneration.cpp
index 43c709fa3ab..23e07fc3a89 100644
--- a/mlir/lib/Transforms/DmaGeneration.cpp
+++ b/mlir/lib/Transforms/DmaGeneration.cpp
@@ -618,7 +618,7 @@ uint64_t DmaGeneration::runOnBlock(Block::iterator begin, Block::iterator end) {
}
// Compute the MemRefRegion accessed.
- auto region = std::make_unique<MemRefRegion>(opInst->getLoc());
+ auto region = llvm::make_unique<MemRefRegion>(opInst->getLoc());
if (failed(region->compute(opInst, dmaDepth))) {
LLVM_DEBUG(llvm::dbgs()
<< "Error obtaining memory region: semi-affine maps?\n");
diff --git a/mlir/lib/Transforms/LoopFusion.cpp b/mlir/lib/Transforms/LoopFusion.cpp
index 12e52eaf4d3..6d4ea7206b7 100644
--- a/mlir/lib/Transforms/LoopFusion.cpp
+++ b/mlir/lib/Transforms/LoopFusion.cpp
@@ -39,6 +39,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <iomanip>
+#include <sstream>
#define DEBUG_TYPE "loop-fusion"
diff --git a/mlir/lib/Transforms/LoopTiling.cpp b/mlir/lib/Transforms/LoopTiling.cpp
index 1a4b368c4c6..76ab91641f3 100644
--- a/mlir/lib/Transforms/LoopTiling.cpp
+++ b/mlir/lib/Transforms/LoopTiling.cpp
@@ -32,6 +32,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include <iomanip>
+#include <sstream>
using namespace mlir;
diff --git a/mlir/lib/Transforms/Utils/Utils.cpp b/mlir/lib/Transforms/Utils/Utils.cpp
index 8a21f273006..cbf68056eb9 100644
--- a/mlir/lib/Transforms/Utils/Utils.cpp
+++ b/mlir/lib/Transforms/Utils/Utils.cpp
@@ -69,11 +69,11 @@ bool mlir::replaceAllMemRefUsesWith(const Value *oldMemRef, Value *newMemRef,
std::unique_ptr<DominanceInfo> domInfo;
std::unique_ptr<PostDominanceInfo> postDomInfo;
if (domInstFilter)
- domInfo = std::make_unique<DominanceInfo>(domInstFilter->getFunction());
+ domInfo = llvm::make_unique<DominanceInfo>(domInstFilter->getFunction());
if (postDomInstFilter)
postDomInfo =
- std::make_unique<PostDominanceInfo>(postDomInstFilter->getFunction());
+ llvm::make_unique<PostDominanceInfo>(postDomInstFilter->getFunction());
// The ops where memref replacement succeeds are replaced with new ones.
SmallVector<Instruction *, 8> opsToErase;
diff --git a/mlir/test/mlir-tblgen/one-op-one-result.td b/mlir/test/mlir-tblgen/one-op-one-result.td
index 7dc37b58946..324ccf7bb2c 100644
--- a/mlir/test/mlir-tblgen/one-op-one-result.td
+++ b/mlir/test/mlir-tblgen/one-op-one-result.td
@@ -28,4 +28,4 @@ def : Pat<(X_AddOp (X_AddOp:$res $lhs, $rhs), $rrhs), (Y_AddOp $lhs, U:$rhs, T_C
// CHECK: PatternRewriter &rewriter)
// CHECK: rewriter.create<Y::AddOp>(loc, op->getResult(0)->getType()
// CHECK: void populateWithGenerated
-// CHECK: patterns->push_back(std::make_unique<GeneratedConvert0>(context))
+// CHECK: patterns->push_back(llvm::make_unique<GeneratedConvert0>(context))
diff --git a/mlir/test/mlir-tblgen/pattern-tAttr.td b/mlir/test/mlir-tblgen/pattern-tAttr.td
index 017a676fb52..15dbd69d319 100644
--- a/mlir/test/mlir-tblgen/pattern-tAttr.td
+++ b/mlir/test/mlir-tblgen/pattern-tAttr.td
@@ -48,5 +48,5 @@ def : Pat<(Z_AddOp $lhs, $rhs, $attr1, $attr2), (Y_AddOp $lhs, $rhs, (T_Compose_
// CHECK-NEXT: rewriter.replaceOp(op, {vAddOp0});
// CHECK: void populateWithGenerated
-// CHECK: patterns->push_back(std::make_unique<GeneratedConvert0>(context))
-// CHECK: patterns->push_back(std::make_unique<GeneratedConvert1>(context))
+// CHECK: patterns->push_back(llvm::make_unique<GeneratedConvert0>(context))
+// CHECK: patterns->push_back(llvm::make_unique<GeneratedConvert1>(context))
diff --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp
index 88d0b4d2128..6a7af8005a8 100644
--- a/mlir/tools/mlir-tblgen/RewriterGen.cpp
+++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp
@@ -279,7 +279,7 @@ void PatternEmitter::emitMatchMethod(DagNode tree) {
os << R"(
PatternMatchResult match(Instruction *op0) const override {
auto ctx = op0->getContext(); (void)ctx;
- auto state = std::make_unique<MatchedState>();)"
+ auto state = llvm::make_unique<MatchedState>();)"
<< "\n";
// The rewrite pattern may specify that certain outputs should be unused in
@@ -660,7 +660,7 @@ static void emitRewriters(const RecordKeeper &recordKeeper, raw_ostream &os) {
os << "void populateWithGenerated(MLIRContext *context, "
<< "OwningRewritePatternList *patterns) {\n";
for (unsigned i = 0; i != rewritePatternCount; ++i) {
- os.indent(2) << "patterns->push_back(std::make_unique<" << baseRewriteName
+ os.indent(2) << "patterns->push_back(llvm::make_unique<" << baseRewriteName
<< i << ">(context));\n";
}
os << "}\n";
OpenPOWER on IntegriCloud