[Mlir-commits] [mlir] 596989d - [mlir][Linalg] Silence warnings in Release builds. NFC.
Benjamin Kramer
llvmlistbot at llvm.org
Mon Jun 21 03:58:18 PDT 2021
Author: Benjamin Kramer
Date: 2021-06-21T12:56:41+02:00
New Revision: 596989da6595e18c15ac18f6c3ff838cf048b068
URL: https://github.com/llvm/llvm-project/commit/596989da6595e18c15ac18f6c3ff838cf048b068
DIFF: https://github.com/llvm/llvm-project/commit/596989da6595e18c15ac18f6c3ff838cf048b068.diff
LOG: [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) {
^
Added:
Modified:
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
index 620981b34bf4..dbbd4a7d5432 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<BlockArgument>())
return getInPlace(bbArg);
return getInPlace(v.cast<OpResult>());
@@ -937,11 +937,10 @@ bool BufferizationAliasInfo::isClobberedWriteBeforeRead(
assert(!domInfo.properlyDominates(aliasingReadOp, aliasingWriteOp) &&
"Unexpected aliasingReadOp properly dominates aliasingWriteOp");
- bool opProducesRootRead =
- rootRead.isa<OpResult>() && rootRead.getDefiningOp() == opToBufferize;
- bool opProducesRootWrite =
- rootWrite.isa<OpResult>() && rootWrite.getDefiningOp() == opToBufferize;
- assert((opProducesRootRead || opProducesRootWrite) &&
+ assert(((rootRead.isa<OpResult>() &&
+ rootRead.getDefiningOp() == opToBufferize) ||
+ (rootWrite.isa<OpResult>() &&
+ 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<SubTensorOp>(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
More information about the Mlir-commits
mailing list