[PATCH] D60897: [SLP] Look-ahead operand reordering heuristic.

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 14:32:26 PDT 2019


vporpo added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:744
+    /// Score for failing to find a decent match.
+    static const int ScoreFail = 0;
+
----------------
RKSimon wrote:
> These kinds of hard coded costs scare me, especially without any context/description.
I agree, they look quite scary but the values themselves are not very important. 
What we we really care about is figuring out whether the values could be potentially vectorized or not. The relative differences between the scores is not very important either. It just shows that matching loads is usually preferable to matching instructions with the same opcode etc. 

We could still use the same score of 1 for all of them and we would still get decent reordering. Another alternative would be to check TTI for each potential candidate vector, but it looks like an overkill.


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

https://reviews.llvm.org/D60897





More information about the llvm-commits mailing list