diff --git a/mlir/include/mlir/Quantizer/Support/Configuration.h b/mlir/include/mlir/Quantizer/Support/Configuration.h index 2b67712b55ea..a260824a7e63 100644 --- a/mlir/include/mlir/Quantizer/Support/Configuration.h +++ b/mlir/include/mlir/Quantizer/Support/Configuration.h @@ -135,8 +135,6 @@ protected: private: void addRequireStatsOpByName(StringRef opName); - SolverContext &context; - /// Vector of all candidate type constraints, indexed by ordinal. std::vector candidateTypes; diff --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp index 986337ce7c3f..3b7d5a00d9ec 100644 --- a/mlir/lib/Analysis/AffineStructures.cpp +++ b/mlir/lib/Analysis/AffineStructures.cpp @@ -490,7 +490,8 @@ bool areIdsAligned(const FlatAffineConstraints &A, } /// Checks if the SSA values associated with `cst''s identifiers are unique. -static bool areIdsUnique(const FlatAffineConstraints &cst) { +static bool LLVM_ATTRIBUTE_UNUSED +areIdsUnique(const FlatAffineConstraints &cst) { SmallPtrSet uniqueIds; for (auto id : cst.getIds()) { if (id.hasValue() && !uniqueIds.insert(id.getValue()).second) diff --git a/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp b/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp index f51c25ac3a01..d4be38e610fc 100644 --- a/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp +++ b/mlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp @@ -415,8 +415,7 @@ public: return positionAttr(rewriter, values); }; // Helper function to obtain the ptr of the given `view`. - auto getViewPtr = [pos, &rewriter, this](ViewType type, - Value *view) -> Value * { + auto getViewPtr = [pos, this](ViewType type, Value *view) -> Value * { auto elementPtrTy = getPtrToElementType(type, lowering); return extractvalue(elementPtrTy, view, pos(0)); }; diff --git a/mlir/lib/Linalg/Transforms/Tiling.cpp b/mlir/lib/Linalg/Transforms/Tiling.cpp index 6e72ecf84be8..22090ca6aac3 100644 --- a/mlir/lib/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Linalg/Transforms/Tiling.cpp @@ -50,22 +50,6 @@ static bool isZero(Value *v) { cast(v->getDefiningOp()).getValue() == 0; } -/// Returns a map that can be used to filter the zero values out of tileSizes. -/// For example, if tileSizes contains `{v1, 0, v2}`, the returned map is: -/// -/// ```{.mlir} -/// (d0, d1, d2) -> (d0, d2) -/// ``` -static AffineMap nonZeroMap(ArrayRef tileSizes) { - SmallVector exprs; - for (auto en : llvm::enumerate(tileSizes)) - if (!isZero(en.value())) - exprs.push_back(getAffineDimExpr(en.index(), en.value()->getContext())); - assert(!exprs.empty() && - "unexpected zero-only tile sizes, should have been handled earlier"); - return AffineMap::get(tileSizes.size(), 0, exprs, {}); -} - // Creates a number of ranges equal to the number of non-zero in `tileSizes`. // One for each loop of the LinalgOp that is tiled. The `tileSizes` argument has // one entry per surrounding loop. It uses zero as the convention that a diff --git a/mlir/lib/Quantizer/Support/Configuration.cpp b/mlir/lib/Quantizer/Support/Configuration.cpp index 0efded0820aa..78a74514f8b0 100644 --- a/mlir/lib/Quantizer/Support/Configuration.cpp +++ b/mlir/lib/Quantizer/Support/Configuration.cpp @@ -26,8 +26,7 @@ using namespace mlir; using namespace mlir::quantizer; -TargetConfiguration::TargetConfiguration(SolverContext &context) - : context(context) {} +TargetConfiguration::TargetConfiguration(SolverContext &context) {} void TargetConfiguration::addOpHandlerByName(StringRef name, OpHandlerFn fn) { opHandlers[name] = fn; diff --git a/mlir/lib/Quantizer/Support/UniformConstraints.cpp b/mlir/lib/Quantizer/Support/UniformConstraints.cpp index ab1ced195bcb..2ea081a7e7a3 100644 --- a/mlir/lib/Quantizer/Support/UniformConstraints.cpp +++ b/mlir/lib/Quantizer/Support/UniformConstraints.cpp @@ -124,7 +124,7 @@ private: os << "PropagateExplicitScale"; } void propagate(SolverContext &solverContext, - const TargetConfiguration &config) { + const TargetConfiguration &config) override { DiscreteScaleZeroPointFact scaleZp; // Get scale/zp from all parents. @@ -170,7 +170,7 @@ private: } void propagate(SolverContext &solverContext, - const TargetConfiguration &config) { + const TargetConfiguration &config) override { // First determine the required min/max range and type constraints. Location fusedLoc = UnknownLoc::get(&solverContext.getMlirContext()); llvm::SmallBitVector enabledCandidateTypesMask( diff --git a/mlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp b/mlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp index a2cfe72b0ee7..94bac98598c3 100644 --- a/mlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp +++ b/mlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp @@ -206,9 +206,6 @@ void InferQuantizedTypesPass::transformOperandType(CAGOperandAnchor *anchor, } switch (anchor->getTypeTransformRule()) { - default: - op->emitOpError("unsupported type transform rule"); - break; case CAGAnchorNode::TypeTransformRule::Direct: anchor->getOp()->setOperand(anchor->getOperandIdx(), newTypedInputValue); break; @@ -248,9 +245,6 @@ void InferQuantizedTypesPass::transformResultType(CAGResultAnchor *anchor, Value *replacedResultValue = nullptr; Value *newResultValue = nullptr; switch (anchor->getTypeTransformRule()) { - default: - op->emitOpError("unsupported type transform rule"); - return; case CAGAnchorNode::TypeTransformRule::Direct: origResultValue->setType(newType); replacedResultValue = newResultValue = b.create(