diff options
author | David Sherwood <david.sherwood@arm.com> | 2025-02-07 09:36:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-07 09:36:52 +0000 |
commit | 1930524bbde3cd26ff527bbdb5e1f937f484edd6 (patch) | |
tree | ae24fe088f62e0ca4204c38ce2857a59c942293b /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 7aeae7379d430404499f2929ffeea9416575a091 (diff) | |
download | llvm-1930524bbde3cd26ff527bbdb5e1f937f484edd6.zip llvm-1930524bbde3cd26ff527bbdb5e1f937f484edd6.tar.gz llvm-1930524bbde3cd26ff527bbdb5e1f937f484edd6.tar.bz2 |
[LoopVectorize] Fix cost model assert when vectorising calls (#125716)
The legacy and vplan cost models did not agree because
VPWidenCallRecipe::computeCost only calculates the cost of the
call instruction, whereas
LoopVectorizationCostModel::setVectorizedCallDecision in some
cases adds on the cost of a synthesised mask argument. However,
this mask is always 'splat(i1 true)' which should be hoisted out
of the loop during codegen. In order to synchronise the two cost
models I have two options:
1) Also add the cost of the splat to the vplan model, or
2) Remove the cost of the splat from the legacy model.
I chose 2) because I feel this more closely represents what the
final code will look like. There is an argument that we should
take account of such broadcast costs in the preheader when
deciding if it's profitable to vectorise a loop, however there
isn't currently a mechanism to do this. We currently only take
account of the runtime checks when assessing profitability and
what the minimum trip count should be. However, I don't believe
this work needs doing as part of this PR.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions