OSDN Git Service

[TLI] Robustize SDAG LibFunc proto checking by merging it into TLI.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 3 Feb 2017 19:11:19 +0000 (19:11 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 3 Feb 2017 19:11:19 +0000 (19:11 +0000)
commit497ef8ab01901d65fdea1224a8dba5bb2ebddc56
tree302561bf8864832f8088eccc160a740b42458735
parentdce4987e9b54c8d4bc74722963668b55b7383e4c
[TLI] Robustize SDAG LibFunc proto checking by merging it into TLI.

This re-applies commit r292189, reverted in r292191.

SelectionDAGBuilder recognizes libfuncs using some homegrown
parameter type-checking.

Use TLI instead, removing another heap of redundant code.

This isn't strictly NFC, as the SDAG code was too lax.
Concretely, this means changes are required to a few tests:
- calling a non-variadic function via a variadic prototype isn't OK;
  it just happens to work on x86_64 (but not on, e.g., aarch64).
- mempcpy has a size_t parameter;  the SDAG code accepts any integer
  type, which meant using i32 on x86_64 worked.
- a handful of SystemZ tests check the SDAG support for lax prototype
  checking: Ulrich agrees on removing them.

I don't think it's worth supporting any of these (IMO) invalid
testcases.  Instead, fix them to be more meaningful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294028 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/SystemZ/memchr-01.ll
test/CodeGen/SystemZ/memchr-02.ll [deleted file]
test/CodeGen/SystemZ/memcmp-02.ll [deleted file]
test/CodeGen/SystemZ/strcmp-02.ll [deleted file]
test/CodeGen/SystemZ/strlen-02.ll [deleted file]
test/CodeGen/X86/memcmp.ll
test/CodeGen/X86/mempcpy-32.ll [new file with mode: 0644]
test/CodeGen/X86/mempcpy.ll