[all-commits] [llvm/llvm-project] 354215: [LoopVectorize] Fix cost model assert when vectori...
David Sherwood via All-commits
all-commits at lists.llvm.org
Fri Feb 7 13:31:11 PST 2025
Branch: refs/heads/release/20.x
Home: https://github.com/llvm/llvm-project
Commit: 3542150f05a1f32796d2258f679b9190b7d1f825
https://github.com/llvm/llvm-project/commit/3542150f05a1f32796d2258f679b9190b7d1f825
Author: David Sherwood <david.sherwood at arm.com>
Date: 2025-02-07 (Fri, 07 Feb 2025)
Changed paths:
M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
M llvm/test/Transforms/LoopVectorize/AArch64/masked-call.ll
Log Message:
-----------
[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.
(cherry picked from commit 1930524bbde3cd26ff527bbdb5e1f937f484edd6)
Commit: b5f41cc50c9db7e3c155e5c1e8114678baa6bce9
https://github.com/llvm/llvm-project/commit/b5f41cc50c9db7e3c155e5c1e8114678baa6bce9
Author: David Sherwood <david.sherwood at arm.com>
Date: 2025-02-07 (Fri, 07 Feb 2025)
Changed paths:
M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Log Message:
-----------
[LoopVectorize] Fix build error (#126218)
Fixes issue caused by 1930524bbde3cd26ff527bbdb5e1f937f484edd6
Unused variable UsesMask in LoopVectorize.cpp
(cherry picked from commit 3872e55758a5de035c032a975f244302c3ddacc3)
Compare: https://github.com/llvm/llvm-project/compare/7bcfaa1c4d9c...b5f41cc50c9d
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list