[PATCH] D76165: [mlir][GPU] Use StructAttr to drive lowering from loop.parallel to gpu.launch

Lei Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 18:35:47 PDT 2020


antiagainst added inline comments.


================
Comment at: mlir/include/mlir/Dialect/GPU/ParallelLoopMapperAttr.td:20
+
+def BLOCKX : I64EnumAttrCase<"BLOCKX", 0>;
+def BLOCKY : I64EnumAttrCase<"BLOCKY", 1>;
----------------
I'm wondering the convention here. Why all cap letters? `BlockX`, `ThreadY`/`Sequential`/etc. seems better to me.


================
Comment at: mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp:526
+
+static unsigned getLaunchOpArgumentNum(gpu::Processor processor) {
+  switch (processor) {
----------------
Isn't this just `static_cast<unsigned>(processor)` excluding `gpu::Processor::SEQUENTIAL`? Do we need this explicit switch here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76165





More information about the llvm-commits mailing list