Fix a pretty serious misfeature of the inliner: if it inlines a function
authorChris Lattner <sabre@nondot.org>
Tue, 27 Oct 2009 05:39:41 +0000 (05:39 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 27 Oct 2009 05:39:41 +0000 (05:39 +0000)
commitc581acbbba3cb1af6a08e17314b26344333f9267
tree942a87ef901f5e4fefcbdb33a74aa4e013f6ab6f
parent744f19aa15a4fe89631d3ee39955973f85196977
Fix a pretty serious misfeature of the inliner: if it inlines a function
with multiple return values it inserts a PHI to merge them all together.
However, if the return values are all the same, it ends up with a pointless
PHI and this pointless PHI happens to really block SRoA from happening in
at least a silly C++ example written by Doug, but probably others.  This
fixes rdar://7339069.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85206 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/InlineFunction.cpp
test/Transforms/Inline/basictest.ll