[llvm] Overhaul the TargetMachine and LLVMTargetMachine Classes (PR #111234)
Matin Raayai via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 11:15:40 PDT 2024
matinraayai wrote:
> > 1. Make `CodeGenTargetMachine` behave the same way it did before, and add a `dyn_cast` option to it to confirm whether a `TargetMachine` was implemented with code gen support; or
> > 2. Keep the PR the way it is; i.e. `CodeGenTargetMachine` is just a set of function implementations a `TargetMachine` can inherit.
>
> I'd prefer 2, because IIUC all targets in `lib/Target` inherit `LLVMTargetMachine`. For long-term goal, I would prefer to avoid concept like `LLVMTargetMachine`, but this is off-topic.
I prefer 2 as well. This was my somewhat successful attempt at getting rid of the `LLVMTargetMachine` concept, as in `CodeGenTargetMachine` is just a set of `TargetMachine` implementations a target can inherit; i.e. it's possible for a `TargetMachine` not to inherit from `CodeGenTargetMachine` but still make use of the target-independent code generator. This is also why I originally opted for the uglier name @arsenm.
https://github.com/llvm/llvm-project/pull/111234
More information about the llvm-commits
mailing list