Skip to content

Commit 9035bf3

Browse files
committed
use signed for arithemtic & avoid copy
1 parent 2eeb6ce commit 9035bf3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mlir/include/mlir/Query/Matcher/Marshallers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class VariadicOperatorMatcherDescriptor : public MatcherDescriptor {
177177
}
178178

179179
std::vector<VariantMatcher> innerArgs;
180-
for (size_t i = 0, e = args.size(); i != e; ++i) {
180+
for (int64_t i = 0, e = args.size(); i != e; ++i) {
181181
const ParserValue &arg = args[i];
182182
const VariantValue &value = arg.value;
183183
if (!value.isMatcher()) {

mlir/include/mlir/Query/Matcher/MatchersInternal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ using VariadicOperatorFunction = bool (*)(Operation *op,
102102
template <VariadicOperatorFunction Func>
103103
class VariadicMatcher : public MatcherInterface {
104104
public:
105-
VariadicMatcher(std::vector<DynMatcher> matchers) : matchers(matchers) {}
105+
VariadicMatcher(std::vector<DynMatcher> matchers)
106+
: matchers(std::move(matchers)) {}
106107

107108
bool match(Operation *op) override { return Func(op, nullptr, matchers); }
108109
bool match(Operation *op, SetVector<Operation *> &matchedOps) override {
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// RUN: mlir-query %s -c "m allOf(hasOpName(\"memref.alloca\"), hasOpAttrName(\"alignment\"))" | FileCheck %s
32

43
func.func @dynamic_alloca(%arg0: index, %arg1: index) -> memref<?x?xf32> {
@@ -8,5 +7,5 @@ func.func @dynamic_alloca(%arg0: index, %arg1: index) -> memref<?x?xf32> {
87
}
98

109
// CHECK: Match #1:
11-
// CHECK: {{.*}}.mlir:6:3: note: "root" binds here
10+
// CHECK: {{.*}}.mlir:5:3: note: "root" binds here
1211
// CHECK: memref.alloca(%arg0, %arg1) {alignment = 32} : memref<?x?xf32>

0 commit comments

Comments
 (0)