[PATCH] D80609: [MLIR] expose applyCmpPredicate

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 16:56:19 PDT 2020


stephenneuendorffer updated this revision to Diff 266695.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80609/new/

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 mlir::applyCmpPredicate(CmpIPredicate predicate, const APInt &lhs,
+                             const APInt &rhs) {
   switch (predicate) {
   case CmpIPredicate::eq:
     return lhs.eq(rhs);
@@ -838,8 +838,8 @@
 
 /// Compute `lhs` `pred` `rhs`, where `pred` is one of the known floating point
 /// comparison predicates.
-static bool applyCmpPredicate(CmpFPredicate predicate, const APFloat &lhs,
-                              const APFloat &rhs) {
+bool mlir::applyCmpPredicate(CmpFPredicate predicate, const APFloat &lhs,
+                             const APFloat &rhs) {
   auto cmpResult = lhs.compare(rhs);
   switch (predicate) {
   case CmpFPredicate::AlwaysFalse:
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,16 @@
 ///   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);
+
+/// Compute `lhs` `pred` `rhs`, where `pred` is one of the known floating point
+/// comparison predicates.
+bool applyCmpPredicate(CmpFPredicate predicate, const APFloat &lhs,
+                       const APFloat &rhs);
 } // end namespace mlir
 
 #endif // MLIR_DIALECT_IR_STANDARDOPS_IR_OPS_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80609.266695.patch
Type: text/x-patch
Size: 2026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200527/850a4418/attachment.bin>


More information about the llvm-commits mailing list