[mlir][tensor] Fix gcc build (ValueBoundsOpInterface)

The order of evaluation of a sum (e.g., `a() + b()`) is unspecified in
C++. clang evaluates left-to-right. gcc evaluate right-to-left. This led
to slighly different (but equivalent) affine_map in a test and the
FileCheck did not match anymore.
This commit is contained in:
Matthias Springer
2023-04-07 10:33:13 +09:00
parent 5e2afe5c66
commit 06d0cd1e81

View File

@@ -86,10 +86,10 @@ struct PadOpInterface
auto padOp = cast<PadOp>(op);
assert(value == padOp.getResult() && "invalid value");
AffineExpr expr = cstr.getExpr(padOp.getSource(), dim) +
cstr.getExpr(padOp.getMixedLowPad()[dim]) +
cstr.getExpr(padOp.getMixedHighPad()[dim]);
cstr.bound(value)[dim] == expr;
AffineExpr srcSize = cstr.getExpr(padOp.getSource(), dim);
AffineExpr lowPad = cstr.getExpr(padOp.getMixedLowPad()[dim]);
AffineExpr highPad = cstr.getExpr(padOp.getMixedHighPad()[dim]);
cstr.bound(value)[dim] == srcSize + lowPad + highPad;
}
};