[llvm-bugs] [Bug 49082] New: Machine Outliner outlines ARC marker changing program behavior

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 7 13:52:21 PST 2021


            Bug ID: 49082
           Summary: Machine Outliner outlines ARC marker changing program
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: kyulee.llvm at gmail.com
                CC: arnaud.degrandmaison at arm.com,
                    llvm-bugs at lists.llvm.org, smithp352 at googlemail.com,
                    Ties.Stuij at arm.com

Created attachment 24494
  --> https://bugs.llvm.org/attachment.cgi?id=24494&action=edit
MIR code showing an outlining that splits ARC marker.

In the following code sequence, the call ARC marker (`mov x29, x29`) is the way
the prior call (within the callee in the below) and the following
`objc_retainAutoreleasedReturnValue` to optimize unnecessary release/retain

bl objc_msgSend
mov x29, x29
bl objc_retainAutoreleasedReturnValue

As attached in the repro, Machine Outliner often outlines the latter part only
into an outlined function like:
mov x29, x29
bl objc_retainAutoreleasedReturnValue

This is not strictly a functional bug, but it may impact a potential
performance because it effectively disables the ARC marker.
It can also alter the program behavior in the presence of an existing ARC bug,
which is often hard to reason about from a slightly different semantic change
in autorelease vs release.

So, I think instead of outlining the part of code, outliner should either
outline the above whole code or not at all.

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/20210207/c38073fe/attachment.html>

More information about the llvm-bugs mailing list