[PATCH] D57925: [TTI] Add generic cost model for fixed point smul/umul

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 24 04:48:08 PST 2019


RKSimon added a comment.

In D57925#1395313 <https://reviews.llvm.org/D57925#1395313>, @nikic wrote:

> > An alternative would be to assume the mull/mulh cost is the same as 2 * mul - what do people think?
>
> Would it be possible to add a separate method for getting the widening multiplication cost, defaulting to your current implementation? It would come in handy for MULO cost modeling as well. And probably more likely to receive a good target-specific implementation than the full smul.fix intrinsics.


Sorry, I missed your comment! The existing method to do this is to pass Value arguments to getArithmeticInstrCost, there are already some targets that use this to detect extend+add/mul style cases. The problem we have here is that we don't really want to create Values on the fly for the analysis, and adding a Type equivalent version would be a little messy and cause duplication (we already suffer with this with the 2 getIntrinsicInstrCost variants).

My hope would be that for targets where this matters they will implement an override.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57925





More information about the llvm-commits mailing list