[Mlir-commits] [mlir] [mlir][emitc] Add EmitC index types (PR #93155)
Simon Camphausen
llvmlistbot at llvm.org
Thu May 23 05:11:11 PDT 2024
================
@@ -51,7 +51,8 @@ class EmitC_BinaryOp<string mnemonic, list<Trait> traits = []> :
def CExpression : NativeOpTrait<"emitc::CExpression">;
// Types only used in binary arithmetic operations.
-def IntegerIndexOrOpaqueType : AnyTypeOf<[EmitCIntegerType, Index, EmitC_OpaqueType]>;
+def IntegerIndexOrOpaqueType : AnyTypeOf<[EmitCIntegerType, Index,
+ EmitC_SignedSizeT, EmitC_SizeT, EmitC_OpaqueType]>;
----------------
simon-camp wrote:
We have type predicates for Integer types [here](https://github.com/llvm/llvm-project/blob/84729c9df30b29d5f4e903ad71235a6aa0c764d6/mlir/include/mlir/Dialect/EmitC/IR/EmitCTypes.td#L25). I would add an EmitCSizeTType predicate there as well which calls `isAnySizeTType` and use it here.
Can you also add a few tests for operations that use this predicate, like `emitc.add` for example.
(I'm wondering why we have this duplicated with `emitc::isIntegerIndexOrOpaqueType` though. Did we forget to change this to a predicate here? @TinaAMD, @mgehre-amd
https://github.com/llvm/llvm-project/pull/93155
More information about the Mlir-commits
mailing list