[PATCH] D80609: [MLIR] expose applyCmpPredicate
Stephen Neuendorffer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 26 21:15:47 PDT 2020
stephenneuendorffer created this revision.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a project: LLVM.
This is useful for manipulating the standard dialect from transformations
outside of the standard dialect.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80609
Files:
mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
Index: mlir/lib/Dialect/StandardOps/IR/Ops.cpp
===================================================================
--- mlir/lib/Dialect/StandardOps/IR/Ops.cpp
+++ mlir/lib/Dialect/StandardOps/IR/Ops.cpp
@@ -784,8 +784,8 @@
// Compute `lhs` `pred` `rhs`, where `pred` is one of the known integer
// comparison predicates.
-static bool applyCmpPredicate(CmpIPredicate predicate, const APInt &lhs,
- const APInt &rhs) {
+bool applyCmpPredicate(CmpIPredicate predicate, const APInt &lhs,
+ const APInt &rhs) {
switch (predicate) {
case CmpIPredicate::eq:
return lhs.eq(rhs);
Index: mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
===================================================================
--- mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
+++ mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
@@ -339,6 +339,12 @@
/// consumer %0 ... : memref<?x16xf32, affine_map<(i, j)->(16 * i + j)>>
/// ```
bool canFoldIntoConsumerOp(MemRefCastOp castOp);
+
+// Compute `lhs` `pred` `rhs`, where `pred` is one of the known integer
+// comparison predicates.
+bool applyCmpPredicate(CmpIPredicate predicate, const APInt &lhs,
+ const APInt &rhs);
+
} // end namespace mlir
#endif // MLIR_DIALECT_IR_STANDARDOPS_IR_OPS_H
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80609.266413.patch
Type: text/x-patch
Size: 1306 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200527/97c7a20b/attachment.bin>
More information about the llvm-commits
mailing list