[PATCH] D52997: [x86] allow single source horizontal op matching (PR39195)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 9 05:18:14 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D52997#1258666, @andreadb wrote:

> I don't see it as a big problem if we start "regressing" this particular case on Jaguar.


Ok - that's not the impression I got reading PR39195. @dyung - how important is this pattern?

> I don't have a problem with aggressively selecting HADD at ISel stage, provided that we "undo" that canonicalization in a later (machine combiner?) pass.
>  Using HADD is not just slow for Intel, it is going to be slow for other AMD processors too. Similarly to what we do for other instructions (CMOV/LEA) which may be further expanded later on.

Yes, I agree. I even filed a bug. :)
https://bugs.llvm.org/show_bug.cgi?id=26859

So 2 options for moving forward:

1. Allow this transform as shown here because it is mostly just restoring the behavior of last week. Follow that up with a subtarget feature to prevent the transform (not ideal, but the alternative 'undo' is much harder).
2. Limit this transform to 'optsize' right now because it's a size win in all cases.


https://reviews.llvm.org/D52997





More information about the llvm-commits mailing list