[PATCH] D152311: [RISCV] Merge RISCVMCInstLower.cpp into RISCVAsmPrinter.cpp.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 6 22:01:26 PDT 2023
craig.topper added a comment.
In D152311#4401941 <https://reviews.llvm.org/D152311#4401941>, @asb wrote:
> This is definitely something I just copied from other backends and I like the idea of merging it. There is some value in uniformity with other backends though, so if other targets were dead set against ever considering something similar then perhaps we'd consider if it's better to stay matching everyone else.
I think there's already inconsistency in the structure of the files. I surveyed some of the targets.
X86 has a X86MCInstLower class that is instantiated on each call to X86AsmPrinter::emitInstruction. X86AsmPrinter::emitInstruction is implemented in X86MCInstLower.cpp
RISC-V does not have a MCInstLower class.
AArch64 has a AArch64MCInstLower object that is a member of AArch64AsmPrinter so its only instantiated once.
ARM, Hexagon, PowerPC, and SystemZ seem similar to RISC-V.
SystemZ has a SystemZMCInstLower instatiated from SystemZAsmPrinter::emitInstruction. SystemZAsmPrinter::emitInstruction is in SystemZAsmPrinter.cpp
AMDGPU has a AMDGPUMCInstLower instantiated from AMDGPUAsmPrinter::emitInstruction. AMDGPUAsmPrinter::emitInstruction lives in AMDGPUMCInstLower.cpp.
Mips has a MipsMCInstLower member of MipsAsmPrinter so it's only instantiated once.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152311/new/
https://reviews.llvm.org/D152311
More information about the llvm-commits
mailing list