[PATCH] D78997: [SLP] add another bailout for load-combine patterns

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 08:03:33 PDT 2020


spatel added a comment.

In D78997#2020340 <https://reviews.llvm.org/D78997#2020340>, @ABataev wrote:

> May it happen at all that on some platforms it might be profitable to vectorize such sequences rather than use scalarized code? If so, better to implement cost analysis.


I think we already went down this path as an intermediate step with:
https://reviews.llvm.org/D67841?id=223377

And that had to be reverted.

There is no question of whether the vectorization may be profitable. The cost model -- as shown on this x86 example -- says the vectorization is profitable, and that is correct given the IR.

The problem is that the cost model can't tell us that the scalar code will eventually be transformed by the backend into something much simpler. So we need a heuristic somewhere, and we agreed in the last patch that this is only a problem for SLP. Trying to make the patch a general cost model fix exposed much larger problems in the definition/usage of the cost models themselves (see for example https://bugs.llvm.org/show_bug.cgi?id=43591 ). That's being addressed with a major rework of the cost models (D76124 <https://reviews.llvm.org/D76124>, D78547 <https://reviews.llvm.org/D78547>, D78922 <https://reviews.llvm.org/D78922>, etc).


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

https://reviews.llvm.org/D78997





More information about the llvm-commits mailing list