Commit 721c122
committed
[VPlan] Compute cost of more replicating loads/stores in ::computeCost.
Update VPReplicateRecipe::computeCost to compute costs of more
replicating loads/stores.
There are 2 cases that require extra checks to match the legacy cost
model:
1. If the pointer is based on an induction, the legacy cost model
passes its SCEV to getAddressComputationCost. In those cases, still
fall back to the legacy cost. SCEV computations will be added as
follow-up
2. If a load is used as part of an address of another load, the legacy
cost model skips the scalarization overhead. Those cases are
currently handled by a usedByLoadOrStore helper.
Note that getScalarizationOverhead also needs updating, because when
the legacy cost model computes the scalarization overhead, scalars have
not been collected yet, so we can't each for replicating recipes to skip
their cost, except other loads. This again can be further improved by
modeling inserts/extracts explicitly and consistently, and compute costs
for those operations directly where needed.1 parent add9079 commit 721c122
File tree
4 files changed
+131
-28
lines changed- llvm/lib/Transforms/Vectorize
4 files changed
+131
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3925 | 3925 | | |
3926 | 3926 | | |
3927 | 3927 | | |
3928 | | - | |
| 3928 | + | |
| 3929 | + | |
3929 | 3930 | | |
3930 | 3931 | | |
3931 | 3932 | | |
| |||
4182 | 4183 | | |
4183 | 4184 | | |
4184 | 4185 | | |
4185 | | - | |
| 4186 | + | |
| 4187 | + | |
4186 | 4188 | | |
4187 | 4189 | | |
4188 | 4190 | | |
| |||
6871 | 6873 | | |
6872 | 6874 | | |
6873 | 6875 | | |
6874 | | - | |
| 6876 | + | |
6875 | 6877 | | |
6876 | 6878 | | |
6877 | 6879 | | |
| |||
7082 | 7084 | | |
7083 | 7085 | | |
7084 | 7086 | | |
7085 | | - | |
| 7087 | + | |
| 7088 | + | |
7086 | 7089 | | |
7087 | 7090 | | |
7088 | 7091 | | |
| |||
8704 | 8707 | | |
8705 | 8708 | | |
8706 | 8709 | | |
8707 | | - | |
| 8710 | + | |
| 8711 | + | |
8708 | 8712 | | |
8709 | 8713 | | |
8710 | 8714 | | |
| |||
10043 | 10047 | | |
10044 | 10048 | | |
10045 | 10049 | | |
10046 | | - | |
| 10050 | + | |
10047 | 10051 | | |
10048 | 10052 | | |
10049 | 10053 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1778 | 1778 | | |
1779 | 1779 | | |
1780 | 1780 | | |
1781 | | - | |
1782 | | - | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
1783 | 1785 | | |
1784 | 1786 | | |
1785 | 1787 | | |
| |||
1799 | 1801 | | |
1800 | 1802 | | |
1801 | 1803 | | |
1802 | | - | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
1803 | 1808 | | |
1804 | 1809 | | |
1805 | 1810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| 352 | + | |
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
355 | | - | |
| 356 | + | |
| 357 | + | |
356 | 358 | | |
357 | | - | |
| 359 | + | |
358 | 360 | | |
359 | 361 | | |
360 | 362 | | |
| |||
374 | 376 | | |
375 | 377 | | |
376 | 378 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
381 | 385 | | |
382 | 386 | | |
383 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3075 | 3075 | | |
3076 | 3076 | | |
3077 | 3077 | | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
3078 | 3135 | | |
3079 | 3136 | | |
3080 | 3137 | | |
| |||
3182 | 3239 | | |
3183 | 3240 | | |
3184 | 3241 | | |
3185 | | - | |
3186 | | - | |
3187 | | - | |
3188 | | - | |
3189 | | - | |
3190 | | - | |
3191 | | - | |
3192 | | - | |
3193 | | - | |
3194 | | - | |
3195 | | - | |
3196 | | - | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
3197 | 3245 | | |
3198 | 3246 | | |
3199 | | - | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
3200 | 3290 | | |
3201 | 3291 | | |
3202 | 3292 | | |
| |||
0 commit comments