[PATCH] D120585: make TargetMachine visible from TargetTransformInfo

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 25 21:17:51 PST 2022


craig.topper 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;
----------------
vtjnash wrote:
> 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.
I don't think I read the code very well. Ignore my comment.


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