[llvm-bugs] [Bug 47215] Common code between acquire-release not sunk

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 29 07:38:40 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=47215

hiraditya <hiraditya at msn.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from hiraditya <hiraditya at msn.com> ---
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 at PAGE+8
0000000000000080        add     x19, x19, __MergedGlobals at 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 at PAGE+8
00000000000000a8        add     x0, x0, __MergedGlobals at 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 at PAGE
00000000000000c0        add     x0, x0, __MergedGlobals at PAGEOFF
00000000000000c4        str     x19, [x0], #0x8
00000000000000c8        adrp    x19, __MergedGlobals at PAGE+8
00000000000000cc        add     x19, x19, __MergedGlobals at PAGEOFF+8
00000000000000d0        bl      ___cxa_guard_release
00000000000000d4        b       0x8c
00000000000000d8        adrp    x0, __MergedGlobals at PAGE+8
00000000000000dc        add     x0, x0, __MergedGlobals at 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 at PAGE
00000000000000f4        add     x0, x0, __MergedGlobals at 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
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211029/edc02868/attachment.html>


More information about the llvm-bugs mailing list