[PATCH] D120585: make TargetMachine visible from TargetTransformInfo

Jameson Nash via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 25 19:22:18 PST 2022


vtjnash added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:244
   explicit BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
-      : BaseT(DL) {}
+      : BaseT(TM, DL) {}
   virtual ~BasicTTIImplBase() = default;
----------------
craig.topper wrote:
> Doesn't BasicTTIImpl already have access to TargetMachine via getTLI()->getTargetMachine()? See the implementation of isNoopAddrSpaceCast further down this file.
Yes, that is why the TM value is already here: because most subtypes were already required to provide it. Are you meaning that this should be virtual? I don't think an extra pointer stored per pass manager will be a memory issue.


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