[llvm] [LV] Add cross-part load overlap heuristic for interleaving (PR #214500)
Sergey Shcherbinin via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 21 06:49:41 PDT 2026
================
@@ -0,0 +1,479 @@
+; RUN: split-file %s %t
+;
+; The analysis only predicts downstream savings to guide IC selection. It does
+; not modify VPlan or eliminate any widened loads.
+;
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 \
+; RUN: -force-target-max-vector-interleave=2 -small-loop-cost=0 \
+; RUN: -enable-interleave-cse -interleave-cse-min-ops=1 \
+; RUN: -interleave-cse-min-pct=1 \
+; RUN: -S %t/positive.ll | FileCheck %t/positive.ll --check-prefix=FORCED
+; RUN: opt -passes=loop-vectorize -force-target-max-vector-interleave=2 \
+; RUN: -small-loop-cost=0 -enable-interleave-cse \
+; RUN: -interleave-cse-min-ops=1 -interleave-cse-min-pct=1 \
+; RUN: -S %t/positive.ll \
+; RUN: | FileCheck %t/positive.ll --check-prefix=PRODUCTION
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 \
+; RUN: -force-target-max-vector-interleave=2 -small-loop-cost=0 \
+; RUN: -enable-interleave-cse -S %t/positive.ll \
+; RUN: | FileCheck %t/positive.ll --check-prefix=THRESHOLD
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 \
+; RUN: -force-target-max-vector-interleave=2 -small-loop-cost=0 \
+; RUN: -enable-interleave-cse -interleave-cse-min-ops=1 \
+; RUN: -interleave-cse-min-pct=100 -S %t/positive.ll \
+; RUN: | FileCheck %t/positive.ll --check-prefix=PERCENT
+; Force deterministic costs so the ordinary branch-cost heuristic recommends
+; IC=1, allowing this run to verify that cross-part analysis can raise it to 2.
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 \
+; RUN: -force-target-max-vector-interleave=2 \
+; RUN: -force-target-instruction-cost=1 -small-loop-cost=12 \
+; RUN: -enable-loadstore-runtime-interleave=false \
+; RUN: -enable-interleave-cse -interleave-cse-min-ops=1 \
+; RUN: -interleave-cse-min-pct=1 \
+; RUN: -S %t/positive.ll | FileCheck %t/positive.ll --check-prefix=SMALL-IC
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 \
+; RUN: -force-target-max-vector-interleave=2 -small-loop-cost=0 \
+; RUN: -S %t/positive.ll | FileCheck %t/positive.ll --check-prefix=DISABLED
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 \
+; RUN: -force-target-max-vector-interleave=2 -small-loop-cost=0 \
+; RUN: -enable-interleave-cse -force-vector-interleave=1 \
+; RUN: -S %t/positive.ll | FileCheck %t/positive.ll --check-prefix=USERIC
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 \
+; RUN: -force-target-max-vector-interleave=1 -small-loop-cost=0 \
+; RUN: -enable-interleave-cse -interleave-cse-min-ops=1 \
+; RUN: -interleave-cse-min-pct=1 \
+; RUN: -S %t/positive.ll | FileCheck %t/positive.ll --check-prefix=MAXIC
+; RUN: opt -passes=loop-vectorize -mtriple=aarch64-none-linux-gnu -mattr=+sve \
+; RUN: -force-vector-width="vscale x 2" \
+; RUN: -force-target-max-vector-interleave=2 -small-loop-cost=0 \
+; RUN: -enable-interleave-cse -interleave-cse-min-ops=1 \
+; RUN: -interleave-cse-min-pct=1 -S %t/positive.ll \
+; RUN: | FileCheck %t/positive.ll --check-prefix=SCALABLE
+;
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 \
----------------
SergeyShch01 wrote:
Done
https://github.com/llvm/llvm-project/pull/214500
More information about the llvm-commits
mailing list