Commit f10742a
Stop widening moves from blocking move optimization
Summary:
Follow-up to keeping 32 -> 64 bit zero-extends as `MovZX`. Two places
still assumed that width of zero-extend was a plain `Move`:
- `emitBoxPrimitive` hand-rolled the unsigned 32-bit case as a 32-bit
`Move`, the last spot outside codegen that spelled a zero-extend as
something other than what it is. It now emits `MovZX`, matching the
signed branch directly above it. The encoding is unchanged, `MovZX`
from a 32-bit source lowers to exactly that 32-bit move.
- `optimizeMoveSequence` caches register-to-spill-slot copies so a later
read of the slot can use the register instead, and it dropped the whole
cache on any instruction that was not a Move, Push or Pop. A widening
move only writes its register output, so it now invalidates just that
location. Before this, a `MovZX` sitting in the middle of a run of
argument copies would throw away everything learned before it.
`optimizeMoveInstrs` is deliberately left alone. It drops a `Move` whose
source and destination are the same location, which is not valid for a
widening move, the part of the destination the source does not cover
still has to be written. The 32-bit return value in `emitBoxPrimitive`
is exactly that case, hence the comment added there.
Reviewed By: yoney
Differential Revision: D116031677
fbshipit-source-id: 8b5234cd3575c2a987d4def76e4874d5ac0a3b9e1 parent 252f688 commit f10742a
3 files changed
Lines changed: 58 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1196 | 1196 | | |
1197 | 1197 | | |
1198 | 1198 | | |
1199 | | - | |
1200 | 1199 | | |
1201 | 1200 | | |
1202 | 1201 | | |
| |||
1205 | 1204 | | |
1206 | 1205 | | |
1207 | 1206 | | |
1208 | | - | |
| 1207 | + | |
1209 | 1208 | | |
1210 | | - | |
| 1209 | + | |
1211 | 1210 | | |
1212 | 1211 | | |
1213 | 1212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
639 | 642 | | |
640 | 643 | | |
641 | 644 | | |
| |||
1560 | 1563 | | |
1561 | 1564 | | |
1562 | 1565 | | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
1576 | 1576 | | |
1577 | 1577 | | |
1578 | 1578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
| |||
240 | 239 | | |
241 | 240 | | |
242 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
243 | 285 | | |
244 | 286 | | |
245 | 287 | | |
| |||
0 commit comments