Skip to content

Commit c0480c6

Browse files
committed
remove unused utils
Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
1 parent 5ddf275 commit c0480c6

File tree

7 files changed

+19
-367
lines changed

7 files changed

+19
-367
lines changed
Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
//===- MatcherUtils.h - -----------------------------------------*- C++ -*-===//
1+
//===- MatcherUtils.h -------------------------------------------*- C++ -*-===//
22
//
33
// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef TPP_IR_MATCHERUTILS_H
10-
#define TPP_IR_MATCHERUTILS_H
9+
#ifndef GC_MATCHERUTILS_H
10+
#define GC_MATCHERUTILS_H
1111

1212
namespace mlir {
1313
class Value;
@@ -22,53 +22,13 @@ namespace utils {
2222
bool isTwoDAddOp(linalg::LinalgOp linalgOp,
2323
SmallVectorImpl<Value> *capturedOperands = nullptr);
2424

25-
// Returns true if the linalg operation is a 2d eltwsie floating point
26-
// subtraction.
27-
bool isTwoDSubOp(linalg::LinalgOp linalgOp,
28-
SmallVectorImpl<Value> *capturedOperands = nullptr);
29-
30-
// Returns true if the linalg operation is a 2d eltwsie floating point
31-
// multiplication.
32-
bool isTwoDMulOp(linalg::LinalgOp linalgOp,
33-
SmallVectorImpl<Value> *capturedOperands = nullptr);
34-
35-
// Returns true if the linalg.generic is a 2d eltwise floating point fill
36-
// operation with zeros.
37-
bool isTwoDZeroOp(linalg::LinalgOp linalgOp,
38-
SmallVectorImpl<Value> *capturedOperands = nullptr);
39-
4025
// Returns true if the linalg.generic is a 2d eltwise floating point relu
4126
// operation.
4227
bool isTwoDReluOp(linalg::LinalgOp linalgOp,
4328
SmallVectorImpl<Value> *capturedOperands = nullptr);
4429

45-
// Returns true if the linalg.generic is a 2d floating point copy operation.
46-
bool isTwoDIdentityOp(linalg::LinalgOp linalgOp,
47-
SmallVectorImpl<Value> *capturedOperands = nullptr);
48-
49-
// Returns true if the linalg.generic can convert to a 2d eltwise floating point
50-
// addition followed by a floating point relu.
51-
bool isTwoDBiasReluOp(linalg::LinalgOp linalgOp,
52-
SmallVectorImpl<Value> *capturedOperands = nullptr);
53-
54-
// Returns true if linalgOp is a 2d `linalg.transposeOp`.
55-
bool isTwoDTransposeOp(linalg::LinalgOp linalgOp,
56-
SmallVectorImpl<Value> *capturedOperands = nullptr);
57-
58-
// Return true if linalgOp is a 2d `linalgFillOp`. The fill is filling the
59-
// output with zeros.
60-
bool isTwoDFillOpWithZeros(linalg::LinalgOp linalgOp,
61-
SmallVectorImpl<Value> *capturedOperands = nullptr);
62-
63-
// Return a pair where the first member is true if and only if the operation
64-
// represents a brgemm in VNNI layout. The second member tells if the brgemm has
65-
// the batch dimension; it has meaning only if the first field is valid.
66-
std::pair<bool, bool>
67-
isBrgemmVnniOp(linalg::GenericOp linalgOp,
68-
SmallVectorImpl<Value> *capturedOperands = nullptr);
69-
7030
} // namespace utils
7131
} // namespace structured_match
7232
} // namespace mlir
7333

74-
#endif // TPP_IR_MATCHERUTILS_H
34+
#endif // GC_MATCHERUTILS_H

include/gc/Transforms/Utils/StructuredOpMatcher.h

Lines changed: 4 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//===- StructuredOpMatcher.h -------------------------------------*- C++-*-===//
22
//
3-
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3+
// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef TPP_IR_STRUCTUREDOPMATCHER_H
10-
#define TPP_IR_STRUCTUREDOPMATCHER_H
9+
#ifndef GC_UTILS_STRUCTUREDOPMATCHER_H
10+
#define GC_UTILS_STRUCTUREDOPMATCHER_H
1111

