[PATCH] D12035: [ARM] Improve cost model to handle sdiv by a pow-of-two.

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 03:38:58 PDT 2015


rengolin added a comment.

I agree with Geoff that this should be factored out and thought well.

Not only such a cost calculation should be used everywhere, but it looks like a special case in its own. Without knowing the effect of this cost change into other patterns, it's hard to decide if this is truly beneficial overall, or just a local spike in this use-case.

I agree that the cost tables are not relying enough on knowledge of the instructions and timings and there's a lot of fudge already to help the vectorizer do a better job, but that fudge is in place after general agreements from benchmarks and large code bases. I don't like it, but I also don't have a better solution right now.

Unfortunately, any change needs to come with some benchmarking results, even those that would make the cost table better. :/

For the patch, specifically, I'd suggest this to be factored out into a higher level (for all scalar divide needs), and also take into account platforms that have HW divide.


Repository:
  rL LLVM

http://reviews.llvm.org/D12035





More information about the llvm-commits mailing list