<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:george.burgess.iv@gmail.com" title="George Burgess <george.burgess.iv@gmail.com>"> <span class="fn">George Burgess</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - CFL-AA falsely reports NoAlias on Arguments"
   href="https://llvm.org/bugs/show_bug.cgi?id=27213">bug 27213</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;">Status</td>
           <td>ASSIGNED
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - CFL-AA falsely reports NoAlias on Arguments"
   href="https://llvm.org/bugs/show_bug.cgi?id=27213#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - CFL-AA falsely reports NoAlias on Arguments"
   href="https://llvm.org/bugs/show_bug.cgi?id=27213">bug 27213</a>
              from <span class="vcard"><a class="email" href="mailto:george.burgess.iv@gmail.com" title="George Burgess <george.burgess.iv@gmail.com>"> <span class="fn">George Burgess</span></a>
</span></b>
        <pre>Fix committed as r265474.

The tl;dr of the problem was a collision of a few things:

- We mark a Node as a global or arg when visiting its edges
- We don't visit edges to "boring" nodes (e.g. constants)
- Stores themselves just create a link from value-being-stored to
pointer-being-stored-to.

So, from the example:

define void @foo(i32* %A, i32* %B) #0 {
entry:
  store i32 0, i32* %A, align 4
  %arrayidx = getelementptr inbounds i32, i32* %B, i64 1
  store i32 0, i32* %arrayidx, align 4
  ret void
}

...%A only had an edge to 'i32 0', which we didn't find interesting, so we
never visited it. Because we never visited it, we never reached the code that
notes that %A is an argument. Because we never noted %A was an argument, we
were more aggressive with marking it as NoAlias %B than we should have been.

The fix makes us mark things as args/globals before we start running through
their edges. (FWIW, I think there's a slightly faster way to do this if we
change the edge-visiting loop a bit, but I wanted to keep the fix as targeted
as possible)</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>