From 596989da6595e18c15ac18f6c3ff838cf048b068 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 21 Jun 2021 12:55:25 +0200 Subject: [PATCH] [mlir][Linalg] Silence warnings in Release builds. NFC. mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:940:8: warning: unused variable 'opProducesRootRead' [-Wunused-variable] bool opProducesRootRead = ^ mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:942:8: warning: unused variable 'opProducesRootWrite' [-Wunused-variable] bool opProducesRootWrite = ^ mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:1498:11: warning: unused variable 'resultNumber' [-Wunused-variable] int64_t resultNumber = result.getResultNumber(); ^ mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:1497:11: warning: unused variable 'operandNumber' [-Wunused-variable] int64_t operandNumber = operand.getOperandNumber(); ^ mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:267:20: warning: unused function 'getInPlace' [-Wunused-function] static InPlaceSpec getInPlace(Value v) { ^ --- .../Linalg/Transforms/ComprehensiveBufferize.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp index 620981b..dbbd4a7 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp @@ -264,7 +264,7 @@ static InPlaceSpec getInPlace(BlockArgument bbArg) { return attr.getValue() ? InPlaceSpec::True : InPlaceSpec::False; } -static InPlaceSpec getInPlace(Value v) { +LLVM_ATTRIBUTE_UNUSED static InPlaceSpec getInPlace(Value v) { if (auto bbArg = v.dyn_cast()) return getInPlace(bbArg); return getInPlace(v.cast()); @@ -937,11 +937,10 @@ bool BufferizationAliasInfo::isClobberedWriteBeforeRead( assert(!domInfo.properlyDominates(aliasingReadOp, aliasingWriteOp) && "Unexpected aliasingReadOp properly dominates aliasingWriteOp"); - bool opProducesRootRead = - rootRead.isa() && rootRead.getDefiningOp() == opToBufferize; - bool opProducesRootWrite = - rootWrite.isa() && rootWrite.getDefiningOp() == opToBufferize; - assert((opProducesRootRead || opProducesRootWrite) && + assert(((rootRead.isa() && + rootRead.getDefiningOp() == opToBufferize) || + (rootWrite.isa() && + rootWrite.getDefiningOp() == opToBufferize)) && "Expected rootRead or rootWrite to be produced by opToBufferize"); // Bail if the write does not dominate the read: it may clobber but only on @@ -1494,12 +1493,12 @@ static void bufferizableInPlaceAnalysis(OpOperand &operand, OpResult result, assert(result && !isa(op) && "expected OpResult not coming from a SubTensorOp"); - int64_t operandNumber = operand.getOperandNumber(); int64_t resultNumber = result.getResultNumber(); + (void)resultNumber; LDBG('\n'); - LDBG("Try to bufferize inplace result #" << resultNumber << " (operand #" - << operandNumber << ") in " << result - << '\n'); + LDBG("Try to bufferize inplace result #" + << resultNumber << " (operand #" << operand.getOperandNumber() << ") in " + << result << '\n'); // `result` must bufferize to a writeable buffer to be a candidate. // This means the use->def chain not backpropagate to a function that is -- 2.7.4