[Mlir-commits] [mlir] 36c9afc - [mlir][emitc][nfc] List supported comparisons

Marius Brehler llvmlistbot at llvm.org
Wed Aug 30 07:29:14 PDT 2023


Author: Marius Brehler
Date: 2023-08-30T14:29:02Z
New Revision: 36c9afc7a8113ab2b2aa3d00ca291a30958ede13

URL: https://github.com/llvm/llvm-project/commit/36c9afc7a8113ab2b2aa3d00ca291a30958ede13
DIFF: https://github.com/llvm/llvm-project/commit/36c9afc7a8113ab2b2aa3d00ca291a30958ede13.diff

LOG: [mlir][emitc][nfc] List supported comparisons

Reviewed By: simon-camp

Differential Revision: https://reviews.llvm.org/D159195

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/EmitC/IR/EmitC.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
index 9e0880089c9f87..40a4896aca4b63 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
@@ -156,6 +156,16 @@ def EmitC_CmpOp : EmitC_BinaryOp<"cmp", []> {
     With the `cmp` operation the comparison operators ==, !=, <, <=, >, >=, <=> 
     can be applied.
 
+    Its first argument is an attribute that defines the comparison operator:
+
+    - equal to (mnemonic: `"eq"`; integer value: `0`)
+    - not equal to (mnemonic: `"ne"`; integer value: `1`)
+    - less than (mnemonic: `"lt"`; integer value: `2`)
+    - less than or equal to (mnemonic: `"le"`; integer value: `3`)
+    - greater than (mnemonic: `"gt"`; integer value: `4`)
+    - greater than or equal to (mnemonic: `"ge"`; integer value: `5`)
+    - three-way-comparison (mnemonic: `"three_way"`; integer value: `6`)
+
     Example:
     ```mlir
     // Custom form of the cmp operation.


        


More information about the Mlir-commits mailing list