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: unassignedb...@nondot.org
          Reporter: mcros...@codeaurora.org
                CC: dber...@dberlin.org, gbe...@codeaurora.org,
                    hfin...@anl.gov, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to