[PATCH] D105751: GlobalISel: Introduce GenericMachineInstr classes and derivatives for idiomatic LLVM RTTI.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 15:06:06 PDT 2021


aemerson added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h:24
+/// A base class for all GenericMachineInstrs.
+class GenericMachineInstr : public MachineInstr {
+public:
----------------
arsenm wrote:
> Can we get away with allocating these as regular MachineInstrs since there are no real members?
Not sure what you mean. Have the others inherit directly from MachineInstr? If so we wouldn't be able to declare GISel helpers like `getReg()`, unless we add those to MachineInstr. Even then, it would be useful to have this to enforce more type safety in future for places which only expect to deal with generic instructions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105751



More information about the llvm-commits mailing list