[PATCH] D14617: alignment info for cost estimation in SLP vectorization

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 13:33:07 PST 2015


mzolotukhin added a subscriber: mzolotukhin.

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1621-1622
@@ -1619,3 +1620,4 @@
       int ScalarLdCost = VecTy->getNumElements() *
-      TTI->getMemoryOpCost(Instruction::Load, ScalarTy, 1, 0);
+        TTI->getMemoryOpCost(Instruction::Load, ScalarTy, 
+	LoadI->getAlignment(), 0);
       int VecLdCost = TTI->getMemoryOpCost(Instruction::Load, VecTy, 1, 0);
----------------
Please run clang-format on the patch.

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1623
@@ -1621,2 +1622,3 @@
+	LoadI->getAlignment(), 0);
       int VecLdCost = TTI->getMemoryOpCost(Instruction::Load, VecTy, 1, 0);
       return VecLdCost - ScalarLdCost;
----------------
What about alignment here? Should we still use 1?


http://reviews.llvm.org/D14617





More information about the llvm-commits mailing list