Commit be1ca7e
committed
[SDAG] Allow folding stack slots into sincos/frexp in more cases
This adds a new helper `CanFoldStoreIntoFPLibCall()` to check that it is
safe to fold a store into a node that will expand to a library call that
takes output pointers. This requires checking for two (independent)
properties:
1. The store is not within a CALLSEQ_START..CALLSEQ_END pair
* If it is, the expansion would lead to nested call sequences (which is
invalid)
2. The node does not appear as a predecessor to the store
* If it does, attempting to merge the store into the call would result
in a cycle in the DAG
These two properties are checked as part of the same traversal in
`CanFoldStoreIntoFPLibCall()`1 parent ef50d79 commit be1ca7e
File tree
6 files changed
+236
-174
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen
- AArch64
- PowerPC
- RISCV
- X86
6 files changed
+236
-174
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2474 | 2474 | | |
2475 | 2475 | | |
2476 | 2476 | | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
2477 | 2516 | | |
2478 | 2517 | | |
2479 | 2518 | | |
| |||
2502 | 2541 | | |
2503 | 2542 | | |
2504 | 2543 | | |
2505 | | - | |
2506 | | - | |
2507 | | - | |
2508 | | - | |
2509 | | - | |
| 2544 | + | |
2510 | 2545 | | |
2511 | 2546 | | |
2512 | 2547 | | |
| |||
2515 | 2550 | | |
2516 | 2551 | | |
2517 | 2552 | | |
2518 | | - | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
2519 | 2559 | | |
| 2560 | + | |
2520 | 2561 | | |
2521 | 2562 | | |
2522 | | - | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
2523 | 2569 | | |
2524 | 2570 | | |
| 2571 | + | |
2525 | 2572 | | |
2526 | 2573 | | |
2527 | 2574 | | |
| |||
2563 | 2610 | | |
2564 | 2611 | | |
2565 | 2612 | | |
| 2613 | + | |
2566 | 2614 | | |
2567 | 2615 | | |
2568 | 2616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 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 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1365 | 1365 | | |
1366 | 1366 | | |
1367 | 1367 | | |
1368 | | - | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1369 | 1371 | | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | 1372 | | |
| 1373 | + | |
1377 | 1374 | | |
1378 | 1375 | | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
| 1376 | + | |
1382 | 1377 | | |
1383 | | - | |
1384 | 1378 | | |
1385 | 1379 | | |
1386 | 1380 | | |
1387 | 1381 | | |
1388 | 1382 | | |
1389 | 1383 | | |
1390 | | - | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
1391 | 1387 | | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
1398 | 1388 | | |
| 1389 | + | |
1399 | 1390 | | |
1400 | 1391 | | |
1401 | 1392 | | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
| 1393 | + | |
1405 | 1394 | | |
1406 | | - | |
1407 | 1395 | | |
1408 | 1396 | | |
1409 | 1397 | | |
| |||
0 commit comments