Do not remove empty lifetime.start/lifetime.end ranges
authorVitaly Buka <vitalybuka@google.com>
Thu, 28 Jul 2016 22:50:48 +0000 (22:50 +0000)
committerVitaly Buka <vitalybuka@google.com>
Thu, 28 Jul 2016 22:50:48 +0000 (22:50 +0000)
commitf0500b6ae526fef8238f4f6017ac9da2f5c3f756
treeb83db977507c80597568dd337804f3845ced274c
parent36457938725a34da13936a0e1eead7cc2147b0a2
Do not remove empty lifetime.start/lifetime.end ranges

Summary:
Asan stack-use-after-scope check should poison alloca even if there is
no access between start and end.

This is possible for code like this:
for (int i = 0; i < 3; i++) {
  int x;
  p = &x;
}

"Loop Invariant Code Motion" will move "p = &x;" out of the loop, making
start/end range empty.

PR27453

Reviewers: eugenis

Differential Revision: https://reviews.llvm.org/D22842

llvm-svn: 277068
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/lifetime-asan.ll