Fix a bug which prevented tail merging of return instructions in
authorDan Gohman <gohman@apple.com>
Mon, 3 May 2010 14:35:47 +0000 (14:35 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 3 May 2010 14:35:47 +0000 (14:35 +0000)
commit30fc5bbfd1047c666bfd653fefb74ffdc6e966f5
tree1a7147a75328559c3ce37fc63cd61daac8b61818
parent3a2a4846a67c8fa7b604c76d238fddd8b51886fd
Fix a bug which prevented tail merging of return instructions in
beneficial cases. See the changes in test/CodeGen/X86/tail-opts.ll and
test/CodeGen/ARM/ifcvt2.ll for details.

The fix is to change HashEndOfMBB to hash at most one instruction,
instead of trying to apply heuristics about when it will be profitable to
consider more than one instruction. The regular tail-merging heuristics
are already prepared to handle the same cases, and they're more precise.

Also, make test/CodeGen/ARM/ifcvt5.ll and
test/CodeGen/Thumb2/thumb2-branch.ll slightly more complex so that they
continue to test what they're intended to test.

And, this eliminates the problem in
test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll, the testcase from
PR5204. Update it accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102907 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BranchFolding.cpp
test/CodeGen/ARM/ifcvt2.ll
test/CodeGen/ARM/ifcvt5.ll
test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll
test/CodeGen/Thumb2/thumb2-branch.ll
test/CodeGen/X86/tail-opts.ll