Do not insert a tail call when returning multiple values on X86
authorKeno Fischer <kfischer@college.harvard.edu>
Wed, 20 Aug 2014 19:00:37 +0000 (19:00 +0000)
committerKeno Fischer <kfischer@college.harvard.edu>
Wed, 20 Aug 2014 19:00:37 +0000 (19:00 +0000)
commit4b1cddbaf030af33fc25259b4afefb56141a8a59
treefaee497ac2c8938db8f35194fd18064ca24a746f
parent242320399f791e62e06cd9fdd1154c0732bf1ee2
Do not insert a tail call when returning multiple values on X86

Summary: This fixes http://llvm.org/bugs/show_bug.cgi?id=19530.
The problem is that X86ISelLowering erroneously thought the third call
was eligible for tail call elimination.
It would have been if it's return value was actually the one returned
by the calling function, but here that is not the case and
additional values are being returned.

Test Plan: Test case from the original bug report is included.

Reviewers: rafael

Reviewed By: rafael

Subscribers: rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D4968

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216117 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/tailcall-multiret.ll [new file with mode: 0644]