[PATCH] D91097: [IR] [TableGen] Cleanup pass over the IR TableGen files, part 2

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 13:41:45 PST 2020


Paul-C-Anagnostopoulos added inline comments.


================
Comment at: llvm/include/llvm/IR/IntrinsicsNVVM.td:166-174
+         !foldl([]<list<WMMA_REGS>>, !if(!size(TypeB), TypeB, [type_a]), t3,
+                type_b, !listconcat(t3,
+           !foldl([]<list<WMMA_REGS>>, TypeC, t4, type_c, !listconcat(t4,
+             !foreach(type_d, !if(!size(TypeD), TypeD, [type_c]),
+                      [WMMA_REGS<geom, "a", type_a>,
+                       WMMA_REGS<geom, "b", type_b>,
+                       WMMA_REGS<geom, "c", type_c>,
----------------
tra wrote:
> I'd keep the original version, including the formatting -- I think it's substantially more readable that way. Understanding the uniformly nested set of `foldl()` is mentally easier to grok than the mix of `foldl` and `foreach` with args  wrapped differently at each level.
> 
> IMO, it's one of the cases where nominally better code is not necessarily an improvement overall.
> 
Yes, now that you bring up consistency, I think it would be better to keep !foldl.

Why do you like them not indented? 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91097/new/

https://reviews.llvm.org/D91097



More information about the llvm-commits mailing list