[PATCH] D67841: [SLP] avoid reduction transform on patterns that the backend can load-combine

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 08:31:28 PDT 2019


spatel added a comment.

In D67841#1676983 <https://reviews.llvm.org/D67841#1676983>, @spatel wrote:

> In D67841#1676963 <https://reviews.llvm.org/D67841#1676963>, @ABataev wrote:
>
> > Is this similar to D42981 <https://reviews.llvm.org/D42981>?
>
>
> I think it's trying to accomplish a similar goal, but that patch affects far more than this (and I'm not sure it would solve this problem). Ie, this is intentionally trying hard to affect only the patterns that we know will be combined into a single larger scalar load.


I looked at the other patch again, and it is not solving the examples in the motivating bug reports. The problem in these cases is not the vector cost model; it's the scalar cost model. Unless we resurrect LoadCombiner in IR, we need to recognize that small consecutive scalar loads can be combined to a larger scalar op.

The pattern-matching here isn't specific enough to fully recognize a bswap for example, but that's not necessary IMO. We have perf regressions, and this is a conservative change to the cost model calc that fixes them. If we underestimated the scalar cost for some sequence that can't be reduced to a single load, that can be improved later.


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

https://reviews.llvm.org/D67841





More information about the llvm-commits mailing list