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

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 07:57:12 PDT 2023


================
@@ -6970,6 +6968,122 @@ void LoopVectorizationCostModel::setCostBasedWideningDecision(ElementCount VF) {
   }
 }
 
+void LoopVectorizationCostModel::setVectorizedCallDecision(ElementCount VF) {
+  if (VF.isScalar())
+    return;
+
+  for (BasicBlock *BB : TheLoop->blocks()) {
+    // For each instruction in the old loop.
+    for (Instruction &I : *BB) {
+      CallInst *CI = dyn_cast<CallInst>(&I);
+
+      if (!CI || CallWideningDecisions.contains(std::make_pair(CI, VF)))
----------------
huntergr-arm wrote:

I've removed the check for a preexisting decision.

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


More information about the llvm-commits mailing list