Address some build warnings.

--

PiperOrigin-RevId: 249986120
This commit is contained in:
Jacques Pienaar
2019-05-25 10:55:20 -07:00
committed by Mehdi Amini
parent 647f8cabb9
commit 9edcd99feb
7 changed files with 6 additions and 31 deletions

View File

@@ -135,8 +135,6 @@ protected:
private:
void addRequireStatsOpByName(StringRef opName);
SolverContext &context;
/// Vector of all candidate type constraints, indexed by ordinal.
std::vector<CandidateQuantizedType> candidateTypes;

View File

@@ -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<Value *, 8> uniqueIds;
for (auto id : cst.getIds()) {
if (id.hasValue() && !uniqueIds.insert(id.getValue()).second)

View File

@@ -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));
};

View File

@@ -50,22 +50,6 @@ static bool isZero(Value *v) {
cast<ConstantIndexOp>(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<Value *> tileSizes) {
SmallVector<AffineExpr, 4> 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

View File

@@ -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;

View File

@@ -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(

View File

@@ -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<DequantizeCastOp>(