[SROA] Drop lifetime.start/end intrinsics when they block promotion.
authorEli Friedman <efriedma@codeaurora.org>
Mon, 28 Nov 2016 21:50:34 +0000 (21:50 +0000)
committerEli Friedman <efriedma@codeaurora.org>
Mon, 28 Nov 2016 21:50:34 +0000 (21:50 +0000)
commit5096775393b8509922bfc562ad497f1313cef3af
treed31c8136347d926383bbc93b0dfb8d4ad2fe9931
parent1cf9aff65952c7eb1bea7ecfd76a7dd5b0c6f450
[SROA] Drop lifetime.start/end intrinsics when they block promotion.

Preserving lifetime markers isn't as important as allowing promotion,
so just drop the lifetime markers if necessary.

This also fixes an assertion failure where other parts of SROA assumed
that lifetime markers never block promotion.

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

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

llvm-svn: 288074
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/basictest.ll