This adds a comparison operation to EmitC which supports ==, !=, <=, <, >=, >, <=>.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Overall looks good
mlir/include/mlir/Dialect/EmitC/IR/EmitC.td | ||
---|---|---|
181 | It may read better without this comma, else the predicate looks like an operand to me. WDYT? | |
mlir/include/mlir/Dialect/EmitC/IR/EmitCAttributes.td | ||
39 | I see three-way most commonly used - but didn't check spec. | |
mlir/lib/Target/Cpp/TranslateToCpp.cpp | ||
321 | Errors follow convention of being sentence fragments (start lower case, no trailing punctuation) |
mlir/include/mlir/Dialect/EmitC/IR/EmitC.td | ||
---|---|---|
181 | I have no strong opinion on this. I just copied what was in the arith dialect and that one has the comma. | |
mlir/include/mlir/Dialect/EmitC/IR/EmitCAttributes.td | ||
39 | A hyphen won't work as this name is also used as an enum member in the ODS generated code. So I've gone with an underscore. |
Thanks, makes sense to keep consistent with arith
mlir/test/Target/Cpp/comparison_operators.mlir | ||
---|---|---|
6 | Mixed types are supported, how about mixing these a bit? i32 compare with f32, f32 with i64, i64 with unsigned, ... with custom? The number of compares remain the same as you are testing the enums, but contrary to arith dialect these can be mixed. | |
16 | Shouldn't the second V0 here not be captured? |
Updating D158180: [mlir][emitc] Add comparison operation
Mix up operand types and don't capture arguments multiple times.
It may read better without this comma, else the predicate looks like an operand to me. WDYT?