[PATCH] D46010: [AArch64] Improve cost of vector division by constant

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 08:17:52 PDT 2018


rengolin added a comment.

In https://reviews.llvm.org/D46010#1078477, @zatrazz wrote:

> I should not change other architectures than AArch64 because 'isArithmeticDivFast' is a new method (only used by this patch).


This still looks very AArch64-y to me. Those two ISD nodes are specific to the case you're working on. I'm sure there are a lot more "divs" than that. :)

> but since the division by constant is a platform agnostic transformation I though it would make sense to check the same check on a platform agnostic manner.

It is platform agnostic if you cover all cases that a platform agnostic constant divide function should. Right now, it's specific to this one issue in this one arch.

Alternatively, a simple static function here would be more appropriate. We can expand later if it proves to be more than just this case/arch.

I would mention that this is relying on the code generator to pick this exact pattern and hope nothing goes wrong between cost analysis and generation, but this is not new, so not for this patch. :)

--renato


Repository:
  rL LLVM

https://reviews.llvm.org/D46010





More information about the llvm-commits mailing list