Commit c522fd0
[PowerPC] Fix wrong codegen when stack pointer has to realign performing dynalloc
Current powerpc backend generates wrong code sequence if stack pointer
has to realign if `-fstack-clash-protection` enabled. When probing
dynamic stack allocation, current `PREPARE_PROBED_ALLOCA` takes
`NegSizeReg` as input and returns
`FinalStackPtr`. `FinalStackPtr=StackPtr+ActualNegSize` is calculated
correctly, however code following `PREPARE_PROBED_ALLOCA` still uses
value of `NegSizeReg`, which does not contain `ActualNegSize` if
`MaxAlign > TargetAlign`, to calculate loop trip count and residual
number of bytes.
This patch is part of fix of
https://bugs.llvm.org/show_bug.cgi?id=46759.
Differential Revision: https://reviews.llvm.org/D84152
(cherry picked from commit c3f9697)1 parent e95e071 commit c522fd0
File tree
6 files changed
+198
-160
lines changed- llvm
- lib/Target/PowerPC
- test/CodeGen/PowerPC
6 files changed
+198
-160
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11950 | 11950 | | |
11951 | 11951 | | |
11952 | 11952 | | |
11953 | | - | |
11954 | | - | |
11955 | | - | |
11956 | | - | |
11957 | | - | |
11958 | | - | |
11959 | | - | |
11960 | | - | |
| 11953 | + | |
| 11954 | + | |
| 11955 | + | |
| 11956 | + | |
| 11957 | + | |
| 11958 | + | |
| 11959 | + | |
| 11960 | + | |
| 11961 | + | |
| 11962 | + | |
| 11963 | + | |
| 11964 | + | |
| 11965 | + | |
| 11966 | + | |
| 11967 | + | |
| 11968 | + | |
| 11969 | + | |
| 11970 | + | |
11961 | 11971 | | |
11962 | 11972 | | |
11963 | 11973 | | |
11964 | 11974 | | |
| 11975 | + | |
| 11976 | + | |
| 11977 | + | |
| 11978 | + | |
| 11979 | + | |
| 11980 | + | |
11965 | 11981 | | |
11966 | 11982 | | |
11967 | 11983 | | |
| |||
11982 | 11998 | | |
11983 | 11999 | | |
11984 | 12000 | | |
11985 | | - | |
| 12001 | + | |
11986 | 12002 | | |
11987 | 12003 | | |
11988 | 12004 | | |
| |||
11991 | 12007 | | |
11992 | 12008 | | |
11993 | 12009 | | |
11994 | | - | |
| 12010 | + | |
11995 | 12011 | | |
11996 | 12012 | | |
11997 | 12013 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
435 | | - | |
| 434 | + | |
| 435 | + | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
437 | 442 | | |
438 | 443 | | |
439 | 444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1406 | 1406 | | |
1407 | 1407 | | |
1408 | 1408 | | |
1409 | | - | |
1410 | | - | |
| 1409 | + | |
| 1410 | + | |
1411 | 1411 | | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1412 | 1417 | | |
1413 | 1418 | | |
1414 | 1419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
627 | | - | |
| 627 | + | |
628 | 628 | | |
629 | 629 | | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
640 | 643 | | |
641 | | - | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
642 | 651 | | |
643 | 652 | | |
644 | 653 | | |
| |||
1084 | 1093 | | |
1085 | 1094 | | |
1086 | 1095 | | |
1087 | | - | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
1088 | 1099 | | |
1089 | 1100 | | |
1090 | 1101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
0 commit comments