[PATCH] D44338: [LV][VPlan] Build plain CFG with simple recipes for outer loops.

Andrei Elovikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 05:45:14 PDT 2018


a.elovikov added inline comments.


================
Comment at: lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp:100
+    if (isa<LoadInst>(Inst) || isa<StoreInst>(Inst)) {
+      VPBB->appendRecipe(
+          new VPWidenMemoryInstructionRecipe(Inst, nullptr /*Mask*/));
----------------
For outer loop vectorization in

    int s = 0;
    for (int i = 0; i < N; ++i) {
      for (int j = 0; j < M; ++j) {
        s += x[i] * y[j];
      }
    }

We need a broadcast y[j] -> {y[j], y[j], y[j], y[j]} but this will generate a WIDEN recipe for the load. Is that OK? If so, can we document it somewhere?



Repository:
  rL LLVM

https://reviews.llvm.org/D44338





More information about the llvm-commits mailing list