Hi, I noticed many functions in the TargetTransformInfo interface are duplicates of those already in TargetLowering (e.g. isTruncateFree). Is the expectation really that targets will reimplement the same functions twice? AArch64’s TTI uses some TLI calls in some of its implementations, but why doesn’t the base TargetTransformInfo call the TargetLowering versions by default? - Matt
----- Original Message -----> From: "Matt Arsenault" <arsenm2 at gmail.com> > To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> > Sent: Friday, July 18, 2014 1:15:14 PM > Subject: [LLVMdev] TLI vs. TTI > > Hi, > > I noticed many functions in the TargetTransformInfo interface are > duplicates of those already in TargetLowering (e.g. isTruncateFree). > Is the expectation really that targets will reimplement the same > functions twice? AArch64’s TTI uses some TLI calls in some of its > implementations, but why doesn’t the base TargetTransformInfo call > the TargetLowering versions by default?Are the implementations different? The default TTI implementation does use the relevant TLI function: bool BasicTTI::isTruncateFree(Type *Ty1, Type *Ty2) const { return getTLI()->isTruncateFree(Ty1, Ty2); } -Hal> > - Matt > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory
On Jul 18, 2014, at 12:14 PM, Hal Finkel <hfinkel at anl.gov> wrote:> ----- Original Message ----- >> From: "Matt Arsenault" <arsenm2 at gmail.com> >> To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> >> Sent: Friday, July 18, 2014 1:15:14 PM >> Subject: [LLVMdev] TLI vs. TTI >> >> Hi, >> >> I noticed many functions in the TargetTransformInfo interface are >> duplicates of those already in TargetLowering (e.g. isTruncateFree). >> Is the expectation really that targets will reimplement the same >> functions twice? AArch64’s TTI uses some TLI calls in some of its >> implementations, but why doesn’t the base TargetTransformInfo call >> the TargetLowering versions by default? > > Are the implementations different? The default TTI implementation does use the relevant TLI function: > > bool BasicTTI::isTruncateFree(Type *Ty1, Type *Ty2) const { > return getTLI()->isTruncateFree(Ty1, Ty2); > } > > -HalOh, I’ve been looking in TargetTransformInfo.cpp at what I thought were the default implementations, but these are apparently for “NoTTI”. The ones in BasicTTI make much more sense