struct Conv1DNwcGenerator : public StructuredGenerator<LinalgOp> {
Conv1DNwcGenerator(OpBuilder &builder, LinalgOp linalgOp, int strideW,
int dilationW)
- : StructuredGenerator<LinalgOp>(builder, linalgOp), valid(false),
- strideW(strideW), dilationW(dilationW) {
+ : StructuredGenerator<LinalgOp>(builder, linalgOp), strideW(strideW),
+ dilationW(dilationW) {
// Determine whether `linalgOp` can be generated with this generator
if (linalgOp.getNumInputs() != 2 || linalgOp.getNumOutputs() != 1)
return;
}
private:
- bool valid;
+ bool valid = false;
int strideW, dilationW;
Value lhsShaped, rhsShaped, resShaped;
ShapedType lhsShapedType, rhsShapedType, resShapedType;
// `d0 + 2 * d1 + d3` is tiled by [0, 0, 0, 2] but not by [0, 0, 2, 0]
//
struct TileCheck : public AffineExprVisitor<TileCheck> {
- TileCheck(ValueRange tileSizes) : isTiled(false), tileSizes(tileSizes) {}
+ TileCheck(ValueRange tileSizes) : tileSizes(tileSizes) {}
void visitDimExpr(AffineDimExpr expr) {
isTiled |= !isZero(tileSizes[expr.getPosition()]);
assert(expr.getRHS().cast<AffineConstantExpr>().getValue() > 0 &&
"nonpositive multiplying coefficient");
}
- bool isTiled;
+ bool isTiled = false;
ValueRange tileSizes;
};
indices(numTensors, std::vector<Value>(numLoops)),
highs(numTensors, std::vector<Value>(numLoops)),
pidxs(numTensors, std::vector<Value>(numLoops)),
- idxs(numTensors, std::vector<Value>(numLoops)), redExp(-1u), redVal(),
- redKind(kNoReduc), sparseOut(op), outerParNest(nest), lexIdx(),
- expValues(), expFilled(), expAdded(), expCount(), curVecLength(1),
- curVecMask() {}
+ idxs(numTensors, std::vector<Value>(numLoops)), redVal(), sparseOut(op),
+ outerParNest(nest), lexIdx(), expValues(), expFilled(), expAdded(),
+ expCount(), curVecMask() {}
/// Sparsification options.
SparsificationOptions options;
/// Universal dense indices and upper bounds (by index). The loops array
std::vector<std::vector<Value>> idxs;
/// Current reduction, updated during code generation. When indices of a
/// reduction are exhausted, all inner loops can use a scalarized reduction.
- unsigned redExp;
+ unsigned redExp = -1u;
Value redVal;
- Reduction redKind;
+ Reduction redKind = kNoReduc;
// Sparse tensor as output. Implemented either through direct injective
// insertion in lexicographic index order (where indices are updated
// in the temporary array `lexIdx`) or through access pattern expansion
Value expAdded;
Value expCount;
// Current vector length and mask.
- unsigned curVecLength;
+ unsigned curVecLength = 1;
Value curVecMask;
};
Diagnostic diag;
};
- ParallelDiagnosticHandlerImpl(MLIRContext *ctx) : handlerID(0), context(ctx) {
+ ParallelDiagnosticHandlerImpl(MLIRContext *ctx) : context(ctx) {
handlerID = ctx->getDiagEngine().registerHandler([this](Diagnostic &diag) {
uint64_t tid = llvm::get_threadid();
llvm::sys::SmartScopedLock<true> lock(mutex);
mutable std::vector<ThreadDiagnostic> diagnostics;
/// The unique id for the parallel handler.
- DiagnosticEngine::HandlerID handlerID;
+ DiagnosticEngine::HandlerID handlerID = 0;
/// The context to emit the diagnostics to.
MLIRContext *context;
AffineParser(ParserState &state, bool allowParsingSSAIds = false,
function_ref<ParseResult(bool)> parseElement = nullptr)
: Parser(state), allowParsingSSAIds(allowParsingSSAIds),
- parseElement(parseElement), numDimOperands(0), numSymbolOperands(0) {}
+ parseElement(parseElement) {}
AffineMap parseAffineMapRange(unsigned numDims, unsigned numSymbols);
ParseResult parseAffineMapOrIntegerSetInline(AffineMap &map, IntegerSet &set);
private:
bool allowParsingSSAIds;
function_ref<ParseResult(bool)> parseElement;
- unsigned numDimOperands;
- unsigned numSymbolOperands;
+ unsigned numDimOperands = 0;
+ unsigned numSymbolOperands = 0;
SmallVector<std::pair<StringRef, AffineExpr>, 4> dimsAndSymbols;
};
} // namespace
/// the name is the name of a pass, the InnerPipeline is empty, since passes
/// cannot contain inner pipelines.
struct PipelineElement {
- PipelineElement(StringRef name) : name(name), registryEntry(nullptr) {}
+ PipelineElement(StringRef name) : name(name) {}
StringRef name;
StringRef options;
- const PassRegistryEntry *registryEntry;
+ const PassRegistryEntry *registryEntry = nullptr;
std::vector<PipelineElement> innerPipeline;
};
public:
Parser(ast::Context &ctx, llvm::SourceMgr &sourceMgr)
: ctx(ctx), lexer(sourceMgr, ctx.getDiagEngine()),
- curToken(lexer.lexToken()), curDeclScope(nullptr),
- valueTy(ast::ValueType::get(ctx)),
+ curToken(lexer.lexToken()), valueTy(ast::ValueType::get(ctx)),
valueRangeTy(ast::ValueRangeType::get(ctx)),
typeTy(ast::TypeType::get(ctx)),
typeRangeTy(ast::TypeRangeType::get(ctx)),
Token curToken;
/// The most recently defined decl scope.
- ast::DeclScope *curDeclScope;
+ ast::DeclScope *curDeclScope = nullptr;
llvm::SpecificBumpPtrAllocator<ast::DeclScope> scopeAllocator;
/// The current context of the parser.
int64_t version;
/// The number of lines in the file.
- int64_t totalNumLines;
+ int64_t totalNumLines = 0;
/// The chunks of this file. The order of these chunks is the order in which
/// they appear in the text file.
int64_t version, DialectRegistry ®istry,
std::vector<lsp::Diagnostic> &diagnostics)
: context(registry, MLIRContext::Threading::DISABLED),
- contents(fileContents.str()), version(version), totalNumLines(0) {
+ contents(fileContents.str()), version(version) {
context.allowUnregisteredDialects();
// Split the file into separate MLIR documents.
/// Represents a single entry in the depth first traversal of a CFG.
struct CFGStackNode {
CFGStackNode(ScopedMapTy &knownValues, DominanceInfoNode *node)
- : scope(knownValues), node(node), childIterator(node->begin()),
- processed(false) {}
+ : scope(knownValues), node(node), childIterator(node->begin()) {}
/// Scope for the known values.
ScopedMapTy::ScopeTy scope;
DominanceInfoNode::const_iterator childIterator;
/// If this node has been fully processed yet or not.
- bool processed;
+ bool processed = false;
};
/// Attempt to eliminate a redundant operation. Returns success if the
/// Create an operation sinker with given dominance info.
Sinker(function_ref<bool(Operation *, Region *)> shouldMoveIntoRegion,
DominanceInfo &domInfo)
- : shouldMoveIntoRegion(shouldMoveIntoRegion), domInfo(domInfo),
- numSunk(0) {}
+ : shouldMoveIntoRegion(shouldMoveIntoRegion), domInfo(domInfo) {}
/// Given a list of regions, find operations to sink and sink them. Return the
/// number of operations sunk.
/// Dominance info to determine op user dominance with respect to regions.
DominanceInfo &domInfo;
/// The number of operations sunk.
- size_t numSunk;
+ size_t numSunk = 0;
};
} // end anonymous namespace
};
OperationFormat(const Operator &op)
- : allOperands(false), allOperandTypes(false), allResultTypes(false),
- infersResultTypes(false) {
+
+ {
operandTypes.resize(op.getNumOperands(), TypeResolution());
resultTypes.resize(op.getNumResults(), TypeResolution());
/// A flag indicating if all operand/result types were seen. If the format
/// contains these, it can not contain individual type resolvers.
- bool allOperands, allOperandTypes, allResultTypes;
+ bool allOperands = false, allOperandTypes = false, allResultTypes = false;
/// A flag indicating if this operation infers its result types
- bool infersResultTypes;
+ bool infersResultTypes = false;
/// A flag indicating if this operation has the SingleBlockImplicitTerminator
/// trait.
StaticMatcherHelper &staticMatcherHelper;
// The next unused ID for newly created values.
- unsigned nextValueId;
+ unsigned nextValueId = 0;
raw_indented_ostream os;
PatternEmitter::PatternEmitter(Record *pat, RecordOperatorMap *mapper,
raw_ostream &os, StaticMatcherHelper &helper)
: loc(pat->getLoc()), opMap(mapper), pattern(pat, mapper),
- symbolInfoMap(pat->getLoc()), staticMatcherHelper(helper), nextValueId(0),
- os(os) {
+ symbolInfoMap(pat->getLoc()), staticMatcherHelper(helper), os(os) {
fmtCtx.withBuilder("rewriter");
}