<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Machine Outliner outlines ARC marker changing program behavior"
   href="https://bugs.llvm.org/show_bug.cgi?id=49082">49082</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Machine Outliner outlines ARC marker changing program behavior
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: AArch64
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kyulee.llvm@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>arnaud.degrandmaison@arm.com, llvm-bugs@lists.llvm.org, smithp352@googlemail.com, Ties.Stuij@arm.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24494" name="attach_24494" title="MIR code showing an outlining that splits ARC marker.">attachment 24494</a> <a href="attachment.cgi?id=24494&action=edit" title="MIR code showing an outlining that splits ARC marker.">[details]</a></span>
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
operations. 

```
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:
```
OUTLINED_FUNCTION:
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.</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>