[Mlir-commits] [mlir] 4efb775 - [mlir][NFC] Add a using directive for llvm::SetVector
River Riddle
llvmlistbot at llvm.org
Thu Apr 15 16:16:18 PDT 2021
Author: River Riddle
Date: 2021-04-15T16:09:34-07:00
New Revision: 4efb7754e021a1eeccaecdb7211690628bf93363
URL: https://github.com/llvm/llvm-project/commit/4efb7754e021a1eeccaecdb7211690628bf93363
DIFF: https://github.com/llvm/llvm-project/commit/4efb7754e021a1eeccaecdb7211690628bf93363.diff
LOG: [mlir][NFC] Add a using directive for llvm::SetVector
Differential Revision: https://reviews.llvm.org/D100436
Added:
Modified:
mlir/include/mlir/Analysis/CallGraph.h
mlir/include/mlir/Analysis/SliceAnalysis.h
mlir/include/mlir/IR/SymbolTable.h
mlir/include/mlir/Support/LLVM.h
mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
mlir/include/mlir/Transforms/RegionUtils.h
mlir/lib/Analysis/Liveness.cpp
mlir/lib/Analysis/SliceAnalysis.cpp
mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
mlir/lib/Dialect/SCF/Transforms/Utils.cpp
mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp
mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
mlir/lib/Dialect/SPIRV/Transforms/UpdateVCEPass.cpp
mlir/lib/Dialect/Vector/VectorUtils.cpp
mlir/lib/IR/SymbolTable.cpp
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
mlir/lib/Target/SPIRV/Deserialization/Deserializer.h
mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
mlir/lib/Target/SPIRV/Serialization/Serializer.h
mlir/lib/Transforms/LoopFusion.cpp
mlir/lib/Transforms/Utils/DialectConversion.cpp
mlir/lib/Transforms/Utils/LoopUtils.cpp
mlir/lib/Transforms/Utils/RegionUtils.cpp
mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
mlir/test/lib/Dialect/Test/TestTypes.cpp
mlir/test/lib/IR/TestSlicing.cpp
mlir/test/lib/Transforms/TestLinalgElementwiseFusion.cpp
mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Analysis/CallGraph.h b/mlir/include/mlir/Analysis/CallGraph.h
index ef751bf58289..c2b6717e6b7f 100644
--- a/mlir/include/mlir/Analysis/CallGraph.h
+++ b/mlir/include/mlir/Analysis/CallGraph.h
@@ -139,8 +139,8 @@ class CallGraphNode {
Region *callableRegion;
/// A set of out-going edges from this node to other nodes in the graph.
- llvm::SetVector<Edge, SmallVector<Edge, 4>,
- llvm::SmallDenseSet<Edge, 4, EdgeKeyInfo>>
+ SetVector<Edge, SmallVector<Edge, 4>,
+ llvm::SmallDenseSet<Edge, 4, EdgeKeyInfo>>
edges;
// Provide access to private methods.
diff --git a/mlir/include/mlir/Analysis/SliceAnalysis.h b/mlir/include/mlir/Analysis/SliceAnalysis.h
index f418684b6319..9d276c2987f8 100644
--- a/mlir/include/mlir/Analysis/SliceAnalysis.h
+++ b/mlir/include/mlir/Analysis/SliceAnalysis.h
@@ -68,12 +68,12 @@ using TransitiveFilter = llvm::function_ref<bool(Operation *)>;
/// 2. reversing the result of 1. gives:
/// {4, 3, 6, 2, 1, 5, 8, 7, 9}
///
-void getForwardSlice(Operation *op, llvm::SetVector<Operation *> *forwardSlice,
+void getForwardSlice(Operation *op, SetVector<Operation *> *forwardSlice,
TransitiveFilter filter = nullptr /* pass-through*/);
/// Value-rooted version of `getForwardSlice`. Return the union of all forward
/// slices for the uses of the value `root`.
-void getForwardSlice(Value root, llvm::SetVector<Operation *> *forwardSlice,
+void getForwardSlice(Value root, SetVector<Operation *> *forwardSlice,
TransitiveFilter filter = nullptr /* pass-through*/);
/// Fills `backwardSlice` with the computed backward slice (i.e.
@@ -110,17 +110,16 @@ void getForwardSlice(Value root, llvm::SetVector<Operation *> *forwardSlice,
/// Assuming all local orders match the numbering order:
/// {1, 2, 5, 3, 4, 6}
///
-void getBackwardSlice(Operation *op,
- llvm::SetVector<Operation *> *backwardSlice,
+void getBackwardSlice(Operation *op, SetVector<Operation *> *backwardSlice,
TransitiveFilter filter = nullptr /* pass-through*/);
/// Value-rooted version of `getBackwardSlice`. Return the union of all backward
/// slices for the op defining or owning the value `root`.
-void getBackwardSlice(Value root, llvm::SetVector<Operation *> *backwardSlice,
+void getBackwardSlice(Value root, SetVector<Operation *> *backwardSlice,
TransitiveFilter filter = nullptr /* pass-through*/);
/// Iteratively computes backward slices and forward slices until
-/// a fixed point is reached. Returns an `llvm::SetVector<Operation *>` which
+/// a fixed point is reached. Returns an `SetVector<Operation *>` which
/// **includes** the original operation.
///
/// This allows building a slice (i.e. multi-root DAG where everything
@@ -196,7 +195,7 @@ void getBackwardSlice(Value root, llvm::SetVector<Operation *> *backwardSlice,
/// and keep things ordered but this is still hand-wavy and not worth the
/// trouble for now: punt to a simple worklist-based solution.
///
-llvm::SetVector<Operation *>
+SetVector<Operation *>
getSlice(Operation *op,
TransitiveFilter backwardFilter = nullptr /* pass-through*/,
TransitiveFilter forwardFilter = nullptr /* pass-through*/);
@@ -204,8 +203,7 @@ getSlice(Operation *op,
/// Multi-root DAG topological sort.
/// Performs a topological sort of the Operation in the `toSort` SetVector.
/// Returns a topologically sorted SetVector.
-llvm::SetVector<Operation *>
-topologicalSort(const llvm::SetVector<Operation *> &toSort);
+SetVector<Operation *> topologicalSort(const SetVector<Operation *> &toSort);
} // end namespace mlir
diff --git a/mlir/include/mlir/IR/SymbolTable.h b/mlir/include/mlir/IR/SymbolTable.h
index e0d626cd9dc4..0e123ad8ad74 100644
--- a/mlir/include/mlir/IR/SymbolTable.h
+++ b/mlir/include/mlir/IR/SymbolTable.h
@@ -295,7 +295,7 @@ class SymbolUserMap {
SymbolTableCollection &symbolTable;
/// A map of symbol operations to symbol users.
- DenseMap<Operation *, llvm::SetVector<Operation *>> symbolToUsers;
+ DenseMap<Operation *, SetVector<Operation *>> symbolToUsers;
};
//===----------------------------------------------------------------------===//
@@ -334,8 +334,7 @@ class SymbolTable : public TraitBase<ConcreteType, SymbolTable> {
Operation *lookupSymbol(SymbolRefAttr symbol) {
return mlir::SymbolTable::lookupSymbolIn(this->getOperation(), symbol);
}
- template <typename T>
- T lookupSymbol(SymbolRefAttr symbol) {
+ template <typename T> T lookupSymbol(SymbolRefAttr symbol) {
return dyn_cast_or_null<T>(lookupSymbol(symbol));
}
};
diff --git a/mlir/include/mlir/Support/LLVM.h b/mlir/include/mlir/Support/LLVM.h
index ced7a7a35363..0683e4d55593 100644
--- a/mlir/include/mlir/Support/LLVM.h
+++ b/mlir/include/mlir/Support/LLVM.h
@@ -22,6 +22,7 @@
// declared, and are effectively language features.
#include "llvm/ADT/None.h"
#include "llvm/Support/Casting.h"
+#include <vector>
// Workaround for clang-5 (PR41549)
#if defined(__clang_major__)
@@ -33,8 +34,7 @@
// Forward declarations.
namespace llvm {
// String types
-template <unsigned N>
-class SmallString;
+template <unsigned N> class SmallString;
class StringRef;
class StringLiteral;
class Twine;
@@ -46,41 +46,27 @@ template <typename KeyT, typename ValueT> struct DenseMapPair;
} // namespace detail
template <typename KeyT, typename ValueT, typename KeyInfoT, typename BucketT>
class DenseMap;
-template <typename T>
-struct DenseMapInfo;
-template <typename ValueT, typename ValueInfoT>
-class DenseSet;
+template <typename T> struct DenseMapInfo;
+template <typename ValueT, typename ValueInfoT> class DenseSet;
class MallocAllocator;
-template <typename T>
-class MutableArrayRef;
-template <typename T>
-class Optional;
-template <typename... PT>
-class PointerUnion;
-template <typename T, unsigned N>
-class SmallPtrSet;
-template <typename T>
-class SmallPtrSetImpl;
-template <typename T, unsigned N>
-class SmallVector;
-template <typename T>
-class SmallVectorImpl;
-template <typename AllocatorTy>
-class StringSet;
-template <typename T, typename R>
-class StringSwitch;
-template <typename T>
-class TinyPtrVector;
-template <typename T, typename ResultT>
-class TypeSwitch;
+template <typename T> class MutableArrayRef;
+template <typename T> class Optional;
+template <typename... PT> class PointerUnion;
+template <typename T, typename Vector, typename Set> class SetVector;
+template <typename T, unsigned N> class SmallPtrSet;
+template <typename T> class SmallPtrSetImpl;
+template <typename T, unsigned N> class SmallVector;
+template <typename T> class SmallVectorImpl;
+template <typename AllocatorTy> class StringSet;
+template <typename T, typename R> class StringSwitch;
+template <typename T> class TinyPtrVector;
+template <typename T, typename ResultT> class TypeSwitch;
// Other common classes.
class APInt;
class APFloat;
-template <typename Fn>
-class function_ref;
-template <typename IteratorT>
-class iterator_range;
+template <typename Fn> class function_ref;
+template <typename IteratorT> class iterator_range;
class raw_ostream;
} // end namespace llvm
@@ -110,6 +96,9 @@ template <typename KeyT, typename ValueT,
using DenseMap = llvm::DenseMap<KeyT, ValueT, KeyInfoT, BucketT>;
template <typename ValueT, typename ValueInfoT = DenseMapInfo<ValueT>>
using DenseSet = llvm::DenseSet<ValueT, ValueInfoT>;
+template <typename T, typename Vector = std::vector<T>,
+ typename Set = DenseSet<T>>
+using SetVector = llvm::SetVector<T, Vector, Set>;
template <typename AllocatorTy = llvm::MallocAllocator>
using StringSet = llvm::StringSet<AllocatorTy>;
using llvm::MutableArrayRef;
@@ -129,8 +118,7 @@ using TypeSwitch = llvm::TypeSwitch<T, ResultT>;
// Other common classes.
using llvm::APFloat;
using llvm::APInt;
-template <typename Fn>
-using function_ref = llvm::function_ref<Fn>;
+template <typename Fn> using function_ref = llvm::function_ref<Fn>;
using llvm::iterator_range;
using llvm::raw_ostream;
} // namespace mlir
diff --git a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
index e046ada3b004..c6ceecd2b3dd 100644
--- a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
+++ b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
@@ -242,7 +242,7 @@ namespace detail {
void connectPHINodes(Region ®ion, const ModuleTranslation &state);
/// Get a topologically sorted list of blocks of the given region.
-llvm::SetVector<Block *> getTopologicallySortedBlocks(Region ®ion);
+SetVector<Block *> getTopologicallySortedBlocks(Region ®ion);
/// Create an LLVM IR constant of `llvmType` from the MLIR attribute `attr`.
/// This currently supports integer, floating point, splat and dense element
diff --git a/mlir/include/mlir/Transforms/RegionUtils.h b/mlir/include/mlir/Transforms/RegionUtils.h
index c2124d8b70f0..c87f943614e2 100644
--- a/mlir/include/mlir/Transforms/RegionUtils.h
+++ b/mlir/include/mlir/Transforms/RegionUtils.h
@@ -44,12 +44,12 @@ void visitUsedValuesDefinedAbove(MutableArrayRef<Region> regions,
/// Fill `values` with a list of values defined at the ancestors of the `limit`
/// region and used within `region` or its descendants.
void getUsedValuesDefinedAbove(Region ®ion, Region &limit,
- llvm::SetVector<Value> &values);
+ SetVector<Value> &values);
/// Fill `values` with a list of values used within any of the regions provided
/// but defined in one of the ancestors.
void getUsedValuesDefinedAbove(MutableArrayRef<Region> regions,
- llvm::SetVector<Value> &values);
+ SetVector<Value> &values);
/// Run a set of structural simplifications over the given regions. This
/// includes transformations like unreachable block elimination, dead argument
diff --git a/mlir/lib/Analysis/Liveness.cpp b/mlir/lib/Analysis/Liveness.cpp
index c9558a7d502c..1c26db1df8df 100644
--- a/mlir/lib/Analysis/Liveness.cpp
+++ b/mlir/lib/Analysis/Liveness.cpp
@@ -128,7 +128,7 @@ struct BlockInfoBuilder {
/// Builds the internal liveness block mapping.
static void buildBlockMapping(Operation *operation,
DenseMap<Block *, BlockInfoBuilder> &builders) {
- llvm::SetVector<Block *> toProcess;
+ SetVector<Block *> toProcess;
operation->walk<WalkOrder::PreOrder>([&](Block *block) {
BlockInfoBuilder &builder =
diff --git a/mlir/lib/Analysis/SliceAnalysis.cpp b/mlir/lib/Analysis/SliceAnalysis.cpp
index 47d12582c10c..157834cbf701 100644
--- a/mlir/lib/Analysis/SliceAnalysis.cpp
+++ b/mlir/lib/Analysis/SliceAnalysis.cpp
@@ -25,8 +25,6 @@
using namespace mlir;
-using llvm::SetVector;
-
static void getForwardSliceImpl(Operation *op,
SetVector<Operation *> *forwardSlice,
TransitiveFilter filter) {
diff --git a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
index 57a0885c03c8..abeaa2064628 100644
--- a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
+++ b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
@@ -131,7 +131,7 @@ struct PatternLowering {
/// The set of operation values whose whose location will be used for newly
/// generated operations.
- llvm::SetVector<Value> locOps;
+ SetVector<Value> locOps;
};
} // end anonymous namespace
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
index 268c603c6446..97c953eeb8c0 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
@@ -182,8 +182,8 @@ outlineExecuteOp(SymbolTable &symbolTable, ExecuteOp execute) {
Location loc = execute.getLoc();
// Collect all outlined function inputs.
- llvm::SetVector<mlir::Value> functionInputs(execute.dependencies().begin(),
- execute.dependencies().end());
+ SetVector<mlir::Value> functionInputs(execute.dependencies().begin(),
+ execute.dependencies().end());
functionInputs.insert(execute.operands().begin(), execute.operands().end());
getUsedValuesDefinedAbove(execute.body(), functionInputs);
diff --git a/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp b/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
index 98b22a8a6d92..35fce506b662 100644
--- a/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
@@ -74,9 +74,8 @@ static bool isSinkingBeneficiary(Operation *op) {
/// is updated with results that will be available after sinking the identified
/// ops.
static bool
-extractBeneficiaryOps(Operation *op,
- llvm::SetVector<Value> existingDependencies,
- llvm::SetVector<Operation *> &beneficiaryOps,
+extractBeneficiaryOps(Operation *op, SetVector<Value> existingDependencies,
+ SetVector<Operation *> &beneficiaryOps,
llvm::SmallPtrSetImpl<Value> &availableValues) {
if (beneficiaryOps.count(op))
return true;
@@ -109,10 +108,10 @@ LogicalResult mlir::sinkOperationsIntoLaunchOp(gpu::LaunchOp launchOp) {
// Identify uses from values defined outside of the scope of the launch
// operation.
- llvm::SetVector<Value> sinkCandidates;
+ SetVector<Value> sinkCandidates;
getUsedValuesDefinedAbove(launchOpBody, sinkCandidates);
- llvm::SetVector<Operation *> toBeSunk;
+ SetVector<Operation *> toBeSunk;
llvm::SmallPtrSet<Value, 4> availableValues;
for (Value operand : sinkCandidates) {
Operation *operandOp = operand.getDefiningOp();
@@ -138,7 +137,7 @@ LogicalResult mlir::sinkOperationsIntoLaunchOp(gpu::LaunchOp launchOp) {
/// `gpu.terminator` operations by `gpu.return` in the generated function.
static gpu::GPUFuncOp outlineKernelFuncImpl(gpu::LaunchOp launchOp,
StringRef kernelFnName,
- llvm::SetVector<Value> &operands) {
+ SetVector<Value> &operands) {
Location loc = launchOp.getLoc();
// Create a builder with no insertion point, insertion will happen separately
// due to symbol table manipulation.
@@ -200,7 +199,7 @@ gpu::GPUFuncOp mlir::outlineKernelFunc(gpu::LaunchOp launchOp,
llvm::SmallVectorImpl<Value> &operands) {
DenseSet<Value> inputOperandSet;
inputOperandSet.insert(operands.begin(), operands.end());
- llvm::SetVector<Value> operandSet(operands.begin(), operands.end());
+ SetVector<Value> operandSet(operands.begin(), operands.end());
auto funcOp = outlineKernelFuncImpl(launchOp, kernelFnName, operandSet);
for (auto operand : operandSet) {
if (!inputOperandSet.count(operand))
@@ -242,7 +241,7 @@ class GpuKernelOutliningPass
// Insert just after the function.
Block::iterator insertPt(func->getNextNode());
auto funcWalkResult = func.walk([&](gpu::LaunchOp op) {
- llvm::SetVector<Value> operands;
+ SetVector<Value> operands;
std::string kernelFnName =
Twine(op->getParentOfType<FuncOp>().getName(), "_kernel").str();
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
index 921926692a99..a203a3fcd385 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
@@ -59,7 +59,7 @@ static void printStructType(DialectAsmPrinter &printer, LLVMStructType type) {
// dispatch. We maintain the invariant of this storage being modified
// exclusively in this function, and at most one name being added per call.
// TODO: consider having such functionality inside DialectAsmPrinter.
- thread_local llvm::SetVector<StringRef> knownStructNames;
+ thread_local SetVector<StringRef> knownStructNames;
unsigned stackSize = knownStructNames.size();
(void)stackSize;
auto guard = llvm::make_scope_exit([&]() {
@@ -323,7 +323,7 @@ static LLVMStructType parseStructType(DialectAsmParser &parser) {
// dispatch. We maintain the invariant of this storage being modified
// exclusively in this function, and at most one name being added per call.
// TODO: consider having such functionality inside DialectAsmParser.
- thread_local llvm::SetVector<StringRef> knownStructNames;
+ thread_local SetVector<StringRef> knownStructNames;
unsigned stackSize = knownStructNames.size();
(void)stackSize;
auto guard = llvm::make_scope_exit([&]() {
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp b/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
index b4a2182cf23a..c9cdcde382a5 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
@@ -412,7 +412,7 @@ void mlir::linalg::hoistRedundantVectorTransfers(FuncOp func) {
LLVM_DEBUG(DBGS() << "Candidate read: " << *transferRead.getOperation()
<< "\n");
- llvm::SetVector<Operation *> forwardSlice;
+ SetVector<Operation *> forwardSlice;
getForwardSlice(transferRead.getOperation(), &forwardSlice);
// Look for the last TransferWriteOp in the forwardSlice of
@@ -510,7 +510,7 @@ void mlir::linalg::hoistRedundantVectorTransfers(FuncOp func) {
template <typename... OpTypeList>
static bool backwardsSliceOnlyHasOpsOfType(scf::ForOp outerLimit, Value v) {
// Compute a backward slice up to, but not including, `outerLimit`.
- llvm::SetVector<Operation *> backwardSlice;
+ SetVector<Operation *> backwardSlice;
getBackwardSlice(v, &backwardSlice, [&](Operation *op) {
return outerLimit->isProperAncestor(op);
});
@@ -557,7 +557,7 @@ static Value computeLoopIndependentUpperBound(OpBuilder &b, scf::ForOp outer,
(void)ok;
// Compute a backward slice up to, but not including, `outer`.
- llvm::SetVector<Operation *> backwardSlice;
+ SetVector<Operation *> backwardSlice;
getBackwardSlice(v, &backwardSlice,
[&](Operation *op) { return outer->isProperAncestor(op); });
backwardSlice.insert(v.getDefiningOp());
@@ -655,8 +655,8 @@ static Value buildLoopIterationCount(OpBuilder &b, scf::ForOp outer,
/// dimensions of reuse.
static LogicalResult
hoistPaddingOnTensorsPrerequisites(linalg::PadTensorOp padTensorOp, int nLevels,
- llvm::SetVector<Operation *> &backwardSlice,
- llvm::SetVector<Operation *> &packingLoops,
+ SetVector<Operation *> &backwardSlice,
+ SetVector<Operation *> &packingLoops,
SmallVector<Value> &dynamicTensorSizes) {
// Bail on any use that isn't an input of a Linalg op.
// Hoisting of inplace updates happens after vectorization.
@@ -746,7 +746,7 @@ hoistPaddingOnTensorsPrerequisites(linalg::PadTensorOp padTensorOp, int nLevels,
LogicalResult mlir::linalg::hoistPaddingOnTensors(PadTensorOp &padTensorOp,
unsigned nLoops) {
SmallVector<Value> dynamicTensorSizes;
- llvm::SetVector<Operation *> backwardSlice, packingLoops;
+ SetVector<Operation *> backwardSlice, packingLoops;
if (failed(hoistPaddingOnTensorsPrerequisites(padTensorOp, nLoops,
backwardSlice, packingLoops,
dynamicTensorSizes)))
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Loops.cpp b/mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
index bb1000a51c35..c85f4a9abd38 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
@@ -223,14 +223,12 @@ namespace {
/// The padding value for a given Op depends on the semantics of the Op.
/// The identity value for ConvOp and PoolingSumOp is 0, for PoolingMaxOp is
/// -inf or minInt and for PoolingMinOp is inf or maxInt.
-template <typename OpType>
-Attribute getPadValueAttr(Type type) {
+template <typename OpType> Attribute getPadValueAttr(Type type) {
llvm_unreachable("Unexpected op type for getPadValueAttr");
return {};
}
-template <>
-Attribute getPadValueAttr<PoolingMaxOp>(Type type) {
+template <> Attribute getPadValueAttr<PoolingMaxOp>(Type type) {
auto &b = ScopedContext::getBuilderRef();
if (auto floatType = type.dyn_cast<FloatType>()) {
return b.getFloatAttr(
@@ -248,8 +246,7 @@ Attribute getPadValueAttr<PoolingMaxOp>(Type type) {
return {};
}
-template <>
-Attribute getPadValueAttr<PoolingMinOp>(Type type) {
+template <> Attribute getPadValueAttr<PoolingMinOp>(Type type) {
auto &b = ScopedContext::getBuilderRef();
if (auto floatType = type.dyn_cast<FloatType>()) {
return b.getFloatAttr(floatType,
@@ -266,14 +263,12 @@ Attribute getPadValueAttr<PoolingMinOp>(Type type) {
return {};
}
-template <>
-Attribute getPadValueAttr<PoolingSumOp>(Type type) {
+template <> Attribute getPadValueAttr<PoolingSumOp>(Type type) {
auto &b = ScopedContext::getBuilderRef();
return b.getZeroAttr(type);
}
-template <>
-Attribute getPadValueAttr<ConvOp>(Type type) {
+template <> Attribute getPadValueAttr<ConvOp>(Type type) {
auto &b = ScopedContext::getBuilderRef();
return b.getZeroAttr(type);
}
@@ -324,8 +319,7 @@ static void emitScalarImplementation(ArrayRef<Value> allIvs, ConvOp convOp) {
}
}
-template <typename PoolingOp>
-static bool hasPadding(PoolingOp poolingOp) {
+template <typename PoolingOp> static bool hasPadding(PoolingOp poolingOp) {
for (unsigned i = 0, e = poolingOp.getNumWindowLoops(); i < e; ++i) {
if (poolingOp.getLowPad(i) > 0 || poolingOp.getHighPad(i) > 0)
return true;
@@ -501,7 +495,7 @@ linalgOpToLoopsImpl(Operation *op, OpBuilder &builder,
});
// Number of loop ops might be
diff erent from the number of ivs since some
// loops like affine.parallel and scf.parallel have multiple ivs.
- llvm::SetVector<Operation *> loopSet;
+ SetVector<Operation *> loopSet;
for (Value iv : allIvs) {
if (!iv)
return {};
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
index ccb4b0e3baa4..10e96d2b0407 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
@@ -206,7 +206,7 @@ static LogicalResult rewriteAsPaddedOp(PatternRewriter &rewriter,
// This later folds away.
SmallVector<Value> paddedSubviewResults;
paddedSubviewResults.reserve(opToPad->getNumResults());
- llvm::SetVector<Operation *> newUsersOfOpToPad;
+ SetVector<Operation *> newUsersOfOpToPad;
for (auto it : llvm::zip(opToPad->getResults(), paddedOp->getResults())) {
auto rank = std::get<0>(it).getType().cast<RankedTensorType>().getRank();
SmallVector<OpFoldResult> offsets(rank, rewriter.getIndexAttr(0));
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
index e2c069ea7f47..c14a3b3628ba 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
@@ -40,8 +40,7 @@ using llvm::dbgs;
/// Return the unique instance of OpType in `block` if it is indeed unique.
/// Return null if none or more than 1 instances exist.
-template <typename OpType>
-static OpType getSingleOpOfType(Block &block) {
+template <typename OpType> static OpType getSingleOpOfType(Block &block) {
OpType res;
block.walk([&](OpType op) {
if (res) {
@@ -307,7 +306,7 @@ LogicalResult vectorizeAsLinalgGeneric(
BlockAndValueMapping bvm;
// 2. Values defined above the region can only be broadcast for now. Make them
// map to themselves.
- llvm::SetVector<Value> valuesSet;
+ SetVector<Value> valuesSet;
mlir::getUsedValuesDefinedAbove(linalgOp->getRegion(0), valuesSet);
bvm.map(valuesSet.getArrayRef(), valuesSet.getArrayRef());
diff --git a/mlir/lib/Dialect/SCF/Transforms/Utils.cpp b/mlir/lib/Dialect/SCF/Transforms/Utils.cpp
index 7d0e25c1e555..00fa22be754f 100644
--- a/mlir/lib/Dialect/SCF/Transforms/Utils.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/Utils.cpp
@@ -91,7 +91,7 @@ void mlir::outlineIfOp(OpBuilder &b, scf::IfOp ifOp, FuncOp *thenFn,
OpBuilder::InsertionGuard g(b);
b.setInsertionPoint(ifOp->getParentOfType<FuncOp>());
- llvm::SetVector<Value> captures;
+ SetVector<Value> captures;
getUsedValuesDefinedAbove(ifOrElseRegion, captures);
ValueRange values(captures.getArrayRef());
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
index 81b3ee5e525f..7da2d5ab9f2c 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
@@ -481,8 +481,7 @@ namespace {
// parseAndVerify does the actual parsing and verification of individual
// elements. This is a functor since parsing the last element of the list
// (termination condition) needs partial specialization.
-template <typename ParseType, typename... Args>
-struct ParseCommaSeparatedList {
+template <typename ParseType, typename... Args> struct ParseCommaSeparatedList {
Optional<std::tuple<ParseType, Args...>>
operator()(SPIRVDialect const &dialect, DialectAsmParser &parser) const {
auto parseVal = parseAndVerify<ParseType>(dialect, parser);
@@ -502,8 +501,7 @@ struct ParseCommaSeparatedList {
// Partial specialization of the function to parse a comma separated list of
// specs to parse the last element of the list.
-template <typename ParseType>
-struct ParseCommaSeparatedList<ParseType> {
+template <typename ParseType> struct ParseCommaSeparatedList<ParseType> {
Optional<std::tuple<ParseType>> operator()(SPIRVDialect const &dialect,
DialectAsmParser &parser) const {
if (auto value = parseAndVerify<ParseType>(dialect, parser))
@@ -636,15 +634,15 @@ static Type parseStructType(SPIRVDialect const &dialect,
//
// Note: This has to be thread_local to enable multiple threads to safely
// parse concurrently.
- thread_local llvm::SetVector<StringRef> structContext;
+ thread_local SetVector<StringRef> structContext;
- static auto removeIdentifierAndFail =
- [](llvm::SetVector<StringRef> &structContext, StringRef identifier) {
- if (!identifier.empty())
- structContext.remove(identifier);
+ static auto removeIdentifierAndFail = [](SetVector<StringRef> &structContext,
+ StringRef identifier) {
+ if (!identifier.empty())
+ structContext.remove(identifier);
- return Type();
- };
+ return Type();
+ };
if (parser.parseLess())
return Type();
@@ -801,7 +799,7 @@ static void print(SampledImageType type, DialectAsmPrinter &os) {
}
static void print(StructType type, DialectAsmPrinter &os) {
- thread_local llvm::SetVector<StringRef> structContext;
+ thread_local SetVector<StringRef> structContext;
os << "struct<";
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp
index a8519063a818..0562d42cfca4 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp
@@ -83,7 +83,7 @@ ArrayRef<spirv::Extension> spirv::getImpliedExtensions(spirv::Version version) {
SmallVector<spirv::Capability, 0>
spirv::getRecursiveImpliedCapabilities(spirv::Capability cap) {
ArrayRef<spirv::Capability> directCaps = getDirectImpliedCapabilities(cap);
- llvm::SetVector<spirv::Capability, SmallVector<spirv::Capability, 0>> allCaps(
+ SetVector<spirv::Capability, SmallVector<spirv::Capability, 0>> allCaps(
directCaps.begin(), directCaps.end());
// TODO: This is insufficient; find a better way to handle this
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
index cd2c9c52eeae..ed8ae0a53d78 100644
--- a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
+++ b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
@@ -74,7 +74,7 @@ getInterfaceVariables(spirv::FuncOp funcOp,
if (!module) {
return failure();
}
- llvm::SetVector<Operation *> interfaceVarSet;
+ SetVector<Operation *> interfaceVarSet;
// TODO: This should in reality traverse the entry function
// call graph and collect all the interfaces. For now, just traverse the
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/UpdateVCEPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/UpdateVCEPass.cpp
index c5a880400efe..7102f8e788bf 100644
--- a/mlir/lib/Dialect/SPIRV/Transforms/UpdateVCEPass.cpp
+++ b/mlir/lib/Dialect/SPIRV/Transforms/UpdateVCEPass.cpp
@@ -42,7 +42,7 @@ class UpdateVCEPass final : public SPIRVUpdateVCEBase<UpdateVCEPass> {
static LogicalResult checkAndUpdateExtensionRequirements(
Operation *op, const spirv::TargetEnv &targetEnv,
const spirv::SPIRVType::ExtensionArrayRefVector &candidates,
- llvm::SetVector<spirv::Extension> &deducedExtensions) {
+ SetVector<spirv::Extension> &deducedExtensions) {
for (const auto &ors : candidates) {
if (Optional<spirv::Extension> chosen = targetEnv.allows(ors)) {
deducedExtensions.insert(*chosen);
@@ -70,7 +70,7 @@ static LogicalResult checkAndUpdateExtensionRequirements(
static LogicalResult checkAndUpdateCapabilityRequirements(
Operation *op, const spirv::TargetEnv &targetEnv,
const spirv::SPIRVType::CapabilityArrayRefVector &candidates,
- llvm::SetVector<spirv::Capability> &deducedCapabilities) {
+ SetVector<spirv::Capability> &deducedCapabilities) {
for (const auto &ors : candidates) {
if (Optional<spirv::Capability> chosen = targetEnv.allows(ors)) {
deducedCapabilities.insert(*chosen);
@@ -101,8 +101,8 @@ void UpdateVCEPass::runOnOperation() {
spirv::Version allowedVersion = targetAttr.getVersion();
spirv::Version deducedVersion = spirv::Version::V_1_0;
- llvm::SetVector<spirv::Extension> deducedExtensions;
- llvm::SetVector<spirv::Capability> deducedCapabilities;
+ SetVector<spirv::Extension> deducedExtensions;
+ SetVector<spirv::Capability> deducedCapabilities;
// Walk each SPIR-V op to deduce the minimal version/extension/capability
// requirements.
diff --git a/mlir/lib/Dialect/Vector/VectorUtils.cpp b/mlir/lib/Dialect/Vector/VectorUtils.cpp
index b68886cb3e40..8e6fb32bde5e 100644
--- a/mlir/lib/Dialect/Vector/VectorUtils.cpp
+++ b/mlir/lib/Dialect/Vector/VectorUtils.cpp
@@ -25,8 +25,6 @@
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SetVector.h"
-using llvm::SetVector;
-
using namespace mlir;
/// Return the number of elements of basis, `0` if empty.
diff --git a/mlir/lib/IR/SymbolTable.cpp b/mlir/lib/IR/SymbolTable.cpp
index 8d5ba2e16224..e6924414465b 100644
--- a/mlir/lib/IR/SymbolTable.cpp
+++ b/mlir/lib/IR/SymbolTable.cpp
@@ -601,8 +601,8 @@ static SmallVector<SymbolScope, 2> collectSymbolScopes(Operation *symbol,
assert(!symbol->hasTrait<OpTrait::SymbolTable>() || symbol != limit);
// Compute the ancestors of 'limit'.
- llvm::SetVector<Operation *, SmallVector<Operation *, 4>,
- SmallPtrSet<Operation *, 4>>
+ SetVector<Operation *, SmallVector<Operation *, 4>,
+ SmallPtrSet<Operation *, 4>>
limitAncestors;
Operation *limitAncestor = limit;
do {
@@ -1043,7 +1043,7 @@ void SymbolUserMap::replaceAllUsesWith(Operation *symbol,
auto it = symbolToUsers.find(symbol);
if (it == symbolToUsers.end())
return;
- llvm::SetVector<Operation *> &users = it->second;
+ SetVector<Operation *> &users = it->second;
// Replace the uses within the users of `symbol`.
for (Operation *user : users)
diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
index fbb50ea2eea8..e7e9cb959052 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -44,7 +44,7 @@ static void convertOmpOpRegions(Region ®ion, StringRef blockName,
// Convert blocks one by one in topological order to ensure
// defs are converted before uses.
- llvm::SetVector<Block *> blocks =
+ SetVector<Block *> blocks =
LLVM::detail::getTopologicallySortedBlocks(region);
for (Block *bb : blocks) {
llvm::BasicBlock *llvmBB = moduleTranslation.lookupBlock(bb);
diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index 3705a6a72a38..01939f10ff4c 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -275,11 +275,11 @@ void mlir::LLVM::detail::connectPHINodes(Region ®ion,
}
/// Sort function blocks topologically.
-llvm::SetVector<Block *>
+SetVector<Block *>
mlir::LLVM::detail::getTopologicallySortedBlocks(Region ®ion) {
// For each block that has not been visited yet (i.e. that has no
// predecessors), add it to the list as well as its successors.
- llvm::SetVector<Block *> blocks;
+ SetVector<Block *> blocks;
for (Block &b : region) {
if (blocks.count(&b) == 0) {
llvm::ReversePostOrderTraversal<Block *> traversal(&b);
diff --git a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
index c54c16853719..9a91428ba0db 100644
--- a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
+++ b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.cpp
@@ -1630,7 +1630,7 @@ class ControlFlowStructurizer {
Block *mergeBlock;
Block *continueBlock; // nullptr for spv.mlir.selection
- llvm::SetVector<Block *> constructBlocks;
+ SetVector<Block *> constructBlocks;
};
} // namespace
diff --git a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.h b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.h
index 1812f6c6833f..895b66a33509 100644
--- a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.h
+++ b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.h
@@ -608,7 +608,7 @@ class Deserializer {
/// A list of IDs for all types forward-declared through OpTypeForwardPointer
/// instructions.
- llvm::SetVector<uint32_t> typeForwardPointerIDs;
+ SetVector<uint32_t> typeForwardPointerIDs;
/// A list of all structs which have unresolved member types.
SmallVector<DeferredStructTypeInfo, 0> deferredStructTypesInfos;
diff --git a/mlir/lib/Target/SPIRV/Serialization/Serializer.cpp b/mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
index e0ee4336c6ed..ab35315e7f14 100644
--- a/mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
+++ b/mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
@@ -321,13 +321,13 @@ LogicalResult Serializer::processType(Location loc, Type type,
uint32_t &typeID) {
// Maintains a set of names for nested identified struct types. This is used
// to properly serialize recursive references.
- llvm::SetVector<StringRef> serializationCtx;
+ SetVector<StringRef> serializationCtx;
return processTypeImpl(loc, type, typeID, serializationCtx);
}
LogicalResult
Serializer::processTypeImpl(Location loc, Type type, uint32_t &typeID,
- llvm::SetVector<StringRef> &serializationCtx) {
+ SetVector<StringRef> &serializationCtx) {
typeID = getTypeID(type);
if (typeID) {
return success();
@@ -380,7 +380,7 @@ Serializer::processTypeImpl(Location loc, Type type, uint32_t &typeID,
LogicalResult Serializer::prepareBasicType(
Location loc, Type type, uint32_t resultID, spirv::Opcode &typeEnum,
SmallVectorImpl<uint32_t> &operands, bool &deferSerialization,
- llvm::SetVector<StringRef> &serializationCtx) {
+ SetVector<StringRef> &serializationCtx) {
deferSerialization = false;
if (isVoidType(type)) {
diff --git a/mlir/lib/Target/SPIRV/Serialization/Serializer.h b/mlir/lib/Target/SPIRV/Serialization/Serializer.h
index 0996e8a9abda..9ee288a042b4 100644
--- a/mlir/lib/Target/SPIRV/Serialization/Serializer.h
+++ b/mlir/lib/Target/SPIRV/Serialization/Serializer.h
@@ -165,7 +165,7 @@ class Serializer {
/// serialized type will be returned as `typeID`.
LogicalResult processType(Location loc, Type type, uint32_t &typeID);
LogicalResult processTypeImpl(Location loc, Type type, uint32_t &typeID,
- llvm::SetVector<StringRef> &serializationCtx);
+ SetVector<StringRef> &serializationCtx);
/// Method for preparing basic SPIR-V type serialization. Returns the type's
/// opcode and operands for the instruction via `typeEnum` and `operands`.
@@ -173,7 +173,7 @@ class Serializer {
spirv::Opcode &typeEnum,
SmallVectorImpl<uint32_t> &operands,
bool &deferSerialization,
- llvm::SetVector<StringRef> &serializationCtx);
+ SetVector<StringRef> &serializationCtx);
LogicalResult prepareFunctionType(Location loc, FunctionType type,
spirv::Opcode &typeEnum,
@@ -292,8 +292,7 @@ class Serializer {
/// Serializes an operation in the SPIR-V dialect that is a mirror of an
/// instruction in the SPIR-V spec. This is auto generated if hasOpcode == 1
/// and autogenSerialization == 1 in ODS.
- template <typename OpTy>
- LogicalResult processOp(OpTy op) {
+ template <typename OpTy> LogicalResult processOp(OpTy op) {
return op.emitError("unsupported op serialization");
}
diff --git a/mlir/lib/Transforms/LoopFusion.cpp b/mlir/lib/Transforms/LoopFusion.cpp
index 4eb23f841fd0..50adc972ac9d 100644
--- a/mlir/lib/Transforms/LoopFusion.cpp
+++ b/mlir/lib/Transforms/LoopFusion.cpp
@@ -34,8 +34,6 @@
#include <sstream>
#define DEBUG_TYPE "affine-loop-fusion"
-using llvm::SetVector;
-
using namespace mlir;
namespace {
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index 54dce7417e21..c8bb22e10b86 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -75,8 +75,7 @@ computeConversionSet(iterator_range<Region::iterator> region,
/// A utility function to log a successful result for the given reason.
template <typename... Args>
-static void logSuccess(llvm::ScopedPrinter &os, StringRef fmt,
- Args &&... args) {
+static void logSuccess(llvm::ScopedPrinter &os, StringRef fmt, Args &&...args) {
LLVM_DEBUG({
os.unindent();
os.startLine() << "} -> SUCCESS";
@@ -89,8 +88,7 @@ static void logSuccess(llvm::ScopedPrinter &os, StringRef fmt,
/// A utility function to log a failure result for the given reason.
template <typename... Args>
-static void logFailure(llvm::ScopedPrinter &os, StringRef fmt,
- Args &&... args) {
+static void logFailure(llvm::ScopedPrinter &os, StringRef fmt, Args &&...args) {
LLVM_DEBUG({
os.unindent();
os.startLine() << "} -> FAILURE : "
@@ -831,7 +829,7 @@ struct ConversionPatternRewriterImpl {
/// define non-empty regions to the set, but not any of the others. This
/// simplifies the amount of memory needed as we can query if the parent
/// operation was ignored.
- llvm::SetVector<Operation *> ignoredOps;
+ SetVector<Operation *> ignoredOps;
/// A transaction state for each of operations that were updated in-place.
SmallVector<OperationTransactionState, 4> rootUpdates;
@@ -1959,7 +1957,7 @@ void OperationLegalizer::buildLegalizationGraph(
// A mapping between an operation and any currently invalid patterns it has.
DenseMap<OperationName, SmallPtrSet<const Pattern *, 2>> invalidPatterns;
// A worklist of patterns to consider for legality.
- llvm::SetVector<const Pattern *> patternWorklist;
+ SetVector<const Pattern *> patternWorklist;
// Build the mapping from operations to the parent ops that may generate them.
applicator.walkAllPatterns([&](const Pattern &pattern) {
diff --git a/mlir/lib/Transforms/Utils/LoopUtils.cpp b/mlir/lib/Transforms/Utils/LoopUtils.cpp
index e9bc2eb4fb2e..5e71e706ff7f 100644
--- a/mlir/lib/Transforms/Utils/LoopUtils.cpp
+++ b/mlir/lib/Transforms/Utils/LoopUtils.cpp
@@ -38,7 +38,6 @@
#define DEBUG_TYPE "LoopUtils"
using namespace mlir;
-using llvm::SetVector;
using llvm::SmallMapVector;
namespace {
diff --git a/mlir/lib/Transforms/Utils/RegionUtils.cpp b/mlir/lib/Transforms/Utils/RegionUtils.cpp
index f0e03c537a9c..7dedb7df9afe 100644
--- a/mlir/lib/Transforms/Utils/RegionUtils.cpp
+++ b/mlir/lib/Transforms/Utils/RegionUtils.cpp
@@ -57,14 +57,14 @@ void mlir::visitUsedValuesDefinedAbove(
}
void mlir::getUsedValuesDefinedAbove(Region ®ion, Region &limit,
- llvm::SetVector<Value> &values) {
+ SetVector<Value> &values) {
visitUsedValuesDefinedAbove(region, limit, [&](OpOperand *operand) {
values.insert(operand->get());
});
}
void mlir::getUsedValuesDefinedAbove(MutableArrayRef<Region> regions,
- llvm::SetVector<Value> &values) {
+ SetVector<Value> &values) {
for (Region ®ion : regions)
getUsedValuesDefinedAbove(region, region, values);
}
diff --git a/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp b/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
index 351ade4220e3..11e732dfeeed 100644
--- a/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
+++ b/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
@@ -32,8 +32,6 @@
using namespace mlir;
-using llvm::SetVector;
-
static llvm::cl::OptionCategory clOptionsCategory(DEBUG_TYPE " options");
static llvm::cl::list<int> clTestVectorShapeRatio(
diff --git a/mlir/test/lib/Dialect/Test/TestTypes.cpp b/mlir/test/lib/Dialect/Test/TestTypes.cpp
index 817b66a00082..69818203c569 100644
--- a/mlir/test/lib/Dialect/Test/TestTypes.cpp
+++ b/mlir/test/lib/Dialect/Test/TestTypes.cpp
@@ -227,7 +227,7 @@ void TestDialect::registerTypes() {
}
static Type parseTestType(MLIRContext *ctxt, DialectAsmParser &parser,
- llvm::SetVector<Type> &stack) {
+ SetVector<Type> &stack) {
StringRef typeTag;
if (failed(parser.parseKeyword(&typeTag)))
return Type();
@@ -270,12 +270,12 @@ static Type parseTestType(MLIRContext *ctxt, DialectAsmParser &parser,
}
Type TestDialect::parseType(DialectAsmParser &parser) const {
- llvm::SetVector<Type> stack;
+ SetVector<Type> stack;
return parseTestType(getContext(), parser, stack);
}
static void printTestType(Type type, DialectAsmPrinter &printer,
- llvm::SetVector<Type> &stack) {
+ SetVector<Type> &stack) {
if (succeeded(generatedTypePrinter(type, printer)))
return;
@@ -291,6 +291,6 @@ static void printTestType(Type type, DialectAsmPrinter &printer,
}
void TestDialect::printType(Type type, DialectAsmPrinter &printer) const {
- llvm::SetVector<Type> stack;
+ SetVector<Type> stack;
printTestType(type, printer, stack);
}
diff --git a/mlir/test/lib/IR/TestSlicing.cpp b/mlir/test/lib/IR/TestSlicing.cpp
index 12a8934c7083..c28f37740a1a 100644
--- a/mlir/test/lib/IR/TestSlicing.cpp
+++ b/mlir/test/lib/IR/TestSlicing.cpp
@@ -35,7 +35,7 @@ static LogicalResult createBackwardSliceFunction(Operation *op,
builder.setInsertionPointToEnd(clonedFuncOp.addEntryBlock());
for (auto arg : enumerate(parentFuncOp.getArguments()))
mapper.map(arg.value(), clonedFuncOp.getArgument(arg.index()));
- llvm::SetVector<Operation *> slice;
+ SetVector<Operation *> slice;
getBackwardSlice(op, &slice);
for (Operation *slicedOp : slice)
builder.clone(*slicedOp, mapper);
diff --git a/mlir/test/lib/Transforms/TestLinalgElementwiseFusion.cpp b/mlir/test/lib/Transforms/TestLinalgElementwiseFusion.cpp
index c1da6737ac22..bfd734470898 100644
--- a/mlir/test/lib/Transforms/TestLinalgElementwiseFusion.cpp
+++ b/mlir/test/lib/Transforms/TestLinalgElementwiseFusion.cpp
@@ -19,7 +19,7 @@
namespace mlir {
-static void addOperands(Operation *op, llvm::SetVector<Value> &operandSet) {
+static void addOperands(Operation *op, SetVector<Value> &operandSet) {
if (!op)
return;
TypeSwitch<Operation *, void>(op)
@@ -35,7 +35,7 @@ static void addOperands(Operation *op, llvm::SetVector<Value> &operandSet) {
template <int limit = 3>
static bool setFusedOpOperandLimit(const OpResult &producer,
const OpOperand &consumer) {
- llvm::SetVector<Value> fusedOpOperands;
+ SetVector<Value> fusedOpOperands;
if (producer.getOwner()->getNumResults() != 1)
return false;
addOperands(consumer.getOwner(), fusedOpOperands);
diff --git a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
index 548a2e3bbe7a..1cf927c53ef6 100644
--- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
+++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
@@ -64,7 +64,6 @@ static llvm::cl::opt<bool> testEmitIncludeTdHeader(
"tblgen testing."),
llvm::cl::init(false), llvm::cl::cat(ODSGenCat));
-using llvm::SetVector;
using llvm::SMLoc;
using llvm::StringRef;
using llvm::Twine;
@@ -1010,8 +1009,7 @@ struct TensorUse : public Expression {
/// Visitation function. Performs preorder or postorder traversal depending on
/// `PreOrder` and applies `callback` on each node.
- template <typename Lambda, bool PreOrder>
- void visit(Lambda callback) const;
+ template <typename Lambda, bool PreOrder> void visit(Lambda callback) const;
StringRef tensorId;
AffineMap indexingMap;
@@ -1055,8 +1053,7 @@ struct TensorExpr : public Expression {
/// Visitation function. Performs preorder or postorder traversal depending on
/// `PreOrder` and applies `callback` on each node.
- template <typename Lambda, bool PreOrder>
- void visit(Lambda callback) const;
+ template <typename Lambda, bool PreOrder> void visit(Lambda callback) const;
StringRef operationName;
SmallVector<std::unique_ptr<Expression>, 4> expressions;
@@ -1204,8 +1201,7 @@ class TCParser {
namespace llvm {
-template <>
-struct DenseMapInfo<TensorUse> {
+template <> struct DenseMapInfo<TensorUse> {
static TensorUse getEmptyKey() { return TensorUse("", AffineMap()); }
static TensorUse getTombstoneKey() {
return TensorUse(DenseMapInfo<StringRef>::getTombstoneKey(),
More information about the Mlir-commits
mailing list