1212
#include "mlir/Dialect/Arith/IR/Arith.h"
1313
#include "mlir/Dialect/Linalg/IR/Linalg.h"
@@ -20,18 +20,6 @@ namespace mlir {
2020
class Operation;
2121
namespace structured_match {
2222

23-
struct KindAdd {
24-
static bool classof(const Operation *op) {
25-
return isa<arith::AddFOp>(op) || isa<arith::AddIOp>(op);
26-
}
27-
};
28-
29-
struct KindMul {
30-
static bool classof(const Operation *op) {
31-
return isa<arith::MulFOp>(op) || isa<arith::MulIOp>(op);
32-
}
33-
};
34-
3523
// Base class for the matcher predicates selection tag.
3624
struct MatchSelector {
3725
MatchSelector() = delete;
@@ -61,14 +49,6 @@ struct MatchOne : public MatchSelector {
6149
MatchOne(size_t idx) : MatchSelector(idx, idx + 1) {}
6250
};
6351

64-
// Selector which specifies that predicate should apply only on range of values
65-
// at positions from `lowerBound` up to - but not including - `upperBound`.
66-
struct MatchRange : public MatchSelector {
67-
MatchRange() = delete;
68-
MatchRange(size_t lowerBound, size_t upperBound)
69-
: MatchSelector(lowerBound, upperBound) {}
70-
};
71-
7252
// Callable object to check if the number of loops in `op` satisfies `fun`.
7353
struct NumOfLoops {
7454
NumOfLoops() = delete;
@@ -152,13 +132,6 @@ struct Identity {
152132
bool operator()(AffineMap map) const { return map.isIdentity(); }
153133
};
154134

155-
// Callable object to capture any map.
156-
struct Any {
157-
Any() = default;
158-
159-
bool operator()(AffineMap map) const { return true; }
160-
};
161-
162135
// Callable object to verify if `operand` has static shape.
163136
struct HasStaticShape {
164137
HasStaticShape() = default;
@@ -244,48 +217,6 @@ template <typename T> struct EqualsTo {
244217
};
245218
template <typename T> EqualsTo(T) -> EqualsTo<T>;
246219

247-
// Callable object to check if the input is less than or equal to specified
248-
// `value`.
249-
struct LessThanOrEqualTo {
250-
LessThanOrEqualTo() = delete;
251-
explicit LessThanOrEqualTo(size_t value) : value(value){};
252-
const size_t value;
253-
254-
bool operator()(size_t value) const { return value <= this->value; }
255-
};
256-
257-
// Callable object to check if the input is greater than or equal to specified
258-
// `value`.
259-
struct GreaterThanOrEqualTo {
260-
GreaterThanOrEqualTo() = delete;
261-
explicit GreaterThanOrEqualTo(size_t value) : value(value){};
262-
const size_t value;
263-
264-
bool operator()(size_t value) const { return value >= this->value; }
265-
};
266-
267-
// Callable object to check if `op` has tensor semantics.
268-
struct HasTensorSemantics {
269-
HasTensorSemantics() = default;
270-
271-
bool operator()(Operation *op) const {
272-
if (auto linalgOp = dyn_cast_or_null<linalg::LinalgOp>(op))
273-
return linalgOp.hasPureTensorSemantics();
274-
return false;
275-
}
276-
};
277-
278-
// Callable object to check if `op` buffer semantics.
279-
struct HasBufferSemantics {
280-
HasBufferSemantics() = default;
281-
282-
bool operator()(Operation *op) const {
283-
if (auto linalgOp = dyn_cast_or_null<linalg::LinalgOp>(op))
284-
return linalgOp.hasPureBufferSemantics();
285-
return false;
286-
}
287-
};
288-
289220
// Callable object to validate number of init operands for `op`.
290221
struct NumDpsInits {
291222
NumDpsInits() = delete;
@@ -300,20 +231,6 @@ struct NumDpsInits {
300231
std::function<bool(size_t)> fun;
301232
};
302233

303-
// Callable object to check the number of affine map for `op`.
304-
struct NumAffineMaps {
305-
NumAffineMaps() = delete;
306-
explicit NumAffineMaps(std::function<bool(size_t)> fun) : fun(std::move(fun)){};
307-
308-
bool operator()(Operation *op) const {
309-
if (auto linalgOp = dyn_cast_or_null<linalg::LinalgOp>(op))
310-
return fun(linalgOp.getIndexingMapsArray().size());
311-
return false;
312-
}
313-
314-
std::function<bool(size_t)> fun;
315-
};
316-
317234
// Callable object to validate number of input operands for `op`.
318235
struct NumDpsInputs {
319236
NumDpsInputs() = delete;
@@ -458,4 +375,4 @@ class StructuredOpMatcher {
458375
} // namespace structured_match
459376
} // namespace mlir
460377

461-
#endif // TPP_IR_STRUCTUREDOPMATCHER_H
378+
#endif // GC_UTILS_STRUCTUREDOPMATCHER_H

include/gc/Transforms/Utils/ValueUtils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef TPP_TRANSFORMS_UTILS_VALUEUTILS_H
10-
#define TPP_TRANSFORMS_UTILS_VALUEUTILS_H
9+
#ifndef GC_TRANSFORMS_UTILS_VALUEUTILS_H
10+
#define GC_TRANSFORMS_UTILS_VALUEUTILS_H
1111

1212
namespace mlir {
1313
class Value;
@@ -33,4 +33,4 @@ std::pair<Value, Value> getPtrAndOffset(OpBuilder &builder, Value val,
3333
} // namespace utils
3434
} // namespace mlir
3535

36-
#endif // TPP_TRANSFORMS_UTILS_VALUEUTILS_H
36+
#endif // GC_TRANSFORMS_UTILS_VALUEUTILS_H

lib/gc/Transforms/GPU/LinalgToXeGPU.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//===- LinalgToXeGPU.cpp -----------------------------------------*- C++-*-===//
1+
//===- LinalgToXeGPU.cpp - Linalg To XeGPU Lowering -*- C++ -*-===//
22
//
3-
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3+
// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//

0 commit comments

Comments
 (0)