[PATCH] D91097: [IR] [TableGen] Cleanup pass over the IR TableGen files, part 2
Artem Belevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 9 13:12:42 PST 2020
tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.
LGTM overall, modulo one cosmetic nit.
================
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>,
----------------
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.
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