Optimize the case where we are inlining a function that contains only one basic block,
authorChris Lattner <sabre@nondot.org>
Wed, 4 Feb 2004 04:17:06 +0000 (04:17 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 4 Feb 2004 04:17:06 +0000 (04:17 +0000)
commit44a6807f4f785ecdd96b3aa67dad056677131b98
tree1bc3c0db2185317fbf0e496a446d3e9317fde6e0
parentcb2b3e5005c09f24afeb0dab49ac8bc1967e491a
Optimize the case where we are inlining a function that contains only one basic block,
and that basic block ends with a return instruction.  In this case, we can just splice
the cloned "body" of the function directly into the source basic block, avoiding a lot
of rearrangement and splitBasicBlock's linear scan over the split block.  This speeds up
the inliner on the testcase in PR209 from 2.3s to 1.7s, a 35% reduction.

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