[PATCH] D120585: make TargetMachine visible from TargetTransformInfo

Jameson Nash via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 13:18:02 PDT 2022


vtjnash added a comment.
Herald added a project: All.

> I would be supportive of a patch that added a TTI function that returned the contents of the target-attribute when it is present or the TargetMachine attributes when it is not.

It appear that if we add that function, then there only be one missing argument (CPU) that would be needed so that any user could re-allocate their own private copy of the TargetMachine (see the constructor at https://llvm.org/doxygen/classllvm_1_1TargetMachine.html). Is there some reason it is better to expose each of the values separately, but not the object that they come from?

Alternative observation to merging this PR: since the Module object already must contain the first 3 arguments to the TargetMachine constructor, would it be more logical to attach the TM directly to the module instead, replacing separate values, instead of needing the fake analysis passes like MachineModuleAnalysis to expose it to CodeGen?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120585



More information about the llvm-commits mailing list