[PATCH] LoopVectorize: teach loop vectorizer to vectorize calls.

hfinkel at anl.gov hfinkel at anl.gov
Wed Mar 11 00:25:49 PDT 2015


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:2645
@@ +2644,3 @@
+  // value.
+  unsigned ScalarCallCost =
+      TTI.getCallInstrCost(F, ScalarRetTy, ScalarTys, TLI);
----------------
Do this before computing RetTy and Tys. Then, if VF == 1, set the necessary variables and return. Otherwise, continue, but you'll know that the types are vector types, so you can commit the calls to isVectorTy(). There is no need to compute the cost twice for VF == 1.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:2671
@@ +2670,3 @@
+  // If the corresponding vector cost is cheaper, return its cost.
+  unsigned VectorCallCost = TTI.getCallInstrCost(F, RetTy, Tys, TLI);
+  if (VectorCallCost < Cost) {
----------------
These types won't match those in F's declaration; please pass nullptr for F.

http://reviews.llvm.org/D8095

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list