<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:aschwaighofer@apple.com" title="Arnold Schwaighofer <aschwaighofer@apple.com>"> <span class="fn">Arnold Schwaighofer</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - LoopVectorizer does not detect that calloc and one of the parameters don't alias"
   href="http://llvm.org/bugs/show_bug.cgi?id=14719">bug 14719</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>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>aschwaighofer@apple.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>FIXED
           </td>
           <td>---
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Assignee</td>
           <td>unassignedbugs@nondot.org
           </td>
           <td>aschwaighofer@apple.com
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - LoopVectorizer does not detect that calloc and one of the parameters don't alias"
   href="http://llvm.org/bugs/show_bug.cgi?id=14719#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - LoopVectorizer does not detect that calloc and one of the parameters don't alias"
   href="http://llvm.org/bugs/show_bug.cgi?id=14719">bug 14719</a>
              from <span class="vcard"><a class="email" href="mailto:aschwaighofer@apple.com" title="Arnold Schwaighofer <aschwaighofer@apple.com>"> <span class="fn">Arnold Schwaighofer</span></a>
</span></b>
        <pre>I just stumbled over this while working on dependence checks.

This is not entirely correct:

  /// Check that the reads don't conflict with the read-writes.
  for (MI = Reads.begin(), ME = Reads.end(); MI != ME; ++MI) {
    Value *Val = (*MI).first;
    GetUnderlyingObjects(Val, TempObjects, DL);
    for (ValueVector::iterator UI=TempObjects.begin(), UE=TempObjects.end();
         UI != UE; ++UI) {
      // If all of the writes are identified then we don't care if the read
      // pointer is identified or not.
      if (!AllWritesIdentified && !isIdentifiedObject(*UI)) {
        DEBUG(dbgs() << "LV: Found an unidentified read ptr:"<< **UI <<"\n");
        NeedRTCheck = true;
      }


We could have GetUnderlying return an unidentified object because it stopped
after MaxSteps and have "A[i] = B[i]" where B == A - 1 (just hidden behind
enough phis).

We would however know that if all our writes are identified objects and the
read is a argument (isa<Argument>, like it is the case here) that they can't
alias.

if ((!AreAllWritesIdentified || !isa<Argument>(UnderlyingObj)) &&
!isIdentifiedObject(UnderlyingObj)) {
  NeedRTCheck = true;
}</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>