[LV] Print remark when loop cannot be vectorized due to invalid costs.
authorSander de Smalen <sander.desmalen@arm.com>
Wed, 14 Jul 2021 15:45:07 +0000 (16:45 +0100)
committerSander de Smalen <sander.desmalen@arm.com>
Wed, 14 Jul 2021 16:11:33 +0000 (17:11 +0100)
commitefaf3099c8cec1954831ee28a2f75a72096f50eb
tree2bcd2f25775c516ca1baadc88667cdf4ad361102
parent47269da5d83e079a565439cbbacd4bb119ed0aff
[LV] Print remark when loop cannot be vectorized due to invalid costs.

This patch emits remarks for instructions that have invalid costs for
a given set of vectorization factors. Some example output:

  t.c:4:19: remark: Instruction with invalid costs prevented vectorization at VF=(vscale x 1): load
      dst[i] = sinf(src[i]);
                    ^
  t.c:4:14: remark: Instruction with invalid costs prevented vectorization at VF=(vscale x 1, vscale x 2, vscale x 4): call to llvm.sin.f32
      dst[i] = sinf(src[i]);
               ^
  t.c:4:12: remark: Instruction with invalid costs prevented vectorization at VF=(vscale x 1): store
      dst[i] = sinf(src[i]);
             ^

Reviewed By: fhahn, kmclaughlin

Differential Revision: https://reviews.llvm.org/D105806
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/AArch64/scalable-call.ll