[PATCH] D34458: [TTI] Refine the cost of EXT in getUserCost()

Elena Demikhovsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 06:36:11 PDT 2017


delena added inline comments.


================
Comment at: llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h:167
+
+    return TargetTransformInfo::TCC_Basic;
+  }
----------------
haicheng wrote:
> delena wrote:
> > haicheng wrote:
> > > delena wrote:
> > > > At this point we should call to getOperationCost() and ask the target about the cost of Ext for the given type.
> > > Sorry about the performance regression.
> > > 
> > > I think isExtFree(I) above checks isZExtFree() with its types.  The part that can affect x86 is isExtLoad().  Do you want me to add a target hook to choose use refined ext cost?
> > First, I should understand why if the Src is not ExtLoad you return TargetTransformInfo::TCC_Basic.
> > Why you are not asking the target about the actual cost of the Ext?
> I think that getTLI()->isExtFree(I) above asks the actual cost of the Ext which is equivalent to calling getOperationCost() since they both check target specific isZExtFree() with type.
getTLI()->isExtFree(I) is a boolean function that returns true or false. But if the Ext is not free you should provide an actual cost and not TCC_Basic.


Repository:
  rL LLVM

https://reviews.llvm.org/D34458





More information about the llvm-commits mailing list