<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:hiraditya@msn.com" title="hiraditya <hiraditya@msn.com>"> <span class="fn">hiraditya</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Common code between acquire-release not sunk"
href="https://bugs.llvm.org/show_bug.cgi?id=47215">bug 47215</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Common code between acquire-release not sunk"
href="https://bugs.llvm.org/show_bug.cgi?id=47215#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Common code between acquire-release not sunk"
href="https://bugs.llvm.org/show_bug.cgi?id=47215">bug 47215</a>
from <span class="vcard"><a class="email" href="mailto:hiraditya@msn.com" title="hiraditya <hiraditya@msn.com>"> <span class="fn">hiraditya</span></a>
</span></b>
<pre>After looking at the llvm IR cft, and tracking branches, it doesn't look like
there are branches that will prevent hoisting-sinking etc. Machine outliner is
able to outline common code.
```
_main:
0000000000000070 stp x20, x19, [sp, #-0x20]!
0000000000000074 stp x29, x30, [sp, #0x10]
0000000000000078 add x29, sp, #0x10
000000000000007c adrp x19, __MergedGlobals@PAGE+8
0000000000000080 add x19, x19, __MergedGlobals@PAGEOFF+8
0000000000000084 ldarb w8, [x19]
0000000000000088 tbz w8, #0x0, 0xa4
000000000000008c ldarb w8, [x19]
0000000000000090 tbz w8, #0x0, 0xd8
0000000000000094 mov w0, #0x0
0000000000000098 ldp x29, x30, [sp, #0x10]
000000000000009c ldp x20, x19, [sp], #0x20
00000000000000a0 ret
00000000000000a4 adrp x0, __MergedGlobals@PAGE+8
00000000000000a8 add x0, x0, __MergedGlobals@PAGEOFF+8
00000000000000ac bl ___cxa_guard_acquire
00000000000000b0 cbz w0, 0x8c
00000000000000b4 bl _OUTLINED_FUNCTION_1
00000000000000b8 bl _OUTLINED_FUNCTION_0
00000000000000bc adrp x0, __MergedGlobals@PAGE
00000000000000c0 add x0, x0, __MergedGlobals@PAGEOFF
00000000000000c4 str x19, [x0], #0x8
00000000000000c8 adrp x19, __MergedGlobals@PAGE+8
00000000000000cc add x19, x19, __MergedGlobals@PAGEOFF+8
00000000000000d0 bl ___cxa_guard_release
00000000000000d4 b 0x8c
00000000000000d8 adrp x0, __MergedGlobals@PAGE+8
00000000000000dc add x0, x0, __MergedGlobals@PAGEOFF+8
00000000000000e0 bl ___cxa_guard_acquire
00000000000000e4 cbz w0, 0x94
00000000000000e8 bl _OUTLINED_FUNCTION_1
00000000000000ec bl _OUTLINED_FUNCTION_0
00000000000000f0 adrp x0, __MergedGlobals@PAGE
00000000000000f4 add x0, x0, __MergedGlobals@PAGEOFF
00000000000000f8 str x19, [x0], #0x8
00000000000000fc bl ___cxa_guard_release
0000000000000100 mov w0, #0x0
0000000000000104 ldp x29, x30, [sp, #0x10]
0000000000000108 ldp x20, x19, [sp], #0x20
000000000000010c ret
_OUTLINED_FUNCTION_0:
0000000000000110 mov x19, x0
0000000000000114 b __ZN3fooC1Ev
_OUTLINED_FUNCTION_1:
0000000000000118 mov w0, #0x1
000000000000011c b __Znwm
```</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>