Commit f359347
committed
[PPC][BOLT] Implement convertJmpToTailCall for PowerPC.
BOLT relies on treating tail calls as calls to build correct CFGs and preserve interprocedural analysis. On PowerPC, the compiler often emits plain branches (b, ba, bctr) instead of explicit calls when lowering tail calls. (TCO Tail Call Optimisation).
This patch overrides convertJmpToTailCall in PPCMCPlusBuilder so that uncoditional branches are converted into their link-bit variants (BL, BLA, BCTRL). This way, BOLT can consistently recognise them as calls/tail calls during dissasembly and optimisation, including when skipping PLT (Procedure Linkage Table) stubs.1 parent 3b1e7d2 commit f359347
1 file changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
103 | 118 | | |
104 | 119 | | |
105 | 120 | | |
| |||
0 commit comments