Remove llvm.lifetime.start/end in original region.
commit52f66d6285a297b465d3ef984bc7623398abb1e6
authorMichael Kruse <llvm@meinersbur.de>
Wed, 5 Apr 2017 20:09:59 +0000 (5 20:09 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Wed, 5 Apr 2017 20:09:59 +0000 (5 20:09 +0000)
treec7d673f90ac49dc7b383adfaeaaa9cb875b96e99
parent2b9c71d095ea35d69c1451b63e2f26b536dc8e47
Remove llvm.lifetime.start/end in original region.

The current StackColoring algorithm does not correctly handle the
situation when some, but not all paths from a BB to the entry node
cross a llvm.lifetime.start. According to an interpretation of the
language reference at
http://llvm.org/docs/LangRef.html#llvm-lifetime-start-intrinsic
this might be correct, but it would cost too much effort to handle
in StackColoring.

To be on the safe side, remove all lifetime markers even in the original
code version (they have never been copied to the optimized version)
to ensure that no path to the entry block will cross a
llvm.lifetime.start.

The same principle applies to paths the a function return and the
llvm.lifetime.end marker, so we remove them as well.

This fixes llvm.org/PR32251.

Also see the discussion at
http://lists.llvm.org/pipermail/llvm-dev/2017-March/111551.html

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@299585 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGeneration.cpp
test/Isl/CodeGen/intrinsics_lifetime.ll