[llvm] [LV] Cache call vectorization decisions (PR #66521)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 08:02:03 PDT 2023


================
@@ -1450,6 +1482,7 @@ class LoopVectorizationCostModel {
     if (VF.isScalar() || Uniforms.contains(VF))
       return;
     setCostBasedWideningDecision(VF);
+    setVectorizedCallDecision(VF);
----------------
huntergr-arm wrote:

I've added to the comment above it. To some extent this doesn't feel like the right place to call it, but I found that I needed to call setVectorizedCallDecision() in every place collectUniformsAndScalars() was, so added it. I do think it should only be called on one path though -- currently there's multiple paths where the functions are called, depending on things like a user-supplied VF. I fixed one case, but it seems like it could be simplified with another refactoring patch.

https://github.com/llvm/llvm-project/pull/66521


More information about the llvm-commits mailing list