[Mlir-commits] [mlir] [mlir][tosa] Stop support the custom simplified form of COND_IF (PR #139576)

TatWai Chong llvmlistbot at llvm.org
Wed May 14 10:52:48 PDT 2025


tatwaichong wrote:

I agree that the simplified form is more natural for both reading and writing. In fact, I had started modifying the custom parse() function in this direction. However, I stopped when I realized I needed to capture and set input_list and output_list in parse() to satisfy the ERROR_IF checks that are triggered in verify() later during compilation. Since operation parsing is token-based, it feels unnatural to infer additional information and populate other parts of the operation implicitly in parse(). If not in parse(), where is a good place to populate? 

I'm also unsure whether users would agree with the implications of this syntax. Some may prefer a more strict and explicit language.

It seems to me that if we want to support this simplified form, a natural approach might be to relax the ERROR_IF checks in verify(). We could assume that when input_list and output_list are empty, their types and shapes match those of then_graph and else_graph.

Another consideration is the output format. If we choose to print this simplified form, then any tools consuming the output must also support and understand this implication.

I personally like this form, since I originally wrote it that way. However, it does require consensus from others. I’d prefer to pause support for it for now and revisit it after discussing with the team.

https://github.com/llvm/llvm-project/pull/139576


More information about the Mlir-commits mailing list