[llvm-bugs] [Bug 30807] New: [AliasSetTracker] Should ignore intrinsics that don't actually affect memory

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 27 05:35:30 PDT 2016


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

            Bug ID: 30807
           Summary: [AliasSetTracker] Should ignore intrinsics that don't
                    actually affect memory
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mcrosier at codeaurora.org
                CC: dberlin at dberlin.org, gberry at codeaurora.org,
                    hfinkel at anl.gov, llvm-bugs at lists.llvm.org
    Classification: Unclassified

In r285191, a patch was committed to allow AST to ignoring assume,
lifetime_[start|end], and invariant[start|end] intrinsics.  Unfortunately, this
caused one of the asan tests (i.e., use-after-scope-loop-bug.cc) to begin
failing on all the bots.

The test is as follows:
int main() {
  // Variable goes in and out of scope.
  for (int i = 0; i < 3; ++i) {
    int x[3] = {i, i, i};
    p = x + i;
  }
  return *p;  // BOOM
}

After r285191, LICM is able to sink the stores to x[] after the loop body. 
This appears to be reasonable behavior, but LICM (and likely other code motion
passes) will need to either 1) remove the lifetime markers from things you
hoist/sink or 2) extend the lifetime markers accordingly with the latter
solution being strongly preferred.  The algorithm for that is that when you
eliminate or sink things past them, you move the end to wherever the lowest
point you sunk to is.  You move starts to a block that post-dominates both the
new end and the old end.

r285191 was reverted in r285227 to return the bots to green.

-- 
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/20161027/0b568eee/attachment.html>


More information about the llvm-bugs mailing list