[PATCH] D137532: [LoongArch] Implement the TargetLowering::getRegisterByName hook

Gong LingQin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 4 19:09:46 PST 2022


gonglingqin added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:2462
+#define GET_REGISTER_MATCHER
+#include "LoongArchGenAsmMatcher.inc"
+
----------------
thakis wrote:
> This is a bit strange to me from a dependency point of view. GenAsmMatcher conceptually belongs to LoongArchAsmParser, but LoongArchCodeGen doesn't depend on LoongArchAsmParser. I believe other targets don't include GenAsmMatcher.inc from their codegen libraries (except aarch64 and riscv, but it's strange there too -- see also https://reviews.llvm.org/D69130#inline-627969).
> 
> Any chance this could be layered nicer?
Thanks for your advice. We considered using StringSwitch for matching, but we chose the current implementation because of code reuse. Do you think using stringswitch is a better way to do this, or do you have any suggestions?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137532



More information about the llvm-commits mailing list