This repository was archived by the owner on Sep 15, 2025. It is now read-only.
Commit 073e65a
authored
[LoopVectorize] Make needsExtract notice scalarized instructions (llvm#119720)
LoopVectorizationCostModel::needsExtract should recognise instructions
that have been widened by scalarizing as scalar instructions, and thus
not needing an extract when used by later scalarized instructions.
This fixes an incorrect cost calculation in computePredInstDiscount,
where we are adding a scalarization overhead cost when we shouldn't,
though I haven't come up with a test case where it makes a difference.
It will make a difference when the cost model switches to using the cost
kind TCK_CodeSize for optsize, as not doing this causes the test
LoopVectorize/X86/small-size.ll to get worse.1 parent 6d604ba commit 073e65a
File tree
3 files changed
+164
-163
lines changed- llvm
- lib/Transforms/Vectorize
- test/Transforms/LoopVectorize
- AArch64
- ARM
3 files changed
+164
-163
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1731 | 1731 | | |
1732 | 1732 | | |
1733 | 1733 | | |
1734 | | - | |
| 1734 | + | |
| 1735 | + | |
1735 | 1736 | | |
1736 | 1737 | | |
1737 | 1738 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
| 173 | + | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
0 commit comments