});
}
};
-} // end anonymous namespace
+} // namespace
/// Register this pass so that it can be built via from a textual pass pipeline.
/// (Pass registration is discussed more below)
namespace {
/// Include the patterns defined in the Declarative Rewrite framework.
#include "ToyCombine.inc"
-} // end anonymous namespace
+} // namespace
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> x
namespace toy {
std::unique_ptr<Pass> createShapeInferencePass();
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_PASSES_H
/// Include the auto-generated declarations.
#include "toy/ShapeInferenceOpInterfaces.h.inc"
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_SHAPEINFERENCEINTERFACE_H_
});
}
};
-} // end anonymous namespace
+} // namespace
/// Create a Shape Inference pass.
std::unique_ptr<mlir::Pass> mlir::toy::createShapeInferencePass() {
namespace {
/// Include the patterns defined in the Declarative Rewrite framework.
#include "ToyCombine.inc"
-} // end anonymous namespace
+} // namespace
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> x
/// for a subset of the Toy IR (e.g. matmul).
std::unique_ptr<mlir::Pass> createLowerToAffinePass();
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_PASSES_H
/// Include the auto-generated declarations.
#include "toy/ShapeInferenceOpInterfaces.h.inc"
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_SHAPEINFERENCEINTERFACE_H_
}
};
-} // end anonymous namespace.
+} // namespace
//===----------------------------------------------------------------------===//
// ToyToAffineLoweringPass
}
void runOnFunction() final;
};
-} // end anonymous namespace.
+} // namespace
void ToyToAffineLoweringPass::runOnFunction() {
auto function = getFunction();
});
}
};
-} // end anonymous namespace
+} // namespace
/// Create a Shape Inference pass.
std::unique_ptr<mlir::Pass> mlir::toy::createShapeInferencePass() {
namespace {
/// Include the patterns defined in the Declarative Rewrite framework.
#include "ToyCombine.inc"
-} // end anonymous namespace
+} // namespace
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> x
/// well as `Affine` and `Std`, to the LLVM dialect for codegen.
std::unique_ptr<mlir::Pass> createLowerToLLVMPass();
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_PASSES_H
/// Include the auto-generated declarations.
#include "toy/ShapeInferenceOpInterfaces.h.inc"
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_SHAPEINFERENCEINTERFACE_H_
}
};
-} // end anonymous namespace.
+} // namespace
//===----------------------------------------------------------------------===//
// ToyToAffineLoweringPass
}
void runOnFunction() final;
};
-} // end anonymous namespace.
+} // namespace
void ToyToAffineLoweringPass::runOnFunction() {
auto function = getFunction();
globalPtr, ArrayRef<Value>({cst0, cst0}));
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// ToyToLLVMLoweringPass
}
void runOnOperation() final;
};
-} // end anonymous namespace
+} // namespace
void ToyToLLVMLoweringPass::runOnOperation() {
// The first thing to define is the conversion target. This will define the
});
}
};
-} // end anonymous namespace
+} // namespace
/// Create a Shape Inference pass.
std::unique_ptr<mlir::Pass> mlir::toy::createShapeInferencePass() {
namespace {
/// Include the patterns defined in the Declarative Rewrite framework.
#include "ToyCombine.inc"
-} // end anonymous namespace
+} // namespace
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> x
namespace toy {
namespace detail {
struct StructTypeStorage;
-} // end namespace detail
-} // end namespace toy
-} // end namespace mlir
+} // namespace detail
+} // namespace toy
+} // namespace mlir
/// Include the auto-generated header file containing the declaration of the toy
/// dialect.
/// Returns the number of element type held by this struct.
size_t getNumElementTypes() { return getElementTypes().size(); }
};
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_DIALECT_H_
/// well as `Affine` and `Std`, to the LLVM dialect for codegen.
std::unique_ptr<mlir::Pass> createLowerToLLVMPass();
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_PASSES_H
/// Include the auto-generated declarations.
#include "toy/ShapeInferenceOpInterfaces.h.inc"
-} // end namespace toy
-} // end namespace mlir
+} // namespace toy
+} // namespace mlir
#endif // MLIR_TUTORIAL_TOY_SHAPEINFERENCEINTERFACE_H_
/// The following field contains the element types of the struct.
llvm::ArrayRef<mlir::Type> elementTypes;
};
-} // end namespace detail
-} // end namespace toy
-} // end namespace mlir
+} // namespace detail
+} // namespace toy
+} // namespace mlir
/// Create an instance of a `StructType` with the given element types. There
/// *must* be at least one element type.
}
};
-} // end anonymous namespace.
+} // namespace
//===----------------------------------------------------------------------===//
// ToyToAffineLoweringPass
}
void runOnFunction() final;
};
-} // end anonymous namespace.
+} // namespace
void ToyToAffineLoweringPass::runOnFunction() {
auto function = getFunction();
globalPtr, ArrayRef<Value>({cst0, cst0}));
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// ToyToLLVMLoweringPass
}
void runOnOperation() final;
};
-} // end anonymous namespace
+} // namespace
void ToyToLLVMLoweringPass::runOnOperation() {
// The first thing to define is the conversion target. This will define the
});
}
};
-} // end anonymous namespace
+} // namespace
/// Create a Shape Inference pass.
std::unique_ptr<mlir::Pass> mlir::toy::createShapeInferencePass() {
namespace {
/// Include the patterns defined in the Declarative Rewrite framework.
#include "ToyCombine.inc"
-} // end anonymous namespace
+} // namespace
/// Fold constants.
OpFoldResult ConstantOp::fold(ArrayRef<Attribute> operands) { return value(); }
AffineForOp forOp, unsigned maxLoopDepth,
std::vector<SmallVector<DependenceComponent, 2>> *depCompsVec);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_AFFINE_ANALYSIS_H
LogicalResult getRelationFromMap(const AffineValueMap &map,
FlatAffineRelation &rel);
-} // end namespace mlir.
+} // namespace mlir.
#endif // MLIR_ANALYSIS_AFFINESTRUCTURES_H
ImplT impl;
};
};
-} // end namespace detail
+} // namespace detail
//===----------------------------------------------------------------------===//
// AliasAnalysis
SmallVector<std::unique_ptr<Concept>, 4> aliasImpls;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_ALIASANALYSIS_H_
/// Return the modify-reference behavior of `op` on `location`.
ModRefResult getModRef(Operation *op, Value location);
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_ALIASANALYSIS_LOCALALIASANALYSIS_H_
CallGraphNode externalNode;
};
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
// Provide graph traits for traversing call graphs using standard graph
static nodes_iterator nodes_begin(mlir::CallGraph *cg) { return cg->begin(); }
static nodes_iterator nodes_end(mlir::CallGraph *cg) { return cg->end(); }
};
-} // end namespace llvm
+} // namespace llvm
#endif // MLIR_ANALYSIS_CALLGRAPH_H
MLIRContext *context;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_DATAFLOWANALYSIS_H
friend class Liveness;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_LIVENESS_H
/// reductions not covered by this generic matching.
Value matchReduction(ArrayRef<BlockArgument> iterCarriedArgs, unsigned redPos,
SmallVectorImpl<Operation *> &combinerOps);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_LOOP_ANALYSIS_H
bool isReductionLoop(Operation &op);
bool isLoadOrStore(Operation &op);
-} // end namespace matcher
-} // end namespace mlir
+} // namespace matcher
+} // namespace mlir
#endif // MLIR_ANALYSIS_MLFUNCTIONMATCHER_H_
Optional<int64_t> numberOfBlockExecutions;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_NUMBER_OF_EXECUTIONS_H
/// Returns a topologically sorted SetVector.
SetVector<Operation *> topologicalSort(const SetVector<Operation *> &toSort);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_SLICEANALYSIS_H_
ArrayRef<Operation *> ops,
SmallVectorImpl<AffineForOp> *surroundingLoops = nullptr);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_ANALYSIS_UTILS_H
void *opaqueData;
uint64_t pos;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif // MLIR_CAPI_UTILS_H
RewritePatternSet &patterns);
std::unique_ptr<Pass> createConvertArithmeticToLLVMPass();
-} // end namespace arith
-} // end namespace mlir
+} // namespace arith
+} // namespace mlir
#endif // MLIR_CONVERSION_ARITHMETICTOLLVM_ARITHMETICTOLLVM_H
RewritePatternSet &patterns);
std::unique_ptr<Pass> createConvertArithmeticToSPIRVPass();
-} // end namespace arith
-} // end namespace mlir
+} // namespace arith
+} // namespace mlir
#endif // MLIR_CONVERSION_ARITHMETICTOSPIRV_ARITHMETICTOSPIRV_H
namespace scf {
class ForOp;
-} // end namespace scf
+} // namespace scf
/// Convert a perfect affine loop nest with the outermost loop identified by
/// `forOp` into a gpu::Launch operation. Map `numBlockDims` outer loops to
friend class AffineForOp;
};
-} // end namespace mlir
+} // namespace mlir
#endif
#define GEN_PASS_REGISTRATION
#include "mlir/Dialect/Affine/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_AFFINE_RANSFORMS_PASSES_H
static bool classof(Operation *op);
};
-} // end namespace arith
-} // end namespace mlir
+} // namespace arith
+} // namespace mlir
//===----------------------------------------------------------------------===//
// Utility Functions
bool applyCmpPredicate(arith::CmpFPredicate predicate, const APFloat &lhs,
const APFloat &rhs);
-} // end namespace arith
-} // end namespace mlir
+} // namespace arith
+} // namespace mlir
#endif // MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_
namespace mlir {
namespace bufferization {
class BufferizeTypeConverter;
-} // end namespace bufferization
+} // namespace bufferization
namespace arith {
#define GEN_PASS_REGISTRATION
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h.inc"
-} // end namespace arith
-} // end namespace mlir
+} // namespace arith
+} // namespace mlir
#endif // MLIR_DIALECT_ARITHMETIC_TRANSFORMS_PASSES_H_
void populateEliminateBufferizeMaterializationsPatterns(
BufferizeTypeConverter &typeConverter, RewritePatternSet &patterns);
-} // end namespace bufferization
-} // end namespace mlir
+} // namespace bufferization
+} // namespace mlir
#endif // MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_BUFFERIZE_H
#define GEN_PASS_REGISTRATION
#include "mlir/Dialect/Bufferization/Transforms/Passes.h.inc"
-} // end namespace bufferization
-} // end namespace mlir
+} // namespace bufferization
+} // namespace mlir
#endif // MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_PASSES_H
// Adds a `gpu.async.token` to the front of the argument list.
void addAsyncDependency(Operation *op, Value token);
-} // end namespace gpu
-} // end namespace mlir
+} // namespace gpu
+} // namespace mlir
#include "mlir/Dialect/GPU/GPUOpsEnums.h.inc"
/// copies will be inserted in the beginning and in the end of the function.
void promoteToWorkgroupMemory(gpu::GPUFuncOp op, unsigned arg);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_GPU_MEMORYPROMOTION_H
/// - the mapping does not map multiple loops to the same processor.
LogicalResult setMappingAttr(scf::ParallelOp ploopOp,
ArrayRef<ParallelLoopDimMapping> mapping);
-} // end namespace gpu
+} // namespace gpu
/// Maps the parallel loops found in the given function to workgroups. The first
/// loop encountered will be mapped to the global workgroup and the second loop
/// mapped to sequential loops.
void greedilyMapParallelSCFToGPU(Region ®ion);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_GPU_PARALLELLOOPMAPPER_H
namespace sys {
template <bool mt_only>
class SmartMutex;
-} // end namespace sys
-} // end namespace llvm
+} // namespace sys
+} // namespace llvm
namespace mlir {
namespace LLVM {
SmallVector<LoopOptionsAttr::OptionValuePair> options;
};
-} // end namespace LLVM
-} // end namespace mlir
+} // namespace LLVM
+} // namespace mlir
#endif // MLIR_DIALECT_LLVMIR_LLVMDIALECT_H_
/// are > 1 deallocates for `allocValue`, returns None, else returns the single
/// deallocate if it exists or nullptr.
llvm::Optional<Operation *> findDealloc(Value allocValue);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_MEMREF_UTILS_MEMREFUTILS_H
/// combined and the final mapping value would be 5 (4 | 1).
enum OpenACCExecMapping { NONE = 0, VECTOR = 1, WORKER = 2, GANG = 4 };
-} // end namespace acc
-} // end namespace mlir
+} // namespace acc
+} // namespace mlir
#endif // MLIR_DIALECT_OPENACC_OPENACC_H_
function_ref<void(OpBuilder &, Location, ValueRange)>
bodyBuilder = nullptr);
-} // end namespace scf
-} // end namespace mlir
+} // namespace scf
+} // namespace mlir
#endif // MLIR_DIALECT_SCF_H_
class IfOp;
class ForOp;
class ParallelOp;
-} // end namespace scf
+} // namespace scf
/// Create a clone of `loop` with `newIterOperands` added as new initialization
/// values and `newYieldedValues` added as new yielded values. The returned
SmallVectorImpl<Value> &symbols,
llvm::function_ref<bool(Operation *)> loopFilter = nullptr);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_SCF_UTILS_H_
enum class Decoration : uint32_t;
-} // end namespace spirv
-} // end namespace mlir
+} // namespace spirv
+} // namespace mlir
#include "mlir/Dialect/SPIRV/IR/SPIRVOpsDialect.h.inc"
/// third one will also be returned.
SmallVector<Capability, 0> getRecursiveImpliedCapabilities(Capability cap);
-} // end namespace spirv
-} // end namespace mlir
+} // namespace spirv
+} // namespace mlir
#endif // MLIR_DIALECT_SPIRV_IR_SPIRVENUMS_H_
Optional<StorageClass> storage = llvm::None);
};
-} // end namespace spirv
-} // end namespace mlir
+} // namespace spirv
+} // namespace mlir
#endif // MLIR_DIALECT_SPIRV_IR_SPIRVTYPES_H_
#define GEN_PASS_REGISTRATION
#include "mlir/Dialect/Shape/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_SHAPE_TRANSFORMS_PASSES_H_
Value getReductionOp(AtomicRMWKind op, OpBuilder &builder, Location loc,
Value lhs, Value rhs);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_IR_STANDARDOPS_IR_OPS_H
ValueDecomposer &decomposer,
RewritePatternSet &patterns);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_STANDARDOPS_TRANSFORMS_DECOMPOSECALLGRAPHTYPES_H
/// `isLegalForBranchOpInterfaceTypeConversionPattern` and
/// `isLegalForReturnOpTypeConversionPattern`.
bool isNotBranchOpInterfaceOrReturnLikeOp(Operation *op);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_STANDARDOPS_TRANSFORMS_FUNCCONVERSIONS_H_
namespace mlir {
namespace bufferization {
class BufferizeTypeConverter;
-} // end namespace bufferization
+} // namespace bufferization
class GlobalCreator;
class RewritePatternSet;
#define GEN_PASS_REGISTRATION
#include "mlir/Dialect/StandardOps/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_STANDARD_TRANSFORMS_PASSES_H_
OpBuilder &b;
Location loc;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_STANDARDOPS_UTILS_UTILS_H
namespace mlir {
namespace bufferization {
class BufferizeTypeConverter;
-} // end namespace bufferization
+} // namespace bufferization
class RewritePatternSet;
using OwningRewritePatternList = RewritePatternSet;
#include "mlir/Dialect/Tensor/Transforms/Passes.h.inc"
} // namespace tensor
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_TENSOR_TRANSFORMS_PASSES_H_
#include "mlir/Dialect/Tosa/IR/TosaInterfaces.h.inc"
-} // end namespace tosa
-} // end namespace mlir
+} // namespace tosa
+} // namespace mlir
#define GET_OP_CLASSES
#include "mlir/Dialect/Tosa/IR/TosaOps.h.inc"
#define GEN_PASS_CLASSES
#include "mlir/Dialect/Tosa/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_DIALECT_TOSA_TRANSFORMS_PASSDETAIL_H
}
};
-} // end namespace OpTrait
-} // end namespace mlir
+} // namespace OpTrait
+} // namespace mlir
#endif // MLIR_DIALECT_TRAITS
Operation *op;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_UTILS_STRUCTUREDOPSUTILS_H
AffineMap getTransferMinorIdentityMap(ShapedType shapedType,
VectorType vectorType);
} // namespace impl
-} // end namespace vector
-} // end namespace mlir
+} // namespace vector
+} // namespace mlir
#define GET_OP_CLASSES
#include "mlir/Dialect/Vector/VectorOps.h.inc"
/// adding even 1 extra bit in the IR for now.
bool operatesOnSuperVectorsOf(Operation &op, VectorType subVectorType);
-} // end namespace matcher
-} // end namespace mlir
+} // namespace matcher
+} // namespace mlir
#endif // MLIR_DIALECT_VECTOR_VECTORUTILS_H_
T vector[Dim];
char padding[nextPowerOf2(sizeof(T[Dim])) - sizeof(T[Dim])];
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
// N-D vectors recurse down to 1-D.
template <typename T, int Dim, int... Dims>
llvm::JITEventListener *perfListener;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_EXECUTIONENGINE_EXECUTIONENGINE_H_
llvm::TargetMachine *targetMachine,
unsigned optPassesInsertPos = 0);
-} // end namespace mlir
+} // namespace mlir
#endif // LIR_EXECUTIONENGINE_OPTUTILS_H_
inline unsigned getDimStartIndex() const { return 0; }
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_AFFINE_EXPR_VISITOR_H
namespace detail {
struct AffineMapStorage;
-} // end namespace detail
+} // namespace detail
class Attribute;
struct LogicalResult;
map.print(os);
return os;
}
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
namespace detail {
class AsmStateImpl;
-} // end namespace detail
+} // namespace detail
/// This class provides management for the lifetime of the state used when
/// printing the IR. It allows for alleviating the cost of recomputing the
/// various flags within the AsmPrinter.
void registerAsmPrinterCLOptions();
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_ASMSTATE_H_
namespace detail {
class AttributeUniquer;
-} // end namespace detail
+} // namespace detail
/// Base storage class appearing in an attribute. Derived storage classes should
/// only be constructed within the context of the AttributeUniquer.
};
} // namespace detail
-} // end namespace mlir
+} // namespace mlir
#endif
friend InterfaceBase;
};
-} // end namespace mlir.
+} // namespace mlir.
namespace llvm {
namespace llvm {
class BitVector;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
class TypeRange;
friend struct llvm::ilist_traits<Block>;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_BLOCK_H
DenseMap<Block *, Block *> blockMap;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_BLOCKANDVALUEMAPPING_H
/// Allow implicit conversion to the underlying block iterator.
operator const IteratorT &() const { return this->wrapped(); }
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
namespace llvm {
static pointer getValuePtr(node_type *N);
static const_pointer getValuePtr(const node_type *N);
};
-} // end namespace ilist_detail
+} // namespace ilist_detail
template <> struct ilist_traits<::mlir::Operation> {
using Operation = ::mlir::Operation;
mlir::Region *getParentRegion();
};
-} // end namespace llvm
+} // namespace llvm
#endif // MLIR_IR_BLOCK_SUPPORT_H
return llvm::None;
return iterator<T>(std::move(*indexer), 0);
}
-} // end namespace mlir.
+} // namespace mlir.
#endif // MLIR_IR_BUILTINATTRIBUTEINTERFACES_H
inline Type StringAttr::getType() const { return Attribute::getType(); }
-} // end namespace mlir
+} // namespace mlir
//===----------------------------------------------------------------------===//
// Attribute Utilities
OwningModuleRef(OwningOpRef<ModuleOp> &&other)
: OwningOpRef<ModuleOp>(std::move(other)) {}
};
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
/// Allow stealing the low bits of FuncOp.
}
static constexpr int NumLowBitsAvailable = 3;
};
-} // end namespace llvm
+} // namespace llvm
#endif // MLIR_IR_BUILTINOPS_H_
unsigned getMemorySpaceAsInt() const;
};
-} // end namespace mlir
+} // namespace mlir
//===----------------------------------------------------------------------===//
// Tablegen Type Declarations
/// Return null if the layout is not compatible with a strided layout.
AffineMap getStridedLinearLayoutMap(MemRefType t);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_BUILTINTYPES_H
class MemoryBuffer;
class SMLoc;
class SourceMgr;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
class DiagnosticEngine;
namespace detail {
struct DiagnosticEngineImpl;
-} // end namespace detail
+} // namespace detail
/// Defines the different supported severity of a diagnostic.
enum class DiagnosticSeverity {
namespace detail {
struct SourceMgrDiagnosticHandlerImpl;
-} // end namespace detail
+} // namespace detail
/// This class is a utility diagnostic handler for use with llvm::SourceMgr.
class SourceMgrDiagnosticHandler : public ScopedDiagnosticHandler {
namespace detail {
struct SourceMgrDiagnosticVerifierHandlerImpl;
-} // end namespace detail
+} // namespace detail
/// This class is a utility diagnostic handler for use with llvm::SourceMgr that
/// verifies that emitted diagnostics match 'expected-*' lines on the
namespace detail {
struct ParallelDiagnosticHandlerImpl;
-} // end namespace detail
+} // namespace detail
/// This class is a utility diagnostic handler for use when multi-threading some
/// part of the compiler where diagnostics may be emitted. This handler ensures
virtual ~Dialect();
/// Utility function that returns if the given string is a valid dialect
- /// namespace.
+ /// namespace
static bool isValidNamespace(StringRef str);
MLIRContext *getContext() const { return context; }
}
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_DIALECTIMPLEMENTATION_H
protected:
DialectInterfaceBase(Dialect *dialect) : BaseT(dialect, getInterfaceID()) {}
};
-} // end namespace detail
+} // namespace detail
/// This class represents an interface overridden for a single dialect.
class DialectInterface {
mutable DenseMap<Region *, llvm::PointerIntPair<DomTree *, 1, bool>>
dominanceInfos;
};
-} // end namespace detail
+} // namespace detail
/// A class for computing basic dominance information. Note that this
/// class is aware of different types of regions and returns a
}
};
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
};
-} // end namespace llvm
+} // namespace llvm
#endif
return removedAttr;
}
-} // end namespace OpTrait
+} // namespace OpTrait
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_FUNCTIONSUPPORT_H
/// NOTICE: Identifier is deprecated and usages of it should be replaced with
/// StringAttr.
using Identifier = StringAttr;
-} // end namespace mlir
+} // namespace mlir
#endif
namespace detail {
struct IntegerSetStorage;
-} // end namespace detail
+} // namespace detail
class MLIRContext;
return ::llvm::hash_value(arg.set);
}
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
// IntegerSet hash just like pointers.
return hash_value(arg.impl);
}
-} // end namespace mlir
+} // namespace mlir
//===----------------------------------------------------------------------===//
// Tablegen Attribute Declarations
namespace llvm {
class ThreadPool;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
class DebugActionManager;
/// an MLIR context for initialization.
void registerMLIRContextCLOptions();
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_MLIRCONTEXT_H
std::tuple<OperandMatchers...> operandMatchers;
};
-} // end namespace detail
+} // namespace detail
/// Matches a constant foldable operation.
inline detail::constant_op_matcher m_Constant() {
inline auto m_Val(Value v) { return detail::PatternMatcherValue(v); }
} // namespace matchers
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_MATCHERS_H
return this->getOperation()->getOperandTypes();
}
};
-} // end namespace detail
+} // namespace detail
/// This class provides the API for ops that are known to have no
/// SSA operand.
region_iterator region_end() { return this->getOperation()->region_end(); }
region_range getRegions() { return this->getOperation()->getRegions(); }
};
-} // end namespace detail
+} // namespace detail
/// This class provides APIs for ops that are known to have a single region.
template <typename ConcreteType>
return this->getOperation()->getResultTypes();
}
};
-} // end namespace detail
+} // namespace detail
/// This class provides return value APIs for ops that are known to have a
/// single result. ResultType is the concrete type returned by getType().
succ_iterator succ_end() { return this->getOperation()->succ_end(); }
succ_range getSuccessors() { return this->getOperation()->getSuccessors(); }
};
-} // end namespace detail
+} // namespace detail
/// This class provides APIs for ops that are known to have a single successor.
template <typename ConcreteType>
/// behavior to vectors/tensors, and systematize conversion between these forms.
bool hasElementwiseMappableTraits(Operation *op);
-} // end namespace OpTrait
+} // namespace OpTrait
//===----------------------------------------------------------------------===//
// Internal Trait Utilities
LogicalResult verifyCastOp(Operation *op,
function_ref<bool(Type, Type)> areCastCompatible);
} // namespace impl
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
static bool isEqual(T lhs, T rhs) { return lhs == rhs; }
};
-} // end namespace llvm
+} // namespace llvm
#endif
virtual void getAsmBlockArgumentNames(Block *block,
OpAsmSetValueNameFn setNameFn) const {}
};
-} // end namespace mlir
+} // namespace mlir
//===--------------------------------------------------------------------===//
// Operation OpAsm interface.
return os;
}
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
/// Provide isa functionality for operation casts.
struct cast_convert_val<T, ::mlir::Operation *, ::mlir::Operation *> {
static T doit(::mlir::Operation *val) { return T(val); }
};
-} // end namespace llvm
+} // namespace llvm
#endif // MLIR_IR_OPERATION_H
namespace llvm {
class BitVector;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
class Dialect;
return findAttrUnsorted(first, last, name);
}
-} // end namespace impl
+} // namespace impl
//===----------------------------------------------------------------------===//
// NamedAttrList
/// A pointer to the operand storage.
OpOperand *operandStorage;
};
-} // end namespace detail
+} // namespace detail
//===----------------------------------------------------------------------===//
// OpPrintingFlags
/// Enable Bitmask enums for OperationEquivalence::Flags.
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
template <>
}
};
-} // end namespace llvm
+} // namespace llvm
#endif
OpTy op;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_OWNINGOPREF_H
PDLPatternModule pdlPatterns;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_PATTERN_MATCH_H
friend RangeBaseT;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_REGION_H
}
};
-} // end namespace OpTrait
+} // namespace OpTrait
//===----------------------------------------------------------------------===//
// Visibility parsing implementation.
/// nested) without quotes in a string attribute named 'attrName'.
ParseResult parseOptionalVisibilityKeyword(OpAsmParser &parser,
NamedAttrList &attrs);
-} // end namespace impl
+} // namespace impl
-} // end namespace mlir
+} // namespace mlir
/// Include the generated symbol interfaces.
#include "mlir/IR/SymbolInterfaces.h.inc"
parallelForEach(context, llvm::seq(begin, end), std::forward<FuncT>(func));
}
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_IR_THREADING_H
namespace detail {
struct TypeUniquer;
-} // end namespace detail
+} // namespace detail
/// Base storage class appearing in a Type.
class TypeStorage : public StorageUniquer::BaseStorage {
};
} // namespace detail
-} // end namespace mlir
+} // namespace mlir
#endif
using ResultElementTypeRange = iterator_range<ResultElementTypeIterator>;
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_SUPPORT_TYPEUTILITIES_H
return U(impl);
}
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
/// Allow access to owner and constructor.
friend BlockArgument;
};
-} // end namespace detail
+} // namespace detail
/// This class represents an argument of a Block.
class BlockArgument : public Value {
return cast<InlineOpResult>(this)->getResultNumber();
}
-} // end namespace detail
+} // namespace detail
/// This is a value defined by a result of an operation.
class OpResult : public Value {
}
};
-} // end namespace llvm
+} // namespace llvm
#endif
/// compiler bugs, on this operation and any nested operations. On error, this
/// reports the error through the MLIRContext and returns failure.
LogicalResult verify(Operation *op);
-} // end namespace mlir
+} // namespace mlir
#endif
/// Utility to provide the return type of a templated walk method.
template <typename FnT>
using walkResultType = decltype(walk(nullptr, std::declval<FnT>()));
-} // end namespace detail
+} // namespace detail
} // namespace mlir
struct CallInterfaceCallable : public PointerUnion<SymbolRefAttr, Value> {
using PointerUnion<SymbolRefAttr, Value>::PointerUnion;
};
-} // end namespace mlir
+} // namespace mlir
/// Include the generated interface declarations.
#include "mlir/Interfaces/CallInterfaces.h.inc"
};
} // namespace OpTrait
-} // end namespace mlir
+} // namespace mlir
//===----------------------------------------------------------------------===//
// ControlFlow Interfaces
}
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_INTERFACES_DECODEATTRIBUTESINTERFACES_H_
virtual bool shouldMaterializeInto(Region *region) const { return false; }
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_INTERFACES_FOLDINTERFACES_H_
/// `isOpTriviallyDead` if `op` was unused.
bool wouldOpBeTriviallyDead(Operation *op);
-} // end namespace mlir
+} // namespace mlir
//===----------------------------------------------------------------------===//
// SideEffect Interfaces
class SourceMgr;
class SMDiagnostic;
class StringRef;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
class AsmParserState;
return OwningOpRef<ContainerOpT>();
return opRef;
}
-} // end namespace detail
+} // namespace detail
/// This parses the file specified by the indicated SourceMgr and appends parsed
/// operations to the given block. If the block is non-empty, the operations are
IntegerSet parseIntegerSet(llvm::StringRef str, MLIRContext *context,
bool printDiagnosticInfo = true);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_PARSER_H
std::unique_ptr<Impl> impl;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_PARSER_ASMPARSERSTATE_H
isInvalidated(AnalysisT &analysis, const PreservedAnalyses &pa) {
return !pa.isPreserved<AnalysisT>();
}
-} // end namespace analysis_impl
+} // namespace analysis_impl
/// The abstract polymorphic base class representing an analysis.
struct AnalysisConcept {
detail::NestedAnalysisMap analyses;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_PASS_ANALYSISMANAGER_H
}
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_PASS_PASS_H
namespace detail {
struct PassInstrumentorImpl;
-} // end namespace detail
+} // namespace detail
/// PassInstrumentation provides several entry points into the pass manager
/// infrastructure. Instrumentations should be added directly to a PassManager
std::unique_ptr<detail::PassInstrumentorImpl> impl;
};
-} // end namespace mlir
+} // namespace mlir
namespace llvm {
template <> struct DenseMapInfo<mlir::PassInstrumentation::PipelineParentInfo> {
lhs.parentPass == rhs.parentPass;
}
};
-} // end namespace llvm
+} // namespace llvm
#endif // MLIR_PASS_PASSINSTRUMENTATION_H_
namespace llvm {
class Any;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
class AnalysisManager;
class OpToOpPassAdaptor;
class PassCrashReproducerGenerator;
struct PassExecutionState;
-} // end namespace detail
+} // namespace detail
//===----------------------------------------------------------------------===//
// OpPassManager
/// to the pass manager.
void applyDefaultTimingPassManagerCLOptions(PassManager &pm);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_PASS_PASSMANAGER_H
/// A list of all of the opaque options.
std::vector<OptionBase *> options;
};
-} // end namespace detail
+} // namespace detail
//===----------------------------------------------------------------------===//
// PassPipelineOptions
struct EmptyPipelineOptions : public PassPipelineOptions<EmptyPipelineOptions> {
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_PASS_PASSOPTIONS_H_
namespace detail {
class PassOptions;
-} // end namespace detail
+} // namespace detail
/// A registry function that adds passes to the given pass manager. This should
/// also parse options and return success() if parsing succeeded.
namespace detail {
struct PassPipelineCLParserImpl;
-} // end namespace detail
+} // namespace detail
/// This class implements a command-line parser for MLIR passes. It registers a
/// cl option with a given argument and description. This parser will register
std::unique_ptr<detail::PassPipelineCLParserImpl> impl;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_PASS_PASSREGISTRY_H_
#define GEN_PASS_CLASSES
#include "mlir/Reducer/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_REDUCER_PASSDETAIL_H
#define GEN_PASS_REGISTRATION
#include "mlir/Reducer/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_REDUCER_PASSES_H
ArrayRef<ReductionNode *> getNeighbors(ReductionNode *node);
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_REDUCER_REDUCTIONNODE_H
DialectReductionPatternInterface(Dialect *dialect) : Base(dialect) {}
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_REDUCER_REDUCTIONPATTERNINTERFACE_H
ArrayRef<std::string> testScriptArgs;
};
-} // end namespace mlir
+} // namespace mlir
#endif
namespace mlir {
namespace detail {
class PDLByteCode;
-} // end namespace detail
+} // namespace detail
/// This class represents a frozen set of patterns that can be processed by a
/// pattern applicator. This class is designed to enable caching pattern lists
std::shared_ptr<Impl> impl;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_REWRITE_FROZENREWRITEPATTERNSET_H
namespace detail {
class PDLByteCodeMutableState;
-} // end namespace detail
+} // namespace detail
/// This class manages the application of a group of rewrite patterns, with a
/// user-provided cost model.
std::unique_ptr<detail::PDLByteCodeMutableState> mutableByteCodeState;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_REWRITE_PATTERNAPPLICATOR_H
friend class DebugActionManager;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_SUPPORT_DEBUGACTION_H
SmallVector<std::pair<TypeID, void *>> interfaces;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif
template <typename Fn> class function_ref;
template <typename IteratorT> class iterator_range;
class raw_ostream;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
// Casting operators.
assert((lcm >= a && lcm >= b) && "LCM overflow");
return lcm;
}
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_SUPPORT_MATHEXTRAS_H_
namespace llvm {
class raw_ostream;
class MemoryBuffer;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
class DialectRegistry;
return r.succeeded() ? EXIT_SUCCESS : EXIT_FAILURE;
}
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_SUPPORT_MLIROPTMAIN_H
return DenseMapInfo<DerivedKey>::getHashValue(derivedKey);
}
};
-} // end namespace mlir
+} // namespace mlir
#endif
/// this object.
llvm::sys::SmartMutex<true> instanceMutex;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_SUPPORT_THREADLOCALCACHE_H
return detail::TypeIDExported::get<Trait>();
}
-} // end namespace mlir
+} // namespace mlir
// Declare/define an explicit specialization for TypeID: this forces the
// compiler to emit a strong definition for a class and controls which
static constexpr int NumLowBitsAvailable = 3;
};
-} // end namespace llvm
+} // namespace llvm
#endif // MLIR_SUPPORT_TYPEID_H
namespace llvm {
class StringRef;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
// Operation argument: either attribute or operand
using Argument = llvm::PointerUnion<NamedAttribute *, NamedTypeConstraint *>;
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_ARGUMENT_H_
using AttrOrTypeDef::AttrOrTypeDef;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_ATTRORTYPEDEF_H
namespace llvm {
class DefInit;
class Record;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
// Name of infer type op interface.
extern const char *inferTypeOpInterface;
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_ATTRIBUTE_H_
class Init;
class Record;
class SMLoc;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
SmallVector<Parameter> parameters;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_BUILDER_H_
SmallVector<MemberInitializer> initializers;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
/// The OR of two method properties should return method properties. Ensure that
/// this function is visible to `Class`.
~NamespaceEmitter() {
for (StringRef ns : llvm::reverse(namespaces))
- os << "} // end namespace " << ns << "\n";
+ os << "} // namespace " << ns << "\n";
}
private:
: std::string();
}
};
-} // end namespace detail
+} // namespace detail
/// Generically convert a value to a std::string.
template <typename T> std::string stringify(T &&t) {
namespace llvm {
class Record;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
std::vector<std::string> entities;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_CONSTRAINT_H_
namespace llvm {
class Record;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
const llvm::Record *def;
std::vector<StringRef> dependentDialects;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_DIALECT_H_
return FmtStrVecObject(fmt, ctx, params);
}
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_FORMAT_H_
namespace llvm {
class RecordKeeper;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
GenRegistration(StringRef arg, StringRef description, GenFunction function);
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TABLEGEN_GENINFO_H_
void printOptionInfo(const llvm::cl::Option &O,
size_t GlobalWidth) const override;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TABLEGEN_GENNAMEPARSER_H_
namespace llvm {
class Init;
class Record;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
static bool classof(const Interface *interface);
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_INTERFACES_H_
class DefInit;
class Record;
class StringInit;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
bool allResultsHaveKnownTypes;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_OPERATOR_H_
namespace llvm {
class Record;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
std::vector<PassStatistic> statistics;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_PASS_H_
class DagInit;
class Init;
class Record;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
RecordOperatorMap *recordOpMap;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
namespace llvm {
template <>
return lhs.def == rhs.def;
}
};
-} // end namespace llvm
+} // namespace llvm
#endif // MLIR_TABLEGEN_PATTERN_H_
class ListInit;
class Record;
class SMLoc;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
StringRef getSuffix() const;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_PREDICATE_H_
Region constraint;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_REGION_H_
static bool classof(const Trait *t);
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_SIDEEFFECTS_H_
Successor constraint;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_SUCCESSOR_H_
namespace llvm {
class Init;
class Record;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
std::vector<StringRef> getAlwaysDeclaredMethods() const;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_TRAIT_H_
namespace llvm {
class DefInit;
class Record;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
Dialect getDialect() const;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TABLEGEN_TYPE_H_
namespace detail {
class DebugTranslation;
-} // end namespace detail
+} // namespace detail
class LLVMFuncOp;
OwningOpRef<spirv::ModuleOp> deserialize(ArrayRef<uint32_t> binary,
MLIRContext *context);
-} // end namespace spirv
-} // end namespace mlir
+} // namespace spirv
+} // namespace mlir
#endif // MLIR_TARGET_SPIRV_DESERIALIZATION_H
/// Encodes an SPIR-V `literal` string into the given `binary` vector.
LogicalResult encodeStringLiteralInto(SmallVectorImpl<uint32_t> &binary,
StringRef literal);
-} // end namespace spirv
-} // end namespace mlir
+} // namespace spirv
+} // namespace mlir
#endif // MLIR_TARGET_SPIRV_BINARY_UTILS_H_
LogicalResult serialize(ModuleOp module, SmallVectorImpl<uint32_t> &binary,
bool emitDebugInfo = false);
-} // end namespace spirv
-} // end namespace mlir
+} // namespace spirv
+} // namespace mlir
#endif // MLIR_TARGET_SPIRV_SERIALIZATION_H
LogicalResult MlirLspServerMain(int argc, char **argv,
DialectRegistry ®istry);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TOOLS_MLIRLSPSERVER_MLIRLSPSERVERMAIN_H
LogicalResult mlirReduceMain(int argc, char **argv, MLIRContext &context);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TOOLS_MLIRREDUCE_MLIRREDUCEMAIN_H
// dependence to the memref dialect for this.
DenseMap<Attribute, Operation *> globals;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_BUFFERUTILS_H
namespace detail {
struct ConversionPatternRewriterImpl;
-} // end namespace detail
+} // namespace detail
/// This class implements a pattern rewriter for use with ConversionPatterns. It
/// extends the base PatternRewriter and provides special conversion specific
const FrozenRewritePatternSet &patterns,
DenseSet<Operation *> &convertedOps,
function_ref<void(Diagnostic &)> notifyCallback = nullptr);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_DIALECTCONVERSION_H_
DialectInterfaceCollection<DialectFoldInterface> interfaces;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_FOLDUTILS_H
const FrozenRewritePatternSet &patterns,
bool strict);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_GREEDYPATTERNREWRITEDRIVER_H_
CallableOpInterface callable, Region *src,
bool shouldCloneInlinedRegion = true);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_INLINING_UTILS_H
/// Overload utilizing pass options for initialization.
std::unique_ptr<Pass> createLocationSnapshotPass();
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_LOCATIONSNAPSHOT_H
void gatherProducerConsumerMemrefs(ArrayRef<Operation *> srcOps,
ArrayRef<Operation *> dstOps,
DenseSet<Value> &producerConsumerMemrefs);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_LOOP_FUSION_UTILS_H
namespace scf {
class ForOp;
class ParallelOp;
-} // end namespace scf
+} // namespace scf
/// Unrolls this for operation completely if the trip count is known to be
/// constant. Returns failure otherwise.
/// Move loop invariant code out of `looplike`.
LogicalResult moveLoopInvariantCode(LoopLikeOpInterface looplike);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_LOOP_UTILS_H
#define GEN_PASS_REGISTRATION
#include "mlir/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_PASSES_H
namespace memref {
class AllocOp;
-} // end namespace memref
+} // namespace memref
/// Replaces all "dereferencing" uses of `oldMemRef` with `newMemRef` while
/// optionally remapping the old memref's indices using the supplied affine map,
void createAffineComputationSlice(Operation *opInst,
SmallVectorImpl<AffineApplyOp> *sliceOps);
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_UTILS_H
std::unique_ptr<Pass>
createPrintOpGraphPass(raw_ostream &os = llvm::errs());
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_TRANSFORMS_VIEWOPGRAPH_H_
}
};
-} // end anonymous namespace
+} // namespace
// Flattens the expressions in map. Returns failure if 'expr' was unable to be
// flattened (i.e., semi-affine expressions not handled yet).
/// A symbol table used for O(1) symbol lookups during simplification.
SymbolTableCollection symbolTable;
};
-} // end anonymous namespace
+} // namespace
ForwardDataFlowSolver::ForwardDataFlowSolver(
ForwardDataFlowAnalysisBase &analysis, Operation *op)
return isa<AffineLoadOp, AffineStoreOp>(op);
}
-} // end namespace matcher
-} // end namespace mlir
+} // namespace matcher
+} // namespace mlir
Direction flippedDirection(Direction direction) {
return direction == Direction::Up ? Direction::Down : Simplex::Direction::Up;
}
-} // anonymous namespace
+} // namespace
/// Find a pivot to change the sample value of the row in the specified
/// direction. The returned pivot row will involve `row` if and only if the
std::vector<py::object> referencedObjects;
};
-} // anonymous namespace
+} // namespace
/// Create the `mlir.execution_engine` module here.
PYBIND11_MODULE(_mlirExecutionEngine, m) {
private:
PyAffineMap affineMap;
};
-} // end namespace
+} // namespace
bool PyAffineMap::operator==(const PyAffineMap &other) {
return mlirAffineMapEqual(affineMap, other.affineMap);
PyOperationRef operation;
};
-} // end namespace
+} // namespace
//------------------------------------------------------------------------------
// Populates the core exports of the 'ir' submodule.
MlirPassManager passManager;
};
-} // anonymous namespace
+} // namespace
/// Create the `mlir.passmanager` here.
void mlir::python::populatePassManagerSubmodule(py::module &m) {
}
};
-} // end namespace
+} // namespace
void mlir::populateAffineToStdConversionPatterns(RewritePatternSet &patterns) {
// clang-format off
ConversionPatternRewriter &rewriter) const override;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// ConstantOpLowering
signalPassFailure();
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Pattern Population
ConversionPatternRewriter &rewriter) const override;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Conversion Helpers
signalPassFailure();
}
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::arith::createConvertArithmeticToSPIRVPass() {
return std::make_unique<ConvertArithmeticToSPIRVPass>();
}
};
-} // anonymous namespace
+} // namespace
void mlir::configureGpuToNVVMConversionLegality(ConversionTarget &target) {
target.addIllegalOp<FuncOp>();
}
};
-} // anonymous namespace
+} // namespace
namespace mlir {
}
};
-} // anonymous namespace
+} // namespace
void mlir::configureGpuToROCDLConversionLegality(ConversionTarget &target) {
target.addIllegalOp<FuncOp>();
static constexpr unsigned kVulkanLaunchNumConfigOperands = 3;
};
-} // anonymous namespace
+} // namespace
void ConvertGpuLaunchFuncToVulkanLaunchFunc::runOnOperation() {
bool done = false;
static constexpr unsigned kVulkanLaunchNumConfigOperands = 3;
};
-} // anonymous namespace
+} // namespace
void VulkanLaunchFuncToVulkanCallsPass::runOnOperation() {
initializeCachedTypes();
/// generated operations.
SetVector<Value> locOps;
};
-} // end anonymous namespace
+} // namespace
PatternLowering::PatternLowering(FuncOp matcherFunc, ModuleOp rewriterModule)
: builder(matcherFunc.getContext()), matcherFunc(matcherFunc),
TypeAnswer,
UnsignedAnswer,
};
-} // end namespace Predicates
+} // namespace Predicates
/// Base class for all predicates, used to allow efficient pointer comparison.
template <typename ConcreteT, typename BaseT, typename Key,
MLIRContext *ctx;
};
-} // end namespace pdl_to_pdl_interp
-} // end namespace mlir
+} // namespace pdl_to_pdl_interp
+} // namespace mlir
#endif // MLIR_CONVERSION_PDLTOPDLINTERP_PREDICATE_H_
Value root;
DenseSet<OrderedPredicate *> predicates;
};
-} // end anonymous namespace
+} // namespace
/// Returns true if the given matcher refers to the same predicate as the given
/// ordered predicate. This means that the position and questions of the two
ChildMapT children;
};
-} // end namespace pdl_to_pdl_interp
-} // end namespace mlir
+} // namespace pdl_to_pdl_interp
+} // namespace mlir
#endif // MLIR_CONVERSION_PDLTOPDLINTERP_PREDICATETREE_H_
DenseMap<Value, Value> parents;
};
-} // end namespace pdl_to_pdl_interp
-} // end namespace mlir
+} // namespace pdl_to_pdl_interp
+} // namespace mlir
#endif // MLIR_CONVERSION_PDLTOPDLINTERP_ROOTORDERING_H_
namespace acc {
class OpenACCDialect;
-} // end namespace acc
+} // namespace acc
namespace arith {
class ArithmeticDialect;
-} // end namespace arith
+} // namespace arith
namespace complex {
class ComplexDialect;
-} // end namespace complex
+} // namespace complex
namespace gpu {
class GPUDialect;
class GPUModuleOp;
-} // end namespace gpu
+} // namespace gpu
namespace LLVM {
class LLVMDialect;
-} // end namespace LLVM
+} // namespace LLVM
namespace NVVM {
class NVVMDialect;
-} // end namespace NVVM
+} // namespace NVVM
namespace math {
class MathDialect;
-} // end namespace math
+} // namespace math
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
namespace omp {
class OpenMPDialect;
-} // end namespace omp
+} // namespace omp
namespace pdl_interp {
class PDLInterpDialect;
-} // end namespace pdl_interp
+} // namespace pdl_interp
namespace ROCDL {
class ROCDLDialect;
-} // end namespace ROCDL
+} // namespace ROCDL
namespace scf {
class SCFDialect;
-} // end namespace scf
+} // namespace scf
namespace spirv {
class SPIRVDialect;
-} // end namespace spirv
+} // namespace spirv
namespace tensor {
class TensorDialect;
-} // end namespace tensor
+} // namespace tensor
namespace tosa {
class TosaDialect;
-} // end namespace tosa
+} // namespace tosa
namespace vector {
class VectorDialect;
-} // end namespace vector
+} // namespace vector
namespace arm_neon {
class ArmNeonDialect;
-} // end namespace arm_neon
+} // namespace arm_neon
#define GEN_PASS_CLASSES
#include "mlir/Conversion/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // CONVERSION_PASSDETAIL_H_
}
};
-} // end namespace
+} // namespace
std::unique_ptr<OperationPass<ModuleOp>> mlir::createConvertSCFToOpenMPPass() {
return std::make_unique<SCFToOpenMPPass>();
}
};
-} // end namespace spirv
-} // end namespace mlir
+} // namespace spirv
+} // namespace mlir
#endif // MLIR_CONVERSION_SPIRVCOMMON_PATTERN_H
StringAttr::get(m.getContext(), this->dataLayout));
}
};
-} // end namespace
+} // namespace
std::unique_ptr<OperationPass<ModuleOp>> mlir::createLowerToLLVMPass() {
return std::make_unique<LLVMLoweringPass>();
vecTy, dwordConfig, int32Zero, int32Zero, int1False, int1False);
}
};
-} // end anonymous namespace
+} // namespace
void mlir::populateVectorToROCDLConversionPatterns(
LLVMTypeConverter &converter, RewritePatternSet &patterns) {
/// Affine regions should be analyzed recursively.
bool shouldAnalyzeRecursively(Operation *op) const final { return true; }
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// AffineDialect
ArrayRef<Value> mapOperands) const {
rewriter.replaceOpWithNewOp<AffineOpTy>(op, map, mapOperands);
}
-} // end anonymous namespace.
+} // namespace
void AffineApplyOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
return success();
}
};
-} // end anonymous namespace
+} // namespace
void AffineForOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
return success();
}
};
-} // end anonymous namespace.
+} // namespace
static LogicalResult verify(AffineIfOp op) {
// Verify that we have a condition attribute.
Value zeroIndex = nullptr;
};
-} // end anonymous namespace
+} // namespace
/// Generates copies for memref's living in 'slowMemorySpace' into newly created
/// buffers in 'fastMemorySpace', and replaces memory operations to the former
void runOnFunction() override;
void runOnAffineForOp(AffineForOp forOp);
};
-} // end anonymous namespace
+} // namespace
static bool
checkInvarianceOfNestedIfOps(Operation *op, Value indVar, ValueRange iterArgs,
PostDominanceInfo &postDominanceInfo);
};
-} // end anonymous namespace
+} // namespace
/// Creates a pass to perform optimizations relying on memref dataflow such as
/// store to load forwarding, elimination of dead stores, and dead allocs.
bool avoidMaxMinBounds = true;
};
-} // end anonymous namespace
+} // namespace
/// Creates a pass to perform loop tiling on all suitable loop nests of a
/// Function.
/// Unroll this for op. Returns failure if nothing was done.
LogicalResult runOnAffineForOp(AffineForOp forOp);
};
-} // end anonymous namespace
+} // namespace
/// Returns true if no other affine.for ops are nested within.
static bool isInnermostAffineForOp(AffineForOp forOp) {
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<OperationPass<FuncOp>>
mlir::createLoopUnrollAndJamPass(int unrollJamFactor) {
namespace linalg {
class LinalgDialect;
-} // end namespace linalg
+} // namespace linalg
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
namespace vector {
class VectorDialect;
-} // end namespace vector
+} // namespace vector
#define GEN_PASS_CLASSES
#include "mlir/Dialect/Affine/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_AFFINE_TRANSFORMS_PASSDETAIL_H_
DenseMap<Attribute, Attribute> simplifiedAttributes;
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<OperationPass<FuncOp>>
mlir::createSimplifyAffineStructuresPass() {
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
Vectorize::Vectorize(ArrayRef<int64_t> virtualVectorSize) {
vectorSizes = virtualVectorSize;
void registerValueScalarReplacementImpl(Value replaced, Value replacement);
};
-} // end namespace
+} // namespace
/// Registers the vector replacement of a scalar operation and its result
/// values. Both operations must have the same number of results.
return true;
}
};
-} // end anonymous namespace
+} // namespace
void arith::ArithmeticDialect::initialize() {
addOperations<
namespace {
#include "ArithmeticCanonicalization.inc"
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// ConstantOp
}
};
-} // end anonymous namespace
+} // namespace
void mlir::arith::populateArithmeticBufferizePatterns(
bufferization::BufferizeTypeConverter &typeConverter,
}
};
-} // end anonymous namespace
+} // namespace
void mlir::arith::populateArithmeticExpandOpsPatterns(
RewritePatternSet &patterns) {
namespace bufferization {
class BufferizationDialect;
-} // end namespace bufferization
+} // namespace bufferization
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
#define GEN_PASS_CLASSES
#include "mlir/Dialect/Arithmetic/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_ARITHMETIC_TRANSFORMS_PASSDETAIL_H_
namespace arith {
class ArithmeticDialect;
-} // end namespace arith
+} // namespace arith
namespace async {
class AsyncDialect;
return true;
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Bufferization Dialect
}
};
-} // namespace.
+} // namespace
void CloneOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
MLIRContext *context) {
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// BufferDeallocationPass construction
namespace bufferization {
class BufferizationDialect;
-} // end namespace bufferization
+} // namespace bufferization
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
#define GEN_PASS_CLASSES
#include "mlir/Dialect/Bufferization/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_BUFFERIZATION_TRANSFORMS_PASSDETAIL_H_
}
};
-} // end anonymous namespace.
+} // namespace
void AllocOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
#define GEN_PASS_CLASSES
#include "mlir/Dialect/GPU/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_GPU_TRANSFORMS_PASSDETAIL_H_
std::string getRocmPath();
};
-} // end namespace
+} // namespace
SerializeToHsacoPass::SerializeToHsacoPass(const SerializeToHsacoPass &other)
: PassWrapper<SerializeToHsacoPass, gpu::SerializeToBlobPass>(other) {}
REGISTER_ENUM_TYPE(Linkage);
REGISTER_ENUM_TYPE(UnnamedAddr);
-} // end namespace
+} // namespace
/// Parse an enum from the keyword, or default to the provided default value.
/// The return type is the enum type by default, unless overriden with the
unsigned numElements;
};
-} // end namespace detail
-} // end namespace LLVM
-} // end namespace mlir
+} // namespace detail
+} // namespace LLVM
+} // namespace mlir
#endif // DIALECT_LLVMIR_IR_TYPEDETAIL_H
LLVM::ensureDistinctSuccessors(getOperation());
}
};
-} // end namespace
+} // namespace
std::unique_ptr<Pass> LLVM::createLegalizeForExportPass() {
return std::make_unique<LegalizeForExportPass>();
#define GEN_PASS_CLASSES
#include "mlir/Dialect/LLVMIR/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_LLVMIR_TRANSFORMS_PASSDETAIL_H_
ArrayRef<Value> valuesToRepl) const final {}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// LinalgDialect
signalPassFailure();
}
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<OperationPass<FuncOp>> mlir::createLinalgBufferizePass() {
return std::make_unique<LinalgBufferizePass>();
vector_ext::registerBufferizableOpInterfaceExternalModels(registry);
}
};
-} // end namespace
+} // namespace
static void applyEnablingTransformations(ModuleOp moduleOp) {
RewritePatternSet patterns(moduleOp.getContext());
namespace arith {
class ArithmeticDialect;
-} // end namespace arith
+} // namespace arith
namespace bufferization {
class BufferizationDialect;
-} // end namespace bufferization
+} // namespace bufferization
namespace linalg {
class LinalgDialect;
-} // end namespace linalg
+} // namespace linalg
namespace scf {
class SCFDialect;
-} // end namespace scf
+} // namespace scf
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
namespace vector {
class VectorDialect;
-} // end namespace vector
+} // namespace vector
#define GEN_PASS_CLASSES
#include "mlir/Dialect/Linalg/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_LINALG_TRANSFORMS_PASSDETAIL_H_
return true;
}
};
-} // end anonymous namespace
+} // namespace
void mlir::math::MathDialect::initialize() {
addOperations<
return true;
}
};
-} // end anonymous namespace
+} // namespace
void mlir::memref::MemRefDialect::initialize() {
addOperations<
return success();
}
};
-} // end anonymous namespace.
+} // namespace
void AllocOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
}
};
-} // end anonymous namespace.
+} // namespace
void DimOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
return Wrapper(ShapedType::kDynamicStrideOrOffset);
return Wrapper(a.v * b);
}
-} // end namespace saturated_arith
-} // end namespace
+} // namespace saturated_arith
+} // namespace
/// A subview result type can be fully inferred from the source type and the
/// static representation of offsets, sizes and strides. Special sentinels
}
};
-} // end anonymous namespace
+} // namespace
void ViewOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
return pointer.cast<T>().getElementType();
}
};
-} // end namespace
+} // namespace
void OpenMPDialect::initialize() {
addOperations<
PatternRewriter &rewriter) const override;
};
-} // end anonymous namespace
+} // namespace
/// Matches a [constant] -> [qbarrier] where the qbarrier results type is
/// quantized and the operand type is quantizable.
#define GEN_PASS_CLASSES
#include "mlir/Dialect/Quant/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_QUANT_TRANSFORMS_PASSDETAIL_H_
}
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// SCFDialect
return signalPassFailure();
};
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::createSCFBufferizePass() {
return std::make_unique<SCFBufferizePass>();
namespace arith {
class ArithmeticDialect;
-} // end namespace arith
+} // namespace arith
namespace bufferization {
class BufferizationDialect;
-} // end namespace bufferization
+} // namespace bufferization
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
namespace tensor {
class TensorDialect;
-} // end namespace tensor
+} // namespace tensor
#define GEN_PASS_CLASSES
#include "mlir/Dialect/SCF/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_LOOPOPS_TRANSFORMS_PASSDETAIL_H_
return success();
}
};
-} // end anonymous namespace
+} // namespace
void spirv::AccessChainOp::getCanonicalizationPatterns(
RewritePatternSet &results, MLIRContext *context) {
return success();
}
-} // end anonymous namespace
+} // namespace
void spirv::SelectionOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
namespace {
#include "SPIRVCanonicalization.inc"
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace spirv {
namespace spirv {
class ModuleOp;
-} // end namespace spirv
+} // namespace spirv
#define GEN_PASS_CLASSES
#include "mlir/Dialect/SPIRV/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_SPIRV_TRANSFORMS_PASSDETAIL_H_
SmallVectorImpl<spirv::CompositeInsertOp> &insertions);
};
-} // anonymous namespace
+} // namespace
void RewriteInsertsPass::runOnOperation() {
SmallVector<SmallVector<spirv::CompositeInsertOp, 4>, 4> workList;
namespace bufferization {
class BufferizationDialect;
-} // end namespace bufferization
+} // namespace bufferization
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
#define GEN_PASS_CLASSES
#include "mlir/Dialect/Shape/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_SHAPE_TRANSFORMS_PASSDETAIL_H_
}
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::createSparsificationPass() {
return std::make_unique<SparsificationPass>();
valuesToRepl[it.index()].replaceAllUsesWith(it.value());
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// StandardOpsDialect
return success(replaced);
}
};
-} // end anonymous namespace
+} // namespace
void CondBranchOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
return success();
}
};
-} // end anonymous namespace
+} // namespace
void mlir::populateCallOpTypeConversionPattern(RewritePatternSet &patterns,
TypeConverter &converter) {
private:
function_ref<bool(BranchOpInterface, int)> shouldConvertBranchOperand;
};
-} // end anonymous namespace
+} // namespace
namespace {
/// Only needed to support partial conversion of functions where this pattern
return success();
}
};
-} // end anonymous namespace
+} // namespace
void mlir::populateBranchOpInterfaceTypeConversionPattern(
RewritePatternSet &patterns, TypeConverter &typeConverter,
namespace bufferization {
class BufferizationDialect;
-} // end namespace bufferization
+} // namespace bufferization
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
#define GEN_PASS_CLASSES
#include "mlir/Dialect/StandardOps/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_STANDARD_TRANSFORMS_PASSDETAIL_H_
return true;
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// TensorDialect Methods
return success();
}
};
-} // end anonymous namespace.
+} // namespace
void DimOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
namespace bufferization {
class BufferizationDialect;
-} // end namespace bufferization
+} // namespace bufferization
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
namespace scf {
class SCFDialect;
-} // end namespace scf
+} // namespace scf
#define GEN_PASS_CLASSES
#include "mlir/Dialect/Tensor/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // DIALECT_TENSOR_TRANSFORMS_PASSDETAIL_H_
isa<tosa::WhileOp>(dest->getParentOp()));
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// TOSA control flow support.
(void)applyPatternsAndFoldGreedily(func, std::move(patterns));
}
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::tosa::createTosaDecomposeTransposeConvPass() {
return std::make_unique<TosaDecomposeTransposeConv>();
});
}
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::tosa::createTosaInferShapesPass() {
return std::make_unique<TosaInferShapes>();
return success();
}
};
-} // end anonymous namespace
+} // namespace
namespace {
/// Pass that enables broadcast by making all input arrays have the same
(void)applyPatternsAndFoldGreedily(func, std::move(patterns));
}
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::tosa::createTosaMakeBroadcastablePass() {
return std::make_unique<TosaMakeBroadcastable>();
}
};
-} // end anonymous namespace
+} // namespace
void ExtractStridedSliceOp::getCanonicalizationPatterns(
RewritePatternSet &results, MLIRContext *context) {
}
};
-} // end anonymous namespace
+} // namespace
void vector::TransposeOp::getCanonicalizationPatterns(
RewritePatternSet &results, MLIRContext *context) {
}
};
-} // end anonymous namespace
+} // namespace
void CreateMaskOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
runtimeSymbolMap;
};
-} // end anonymous namespace
+} // namespace
static OwningModuleRef parseMLIRInput(StringRef inputFilename,
MLIRContext *context) {
return tensor;
}
-} // anonymous namespace
+} // namespace
extern "C" {
int64_t constant;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif // MLIR_IR_AFFINEEXPRDETAIL_H_
ArrayRef<Attribute> operandConsts;
};
-} // end anonymous namespace
+} // namespace
/// Returns a single constant result affine map.
AffineMap AffineMap::getConstantMap(int64_t val, MLIRContext *context) {
}
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif // AFFINEMAPDETAIL_H_
llvm::cl::desc("Print assuming in local scope by default"),
llvm::cl::Hidden};
};
-} // end anonymous namespace
+} // namespace
static llvm::ManagedStatic<AsmPrinterOptions> clOptions;
++newLine.curLine;
return os << '\n';
}
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// AliasInitializer
/// A dummy output stream.
mutable llvm::raw_null_ostream os;
};
-} // end anonymous namespace
+} // namespace
/// Sanitize the given name such that it can be used as a valid identifier. If
/// the string needs to be modified in any way, the provided buffer is used to
/// An allocator used for alias names.
llvm::BumpPtrAllocator aliasAllocator;
};
-} // end anonymous namespace
+} // namespace
void AliasState::initialize(
Operation *op, const OpPrintingFlags &printerFlags,
DialectInterfaceCollection<OpAsmDialectInterface> &interfaces;
};
-} // end anonymous namespace
+} // namespace
SSANameState::SSANameState(
Operation *op, const OpPrintingFlags &printerFlags,
/// An optional location map to be populated.
AsmState::LocationMap *locationMap;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
AsmState::AsmState(Operation *op, const OpPrintingFlags &printerFlags,
LocationMap *locationMap)
// This is the current indentation level for nested structures.
unsigned currentIndent = 0;
};
-} // end anonymous namespace
+} // namespace
void OperationPrinter::printTopLevelOperation(Operation *op) {
// Output the aliases at the top level that can't be deferred.
return AliasResult::NoAlias;
}
};
-} // end anonymous namespace.
+} // namespace
void BuiltinDialect::initialize() {
registerTypes();
/// Mapping between file name and buffer ID's.
llvm::StringMap<unsigned> filenameToBufId;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
/// Return a processable FileLineColLoc from the given location.
static Optional<FileLineColLoc> getFileLineColLoc(Location loc) {
llvm::Regex expected = llvm::Regex("expected-(error|note|remark|warning) "
"*(@([+-][0-9]+|above|below))? *{{(.*)}}");
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
/// Given a diagnostic kind, return a human readable string for it.
static StringRef getDiagKindStr(DiagnosticSeverity kind) {
/// The context to emit the diagnostics to.
MLIRContext *context;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
ParallelDiagnosticHandler::ParallelDiagnosticHandler(MLIRContext *ctx)
: impl(new ParallelDiagnosticHandlerImpl(ctx)) {}
}
/// Utility function that returns if the given string is a valid dialect
-/// namespace.
+/// namespace
bool Dialect::isValidNamespace(StringRef str) {
llvm::Regex dialectNameRegex("^[a-zA-Z_][a-zA-Z_0-9\\$]*$");
return dialectNameRegex.match(str);
}
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif // INTEGERSETDETAIL_H_
llvm::cl::desc("When a diagnostic is emitted, also print the stack trace "
"as an attached note")};
};
-} // end anonymous namespace
+} // namespace
static llvm::ManagedStatic<MLIRContextOptions> clOptions;
}
llvm::sys::SmartRWMutex<true> *mutex;
};
-} // end anonymous namespace.
+} // namespace
//===----------------------------------------------------------------------===//
// MLIRContextImpl
attrMapping.second->~AbstractAttribute();
}
};
-} // end namespace mlir
+} // namespace mlir
MLIRContext::MLIRContext(Threading setting)
: MLIRContext(DialectRegistry(), setting) {}
/// The IR unit representing this scope.
llvm::PointerUnion<Operation *, Region *> limit;
};
-} // end anonymous namespace
+} // namespace
/// Collect all of the symbol scopes from 'symbol' to (inclusive) 'limit'.
static SmallVector<SymbolScope, 2> collectSymbolScopes(Operation *symbol,
LogicalResult verifyDominanceOfContainedRegions(Operation &op,
DominanceInfo &domInfo);
};
-} // end anonymous namespace
+} // namespace
LogicalResult OperationVerifier::verifyOpAndDominance(Operation &op) {
SmallVector<Operation *> opsWithIsolatedRegions;
unsigned numSymbolOperands;
SmallVector<std::pair<StringRef, AffineExpr>, 4> dimsAndSymbols;
};
-} // end anonymous namespace
+} // namespace
/// Create an affine binary high precedence op expression (mul's, div's, mod).
/// opLoc is the location of the op token to be used to report errors
bool emittedError = false;
};
} // namespace detail
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_LIB_PARSER_ASMPARSERIMPL_H
/// Storage used when parsing elements that were stored as hex values.
Optional<Token> hexStorage;
};
-} // end anonymous namespace
+} // namespace
/// Parse the elements of a tensor literal. If 'allowHex' is true, the parser
/// may also parse a tensor literal that is store as a hex string.
void operator=(const Lexer &) = delete;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_LIB_PARSER_LEXER_H
/// The top level operation that holds all of the parsed operations.
Operation *topLevelOp;
};
-} // end anonymous namespace
+} // namespace
OperationParser::OperationParser(ParserState &state, ModuleOp topLevelOp)
: Parser(state), opBuilder(topLevelOp.getRegion()), topLevelOp(topLevelOp) {
/// The backing operation parser.
OperationParser &parser;
};
-} // end anonymous namespace.
+} // namespace
FailureOr<OperationName> OperationParser::parseCustomOperationName() {
std::string opName = getTokenSpelling().str();
/// Parse an attribute alias declaration.
ParseResult parseTypeAliasDef();
};
-} // end anonymous namespace
+} // namespace
/// Parses an attribute alias declaration.
///
/// non-trivial state here, add it to the ParserState class.
ParserState &state;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif // MLIR_LIB_PARSER_PARSER_H
SmallVector<StringRef> defaultDialectStack{"builtin"};
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif // MLIR_LIB_PARSER_PARSERSTATE_H
StringRef spelling;
};
-} // end namespace mlir
+} // namespace mlir
#endif // MLIR_LIB_PARSER_TOKEN_H
/// configuration asked for change detection.
DenseMap<Pass *, OperationFingerPrint> beforePassFingerPrints;
};
-} // end anonymous namespace
+} // namespace
static void printIR(Operation *op, bool printModuleScope, raw_ostream &out,
OpPrintingFlags flags) {
/// The stream to output to.
raw_ostream &out;
};
-} // end anonymous namespace
+} // namespace
/// Add an instrumentation to print the IR before and after pass execution,
/// using the provided configuration.
/// OpPassManager.
OpPassManager::Nesting nesting;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
void OpPassManagerImpl::mergeInto(OpPassManagerImpl &rhs) {
assert(name == rhs.name && "merging unrelated pass managers");
/// Set of registered instrumentations.
std::vector<std::unique_ptr<PassInstrumentation>> instrumentations;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
PassInstrumentor::PassInstrumentor() : impl(new PassInstrumentorImpl()) {}
PassInstrumentor::~PassInstrumentor() {}
/// The generator used to create crash reproducers.
PassCrashReproducerGenerator &generator;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// FileReproducerStream
/// ToolOutputFile corresponding to opened `filename`.
std::unique_ptr<llvm::ToolOutputFile> outputFile = nullptr;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// PassManager
std::unique_ptr<Impl> impl;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif // MLIR_PASS_PASSDETAIL_H_
clEnumValN(PassDisplayMode::Pipeline, "pipeline",
"display the results with a nested pipeline view"))};
};
-} // end anonymous namespace
+} // namespace
static llvm::ManagedStatic<PassManagerOptions> options;
std::vector<PipelineElement> pipeline;
};
-} // end anonymous namespace
+} // namespace
/// Try to initialize this pipeline with the given pipeline text. An option is
/// given to enable accurate error reporting.
/// pipeline.
TextualPipeline pipeline;
};
-} // end anonymous namespace
+} // namespace
namespace llvm {
namespace cl {
PassArgData value;
};
-} // end namespace cl
-} // end namespace llvm
+} // namespace cl
+} // namespace llvm
namespace {
/// The set of passes and pass pipelines to run.
llvm::cl::list<PassArgData, bool, PassNameParser> passList;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
/// Construct a pass pipeline parser with the given command line description.
PassPipelineCLParser::PassPipelineCLParser(StringRef arg, StringRef description)
const char *name, *desc;
unsigned value;
};
-} // end anonymous namespace
+} // namespace
/// Utility to print a pass entry in the statistics output.
static void printPassEntry(raw_ostream &os, unsigned indent, StringRef pass,
void runOnOperation() override;
};
-} // end anonymous namespace
+} // namespace
/// Runs the pass instance in the pass pipeline.
void OptReductionPass::runOnOperation() {
FrozenRewritePatternSet reducerPatterns;
};
-} // end anonymous namespace
+} // namespace
LogicalResult ReductionTreePass::initialize(MLIRContext *context) {
RewritePatternSet patterns(context);
/// Compare a range of types with a set of constants.
SwitchTypes,
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// ByteCode Generation
/// The value range storage index for this range.
Optional<unsigned> valueRangeIndex;
};
-} // end anonymous namespace
+} // namespace
void Generator::generate(ModuleOp module) {
FuncOp matcherFunc = module.lookupSymbol<FuncOp>(
return allocatedValueRanges;
}
};
-} // end anonymous namespace
+} // namespace
void ByteCodeExecutor::executeApplyConstraint(PatternRewriter &rewriter) {
LLVM_DEBUG(llvm::dbgs() << "Executing ApplyConstraint:\n");
namespace mlir {
namespace pdl_interp {
class RecordMatchOp;
-} // end namespace pdl_interp
+} // namespace pdl_interp
namespace detail {
class PDLByteCode;
ByteCodeField maxLoopLevel = 0;
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
#endif // MLIR_REWRITE_BYTECODE_H_
llvm::cl::desc("Print out debug counter information after all counters "
"have been accumulated")};
};
-} // end anonymous namespace
+} // namespace
static llvm::ManagedStatic<DebugCounterOptions> clOptions;
function_ref<void(BaseStorage *)> destructorFn;
#endif
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace detail {
/// Flag specifying if multi-threading is enabled within the uniquer.
bool threadingIsEnabled = true;
};
-} // end namespace detail
+} // namespace detail
} // namespace mlir
StorageUniquer::StorageUniquer() : impl(new StorageUniquerImpl()) {}
clEnumValN(DisplayMode::Tree, "tree",
"display the results ina with a nested tree view"))};
};
-} // end anonymous namespace
+} // namespace
static llvm::ManagedStatic<DefaultTimingManagerOptions> options;
}
return os;
}
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
//===----------------------------------------------------------------------===//
// ParentClass definitions
std::string prefix;
std::string suffix;
};
-} // end anonymous namespace
+} // namespace
// Get a predicate tree node kind based on the kind used in the predicate
// TableGen record.
namespace {
// Substitution<pattern, replacement>.
using Subst = std::pair<StringRef, StringRef>;
-} // end anonymous namespace
+} // namespace
/// Perform the given substitutions on 'str' in-place.
static void performSubstitutions(std::string &str,
llvm::DICompileUnit *compileUnit;
};
-} // end namespace detail
-} // end namespace LLVM
-} // end namespace mlir
+} // namespace detail
+} // namespace LLVM
+} // namespace mlir
#endif // MLIR_LIB_TARGET_LLVMIR_DEBUGTRANSLATION_H_
return failure();
}
};
-} // end namespace
+} // namespace
void mlir::registerAMXDialectTranslation(DialectRegistry ®istry) {
registry.insert<amx::AMXDialect>();
return failure();
}
};
-} // end namespace
+} // namespace
void mlir::registerArmNeonDialectTranslation(DialectRegistry ®istry) {
registry.insert<arm_neon::ArmNeonDialect>();
return failure();
}
};
-} // end namespace
+} // namespace
void mlir::registerArmSVEDialectTranslation(DialectRegistry ®istry) {
registry.insert<arm_sve::ArmSVEDialect>();
return convertOperationImpl(*op, builder, moduleTranslation);
}
};
-} // end namespace
+} // namespace
void mlir::registerLLVMDialectTranslation(DialectRegistry ®istry) {
registry.insert<LLVM::LLVMDialect>();
return success();
}
};
-} // end namespace
+} // namespace
void mlir::registerNVVMDialectTranslation(DialectRegistry ®istry) {
registry.insert<NVVM::NVVMDialect>();
LLVM::ModuleTranslation &moduleTranslation) const final;
};
-} // end namespace
+} // namespace
/// Given an OpenACC MLIR operation, create the corresponding LLVM IR
/// (including OpenACC runtime calls).
LLVM::ModuleTranslation &moduleTranslation) const final;
};
-} // end namespace
+} // namespace
/// Given an OpenMP MLIR operation, create the corresponding LLVM IR
/// (including OpenMP runtime calls).
return success();
}
};
-} // end namespace
+} // namespace
void mlir::registerROCDLDialectTranslation(DialectRegistry ®istry) {
registry.insert<ROCDL::ROCDLDialect>();
return failure();
}
};
-} // end namespace
+} // namespace
void mlir::registerX86VectorDialectTranslation(DialectRegistry ®istry) {
registry.insert<x86vector::X86VectorDialect>();
MLIRContext &context;
};
-} // end namespace detail
-} // end namespace LLVM
-} // end namespace mlir
+} // namespace detail
+} // namespace LLVM
+} // namespace mlir
LLVM::TypeFromLLVMIRTranslator::TypeFromLLVMIRTranslator(MLIRContext &context)
: impl(new detail::TypeFromLLVMIRTranslatorImpl(context)) {}
/// type instead of creating a new type.
llvm::DenseMap<Type, llvm::Type *> knownTranslations;
};
-} // end namespace detail
-} // end namespace LLVM
-} // end namespace mlir
+} // namespace detail
+} // namespace LLVM
+} // namespace mlir
LLVM::TypeToLLVMIRTranslator::TypeToLLVMIRTranslator(llvm::LLVMContext &context)
: impl(new detail::TypeToLLVMIRTranslatorImpl(context)) {}
std::function<bool(Value)> isSmallAlloc;
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::createBufferHoistingPass() {
return std::make_unique<BufferHoistingPass>();
return signalPassFailure();
}
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::createBufferResultsToOutParamsPass() {
return std::make_unique<BufferResultsToOutParamsPass>();
OperationEquivalence::IgnoreLocations);
}
};
-} // end anonymous namespace
+} // namespace
namespace {
/// Simple common sub-expression elimination.
std::vector<Operation *> opsToErase;
DominanceInfo *domInfo = nullptr;
};
-} // end anonymous namespace
+} // namespace
/// Attempt to eliminate a redundant operation.
LogicalResult CSE::simplifyOperation(ScopedMapTy &knownValues, Operation *op,
GreedyRewriteConfig config;
FrozenRewritePatternSet patterns;
};
-} // end anonymous namespace
+} // namespace
/// Create a Canonicalizer pass.
std::unique_ptr<Pass> mlir::createCanonicalizerPass() {
/// A symbol table to use when resolving call lookups.
SymbolTableCollection &symbolTable;
};
-} // end anonymous namespace
+} // namespace
CGUseList::CGUseList(Operation *op, CallGraph &cg,
SymbolTableCollection &symbolTable)
std::vector<CallGraphNode *> nodes;
llvm::scc_iterator<const CallGraph *> &parentIterator;
};
-} // end anonymous namespace
+} // namespace
/// Run a given transformation over the SCCs of the callgraph in a bottom up
/// traversal.
CallOpInterface call;
CallGraphNode *sourceNode, *targetNode;
};
-} // end anonymous namespace
+} // namespace
/// Collect all of the callable operations within the given range of blocks. If
/// `traverseNestedCGNodes` is true, this will also collect call operations
/// during optimization.
SmallVector<llvm::StringMap<OpPassManager>, 8> opPipelines;
};
-} // end anonymous namespace
+} // namespace
InlinerPass::InlinerPass() : InlinerPass(defaultInlinerOptPipeline) {}
InlinerPass::InlinerPass(std::function<void(OpPassManager &)> defaultPipeline)
/// The printing flags to use when creating the snapshot.
OpPrintingFlags flags;
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<Pass> mlir::createLocationSnapshotPass(OpPrintingFlags flags,
StringRef fileName,
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<OperationPass<FuncOp>>
mlir::createLoopFusionPass(unsigned fastMemorySpace,
}
}
-} // end anonymous namespace
+} // namespace
// Initializes the data dependence graph by walking operations in 'f'.
// Assigns each node in the graph a node id based on program order in 'f'.
}
};
-} // end anonymous namespace
+} // namespace
void LoopFusion::runOnFunction() {
MemRefDependenceGraph g;
: public LoopInvariantCodeMotionBase<LoopInvariantCodeMotion> {
void runOnOperation() override;
};
-} // end anonymous namespace
+} // namespace
// Checks whether the given op can be hoisted by checking that
// - the op and any of its contained operations do not depend on SSA values
Operation *createOpResultsNormalized(FuncOp funcOp, Operation *oldOp);
};
-} // end anonymous namespace
+} // namespace
std::unique_ptr<OperationPass<ModuleOp>> mlir::createNormalizeMemRefsPass() {
return std::make_unique<NormalizeMemRefs>();
namespace arith {
class ArithmeticDialect;
-} // end namespace arith
+} // namespace arith
namespace memref {
class MemRefDialect;
-} // end namespace memref
+} // namespace memref
namespace bufferization {
class BufferizationDialect;
#define GEN_PASS_CLASSES
#include "mlir/Transforms/Passes.h.inc"
-} // end namespace mlir
+} // namespace mlir
#endif // TRANSFORMS_PASSDETAIL_H_
std::vector<AffineForOp> forOps;
};
-} // end anonymous namespace
+} // namespace
/// Creates a pass to pipeline explicit movement of data across levels of the
/// memory hierarchy.
struct SCCP : public SCCPBase<SCCP> {
void runOnOperation() override;
};
-} // end anonymous namespace
+} // namespace
void SCCP::runOnOperation() {
Operation *op = getOperation();
struct StripDebugInfo : public StripDebugInfoBase<StripDebugInfo> {
void runOnOperation() override;
};
-} // end anonymous namespace
+} // namespace
void StripDebugInfo::runOnOperation() {
auto unknownLoc = UnknownLoc::get(&getContext());
bool symbolTableIsHidden,
DenseSet<Operation *> &liveSymbols);
};
-} // end anonymous namespace
+} // namespace
void SymbolDCE::runOnOperation() {
Operation *symbolTableOp = getOperation();
/// Current value mappings.
BlockAndValueMapping mapping;
};
-} // end anonymous namespace
+} // namespace
Value ConversionValueMapping::lookupOrDefault(Value from,
Type desiredType) const {
/// The original output type. This is only used for argument conversions.
Type origOutputType;
};
-} // end anonymous namespace
+} // namespace
/// Build an unresolved materialization operation given an output type and set
/// of input operands.
/// An ordered set of unresolved materializations during conversion.
SmallVectorImpl<UnresolvedMaterialization> &unresolvedMaterializations;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Rewrite Application
llvm::ScopedPrinter logger{llvm::dbgs()};
#endif
};
-} // end namespace detail
-} // end namespace mlir
+} // namespace detail
+} // namespace mlir
/// Detach any operations nested in the given operation from their parent
/// blocks, and erase the given operation. This can be used when the nested
/// *not* to be legalizable to the target.
DenseSet<Operation *> *trackedOps;
};
-} // end anonymous namespace
+} // namespace
LogicalResult OperationConverter::convert(ConversionPatternRewriter &rewriter,
Operation *op) {
return success();
}
};
-} // end anonymous namespace
+} // namespace
void mlir::populateFunctionLikeTypeConversionPattern(
StringRef functionLikeOpName, RewritePatternSet &patterns,
llvm::ScopedPrinter logger{llvm::dbgs()};
#endif
};
-} // end anonymous namespace
+} // namespace
GreedyPatternRewriteDriver::GreedyPatternRewriteDriver(
MLIRContext *ctx, const FrozenRewritePatternSet &patterns,
bool opErasedViaPatternRewrites = false;
};
-} // anonymous namespace
+} // namespace
/// Performs the rewrites and folding only on `op`. The simplification
/// converges if the op is erased as a result of being folded, replaced, or
llvm::SmallDenseSet<Operation *, 4> strictModeFilteredOps;
};
-} // end anonymous namespace
+} // namespace
/// Performs the specified rewrites on `ops` while also trying to fold these ops
/// as well as any other ops that were in turn created due to these rewrite
/// produced within the block before this operation.
DenseMap<Operation *, unsigned> opOrderIndex;
};
-} // end anonymous namespace
+} // namespace
BlockEquivalenceData::BlockEquivalenceData(Block *block)
: block(block), hash(0) {
/// replaced by arguments when the cluster gets merged.
std::set<std::pair<int, int>> operandsToMerge;
};
-} // end anonymous namespace
+} // namespace
LogicalResult BlockMergeCluster::addToCluster(BlockEquivalenceData &blockData) {
if (leaderData.hash != blockData.hash)
test_detail::tests().push_back(func);
}
};
-} // end namespace test_detail
+} // namespace test_detail
/// Declares a test function with the given name and adds it to the list of
/// known tests. The body of the function must follow immediately. Example:
llvm::errs() << ": " << result << "\n";
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Testing ModRefResult
llvm::errs() << ": " << result << "\n";
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Pass Registration
getAnalysis<CallGraph>().print(llvm::errs());
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
void TestMemRefBoundCheck::runOnFunction() {
getFunction().walk([](Operation *opInst) {
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
// Returns a result string which represents the direction vector (if there was
// a dependence), returns the string "false" otherwise.
}
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
/// Traverse AllocOp and compute strides of each MemRefType independently.
void TestMemRefStrideCalculation::runOnFunction() {
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
llvm::cl::init(false)};
};
-} // end anonymous namespace
+} // namespace
void TestAffineDataCopy::runOnFunction() {
// Gather all AffineForOps by loop depth.
}
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
/// Checks if the function enclosing the loop nest has any arguments passed to
/// it, which can be used as tiling parameters. Assumes that atleast 'n'
constexpr static unsigned kMaxIterations = 5;
};
-} // end anonymous namespace
+} // namespace
void TestAffineLoopUnswitching::runOnFunction() {
// Each hoisting invalidates a lot of IR around. Just stop the walk after the
llvm::cl::OneOrMore, llvm::cl::CommaSeparated};
};
-} // end anonymous namespace
+} // namespace
void TestLoopPermutation::runOnFunction() {
void testVecAffineLoopNest();
};
-} // end anonymous namespace
+} // namespace
void VectorizerTestPass::testVectorShapeRatio(llvm::raw_ostream &outs) {
auto f = getFunction();
}
}
};
-} // end namespace
+} // namespace
namespace mlir {
void registerTestGpuMemoryPromotionPass() {
if (failed(runPipeline(dynamicPM, funcOp)))
return signalPassFailure();
}
-} // end anonymous namespace
+} // namespace
// For now, just assume it is the zero of type.
// In the future, it should be the zero of type + op.
llvm::cl::desc("Test hoisting transfer_read/transfer_write pairs"),
llvm::cl::init(false)};
};
-} // end anonymous namespace
+} // namespace
void TestLinalgHoisting::runOnFunction() {
if (testHoistRedundantTransfers) {
"tiled_loop"),
llvm::cl::init("for")};
};
-} // end anonymous namespace
+} // namespace
static void applyPatterns(FuncOp funcOp) {
MLIRContext *ctx = funcOp.getContext();
return "Test math algebraic simplification";
}
};
-} // end anonymous namespace
+} // namespace
void TestMathAlgebraicSimplificationPass::runOnFunction() {
RewritePatternSet patterns(&getContext());
StringRef getArgument() const final { return "test-expand-tanh"; }
StringRef getDescription() const final { return "Test expanding tanh"; }
};
-} // end anonymous namespace
+} // namespace
void TestExpandTanhPass::runOnFunction() {
RewritePatternSet patterns(&getContext());
"X86Vector dialect"),
llvm::cl::init(false)};
};
-} // end anonymous namespace
+} // namespace
void TestMathPolynomialApproximationPass::runOnFunction() {
RewritePatternSet patterns(&getContext());
return "Test SPIR-V op availability";
}
};
-} // end anonymous namespace
+} // namespace
void PrintOpAvailability::runOnFunction() {
auto f = getFunction();
LogicalResult matchAndRewrite(Operation *op,
PatternRewriter &rewriter) const override;
};
-} // end anonymous namespace
+} // namespace
void ConvertToTargetEnv::runOnFunction() {
MLIRContext *context = &getContext();
return "Test pass to report associated shape functions";
}
};
-} // end anonymous namespace
+} // namespace
void ReportShapeFnPass::runOnOperation() {
auto module = getOperation();
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// TestDialect
return success();
}
};
-} // end anonymous namespace
+} // namespace
void FoldToCallOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) {
return success();
}
};
-} // end anonymous namespace
+} // namespace
void TestOpWithRegionPattern::getCanonicalizationPatterns(
RewritePatternSet &results, MLIRContext *context) {
struct TestResource : public SideEffects::Resource::Base<TestResource> {
StringRef getName() final { return "<Test>"; }
};
-} // end anonymous namespace
+} // namespace
static void testSideEffectOpGetEffect(
Operation *op,
namespace test {
void registerTestDialect(::mlir::DialectRegistry ®istry);
void populateTestReductionPatterns(::mlir::RewritePatternSet &patterns);
-} // end namespace test
+} // namespace test
#endif // MLIR_TESTDIALECT_H
namespace {
#include "TestPatterns.inc"
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Test Reduce Pattern Interface
(void)applyPatternsAndFoldGreedily(getFunction(), std::move(patterns));
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// ReturnType Driver.
}
}
};
-} // end anonymous namespace
+} // namespace
namespace {
struct TestDerivedAttributeDriver
}
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
void TestDerivedAttributeDriver::runOnFunction() {
getFunction().walk([](DerivedAttributeOpInterface dOp) {
/// The mode of conversion to use.
ConversionMode mode;
};
-} // end anonymous namespace
+} // namespace
static llvm::cl::opt<TestLegalizePatternDriver::ConversionMode>
legalizerConversionMode(
}
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Test patterns without a specific root operation kind
signalPassFailure();
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Test type conversions
signalPassFailure();
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Test Block Merging
RewritePatternSet(&getContext()));
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
void registerTestTraitsPass() { PassRegistration<TestTraitFolder>(); }
return printer << param.value;
}
-} // end namespace mlir
+} // namespace mlir
#include "TestTypeInterfaces.h.inc"
(void)applyPatternsAndFoldGreedily(func, std::move(patterns));
}
-} // anonymous namespace
+} // namespace
namespace mlir {
void registerTosaTestQuantUtilAPIPass() {
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
});
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
llvm::cl::desc("Specifies the diagnostic file name filters.")};
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
}
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
void registerTestFunc() {
});
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
return "Test C++ pattern matchers.";
}
};
-} // end anonymous namespace
+} // namespace
// This could be done better but is not worth the variadic template trouble.
template <typename Matcher>
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
llvm::outs() << " compares NOT equals!\n";
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
void registerTestOperationEqualPass() {
});
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
void registerTestPrintDefUsePass() { PassRegistration<TestPrintDefUsePass>(); }
return llvm::outs();
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
void registerTestPrintNestingPass() {
});
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
void registerSideEffectTestPasses() { PassRegistration<SideEffectsPass>(); }
});
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
void registerSymbolTestPasses() {
testNoSkipErasureCallbacks(op);
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
getOperation()->walk([&](Operation *) { ++opCount; });
}
};
-} // end anonymous namespace
+} // namespace
static void testNestedPipeline(OpPassManager &pm) {
// Nest a module pipeline that contains:
void runOnOperation() override;
};
-} // end anonymous namespace
+} // namespace
void TestReducer::runOnOperation() {
getOperation()->walk([&](Operation *op) {
std::move(patternList));
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
void foldOperation(Operation *op, OperationFolder &helper);
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
void TestConstantFold::foldOperation(Operation *op, OperationFolder &helper) {
auto processGeneratedConstants = [this](Operation *op) {
}
}
};
-} // end anonymous namespace
+} // namespace
namespace mlir {
namespace test {
void runOnFunction() override;
};
-} // end anonymous namespace
+} // namespace
// Run fusion dependence check on 'loops[i]' and 'loops[j]' at loop depths
// in range ['loopDepth' + 1, 'maxLoopDepth'].
// DECL: namespace mlir {
// DECL: class AsmParser;
// DECL: class AsmPrinter;
-// DECL: } // end namespace mlir
+// DECL: } // namespace mlir
// DEF: #ifdef GET_ATTRDEF_LIST
// DEF: #undef GET_ATTRDEF_LIST
// ATTR: return;
// ATTR: }
-// ATTR: } // end namespace test
+// ATTR: } // namespace test
def TypeA : TestType<"TypeA"> {
let mnemonic = "type_a";
// TYPE: return;
// TYPE: }
-// TYPE: } // end namespace test
+// TYPE: } // namespace test
// DECL: namespace mlir {
// DECL: class AsmParser;
// DECL: class AsmPrinter;
-// DECL: } // end namespace mlir
+// DECL: } // namespace mlir
// DEF: #ifdef GET_TYPEDEF_LIST
// DEF: #undef GET_TYPEDEF_LIST
/// The prefix/suffix of the TableGen def name, either "Attr" or "Type".
StringRef defType;
};
-} // end anonymous namespace
+} // namespace
DefGen::DefGen(const AttrOrTypeDef &def)
: def(def), params(def.getParameters()), defCls(def.getCppClassName()),
: DefGenerator(records.getAllDerivedDefinitions("TypeDef"), os, "Type",
"Type", /*isAttrGenerator=*/false) {}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// GEN: Declarations
namespace mlir {
class AsmParser;
class AsmPrinter;
-} // end namespace mlir
+} // namespace mlir
)";
bool DefGenerator::emitDecls(StringRef selectedDialect) {
using Base::Base;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Format Strings
bool shouldEmitSpace;
bool lastWasPunctuation;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// ParserGen
/// Seen attribute or type parameters.
llvm::BitVector seenParams;
};
-} // end anonymous namespace
+} // namespace
FailureOr<AttrOrTypeFormat> FormatParser::parse() {
std::vector<std::unique_ptr<Element>> elements;
/// E.g. 'value' -> 'getValue'.
std::string getParameterAccessorName(llvm::StringRef name);
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TOOLS_MLIRTBLGEN_ATTRORTYPEFORMATGEN_H_
using DialectFilterIterator =
llvm::filter_iterator<ArrayRef<llvm::Record *>::iterator,
std::function<bool(const llvm::Record *)>>;
-} // end anonymous namespace
+} // namespace
/// Given a set of records for a T, filter the ones that correspond to
/// the given dialect.
namespace llvm {
class SourceMgr;
-} // end namespace llvm
+} // namespace llvm
namespace mlir {
namespace tblgen {
/// Whether a failure in parsing the assembly format should be a fatal error.
extern llvm::cl::opt<bool> formatErrorIsFatal;
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TOOLS_MLIRTBLGEN_FORMATGEN_H_
ParentClass &parent;
};
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TOOLS_MLIRTBLGEN_OPCLASS_H_
// True if code is being generate for an op. False for an adaptor.
const bool emitForOp;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Op emitter
const StaticVerifierFunctionEmitter &staticVerifierEmitter;
};
-} // end anonymous namespace
+} // namespace
// Populate the format context `ctx` with substitutions of attributes, operands
// and results.
Class adaptor;
StaticVerifierFunctionEmitter &staticVerifierEmitter;
};
-} // end anonymous namespace
+} // namespace
OpOperandAdaptorEmitter::OpOperandAdaptorEmitter(
const Operator &op, StaticVerifierFunctionEmitter &staticVerifierEmitter)
/// This class represents a variable that refers to a successor.
using SuccessorVariable =
VariableElement<NamedSuccessor, Element::Kind::SuccessorVariable>;
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// DirectiveElement
/// The spelling of the literal for this element.
StringRef literal;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// WhitespaceElement
private:
bool value;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// OptionalElement
/// WhitespaceElement).
unsigned parseStart;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// OperationFormat
SmallVector<const NamedAttribute *, 8> usedAttributes;
llvm::StringSet<> inferredAttributes;
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// Parser Gen
/// The argument is a single element, i.e. always represents 1 element.
Single
};
-} // end anonymous namespace
+} // namespace
/// Get the length kind for the given constraint.
static ArgumentLengthKind
llvm::DenseSet<const NamedRegion *> seenRegions;
llvm::DenseSet<const NamedSuccessor *> seenSuccessors;
};
-} // end anonymous namespace
+} // namespace
LogicalResult FormatParser::parse() {
llvm::SMLoc loc = curToken.getLoc();
// Generate the assembly format for the given operator.
void generateOpFormat(const Operator &constOp, OpClass &opClass);
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TOOLS_MLIRTBLGEN_OPFORMATGEN_H_
std::vector<llvm::Record *>
getRequestedOpDefinitions(const llvm::RecordKeeper &recordKeeper);
-} // end namespace tblgen
-} // end namespace mlir
+} // namespace tblgen
+} // namespace mlir
#endif // MLIR_TOOLS_MLIRTBLGEN_OPGENHELPERS_H_
"(*static_cast<const ConcreteType *>(this))");
}
};
-} // end anonymous namespace
+} // namespace
//===----------------------------------------------------------------------===//
// GEN: Interface definitions
os << "template <typename " << valueTemplate << ">\n";
os << "struct " << interface.getName() << "Trait;\n";
- os << "\n} // end namespace detail\n";
+ os << "\n} // namespace detail\n";
// Emit the main interface class declaration.
os << llvm::formatv("class {0} : public ::mlir::{3}<{1}, detail::{2}> {\n"
std::string genDeclDesc, genDefDesc, genDocDesc;
mlir::GenRegistration genDecls, genDefs, genDocs;
};
-} // end anonymous namespace
+} // namespace
static InterfaceGenRegistration<AttrInterfaceGenerator> attrGen("attr",
"attribute");
os << v.first << ":" << v.second;
}
};
-} // end namespace llvm
+} // namespace llvm
//===----------------------------------------------------------------------===//
// PatternEmitter
StaticVerifierFunctionEmitter staticVerifierEmitter;
};
-} // end anonymous namespace
+} // namespace
PatternEmitter::PatternEmitter(Record *pat, RecordOperatorMap *mapper,
raw_ostream &os, StaticMatcherHelper &helper)
check(10, {{v[0], {}}, {v[2], v[0]}, {v[3], v[2]}, {v[1], v[3]}});
}
-} // end namespace
+} // namespace
EXPECT_EQ(firstValue.cast<IntegerAttr>().getInt(), 5);
}
-} // end namespace
+} // namespace
}
};
-} // anonymous namespace
+} // namespace
/// Vector addition of 2 vectors, i.e.:
/// a(i) = b(i) + c(i)
EXPECT_TRUE(zeroStringValue.getType() == stringTy);
}
-} // end namespace
+} // namespace
#endif
}
-} // end namespace
+} // namespace
EXPECT_FALSE(isa<TestExternalOpInterface>(opI.getOperation()));
}
-} // end namespace
+} // namespace
attrs.assign({});
ASSERT_TRUE(attrs.empty());
}
-} // end namespace
+} // namespace
VectorType::get(vectorNewShape, vectorNewType));
}
-} // end namespace
+} // namespace
ArrayRef<Attribute>({trueAttr, falseAttr, boolArrayAttr}));
}
-} // end namespace
+} // namespace
}
};
-} // end namespace
+} // namespace
TEST(DataLayout, FallbackDefault) {
const char *ir = R"MLIR(
EXPECT_TRUE(an.ctor2called);
}
-} // end namespace
+} // namespace
*static_cast<const InvalidPass *>(this));
}
};
-} // anonymous namespace
+} // namespace
TEST(PassManagerTest, InvalidPass) {
MLIRContext context;
ASSERT_DEATH(pm.addPass(std::make_unique<InvalidPass>()), "");
}
-} // end namespace
+} // namespace