CodeGen: check return types match when emitting tail call to builtin.
authorTim Northover <tnorthover@apple.com>
Tue, 22 Mar 2016 19:14:38 +0000 (19:14 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 22 Mar 2016 19:14:38 +0000 (19:14 +0000)
commitb49a8a9dbbf7cf86293577e08746c219bb7d0de2
tree7a59e825bc248a0a88687d73507a045b98ce2fca
parentbfecef5e1b474078c23b86eb5beb5d4c271cb7c9
CodeGen: check return types match when emitting tail call to builtin.

We were just completely ignoring the types when determining whether we could
safely emit a libcall as a tail call. This is clearly wrong.

Theoretically, we could dig deeper looking for incidental matches (much like
the generic code in Analysis.cpp does), but it's probably not worth it for the
few libcalls that exist.

llvm-svn: 264084
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/test/CodeGen/ARM/tail-call-builtin.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/atomic-non-integer.ll