[PATCH] D80609: [MLIR] expose applyCmpPredicate

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 22:34:13 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG698462336abb: [MLIR] expose applyCmpPredicate (authored by stephenneuendorffer).
Herald added a subscriber: msifontes.
Herald added a project: MLIR.

Changed prior to commit:
  https://reviews.llvm.org/D80609?vs=267038&id=269738#toc

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.269738.patch
Type: text/x-patch
Size: 2028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200610/826aa8a9/attachment.bin>


More information about the llvm-commits mailing list