llvm-project/llvm/test/Transforms/LoopVectorize/AArch64
Cullen Rhodes cba4accda0 [LV] Clamp VF hint when unsafe
In the following loop the dependence distance is 2 and can only be
vectorized if the vector length is no larger than this.

  void foo(int *a, int *b, int N) {
    #pragma clang loop vectorize(enable) vectorize_width(4)
    for (int i=0; i<N; ++i) {
      a[i + 2] = a[i] + b[i];
    }
  }

However, when specifying a VF of 4 via a loop hint this loop is
vectorized. According to [1][2], loop hints are ignored if the
optimization is not safe to apply.

This patch introduces a check to bail of vectorization if the user
specified VF is greater than the maximum feasible VF, unless explicitly
forced with '-force-vector-width=X'.

[1] https://llvm.org/docs/LangRef.html#llvm-loop-vectorize-and-llvm-loop-interleave
[2] https://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations

Reviewed By: sdesmalen, fhahn, Meinersbur

Differential Revision: https://reviews.llvm.org/D90687
2020-12-01 11:30:34 +00:00
..
Oz-and-forced-vectorize.ll [LoopRotation] Allow loop header duplication if vectorization is forced. 2020-10-27 09:28:01 +00:00
aarch64-predication.ll [AArch64] Add getCFInstrCost, treat branches as free for throughput. 2020-06-30 20:34:04 +01:00
aarch64-unroll.ll
arbitrary-induction-step.ll
arm64-unroll.ll
backedge-overflow.ll
deterministic-type-shrinkage.ll
extractvalue-no-scalarization-required.ll ExtractValue instruction costs 2020-12-01 10:42:23 +00:00
gather-cost.ll
induction-trunc.ll
interleaved-vs-scalar.ll
interleaved_cost.ll
lit.local.cfg
loop-vectorization-factors.ll
loopvectorize_pr33804_double.ll [AArch64][LV] Move vectorizer test to Transforms/LoopVectorize/AArch64. NFC 2020-10-10 10:15:43 +01:00
max-vf-for-interleaved.ll
no_vector_instructions.ll
nontemporal-load-store.ll
outer_loop_test1_no_explicit_vect_width.ll
pr31900.ll
pr33053.ll [llvm][mlir] Promote the experimental reduction intrinsics to be first class intrinsics. 2020-10-07 10:36:44 -07:00
pr36032.ll [SCEV] Use loop guard info when computing the max BE taken count in howFarToZero. 2020-09-24 11:06:55 +01:00
pr46950-load-cast-context-crash.ll [LV] Do not check widening decision for instrs outside of loop. 2020-08-03 10:09:24 +01:00
predication_costs.ll [AArch64] Add getCFInstrCost, treat branches as free for throughput. 2020-06-30 20:34:04 +01:00
reduction-small-size.ll [llvm][mlir] Promote the experimental reduction intrinsics to be first class intrinsics. 2020-10-07 10:36:44 -07:00
sdiv-pow2.ll
select-costs.ll [LV] Add cost-model test for AArch64 select costs. 2020-10-26 13:43:31 +00:00
smallest-and-widest-types.ll
sve-scalable-load-in-loop.ll [SVE][AArch64] Improve specificity of vectorization legality TypeSize test 2020-11-10 10:55:25 +00:00
type-shrinkage-insertelt.ll
unsafe-vf-hint-remark.ll [LV] Clamp VF hint when unsafe 2020-12-01 11:30:34 +00:00