[llvm] r292189 - [TLI] Robustize SDAG proto checking by merging it into TLI.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 19:13:19 PST 2017


Hey folks,

I reverted this in r292191 because it broke some SystemZ tests I
missed locally (e.g., test/CodeGen/SystemZ/strlen-02.ll) that
explicitly check lowering for "incorrect" libc functions.  For
instance, a 'size_t' parameter being passed as an 'i32' on a 64-bit
target.

Do you rely on that behavior, or should I simply remove those tests?
I feel confident making that call on X86, but you might have different
requirements.

For some context: I'm trying to unify the multiple (down to 3!)
LibFunc prototype checkers, and, in doing so, restrict them to the
strictest variant.  The hope being, that should accept any declaration
of a LibFunc provided by a platform header, and any of those should be
supported by all TLI clients.

-Ahmed

On Mon, Jan 16, 2017 at 7:10 PM, Ahmed Bougacha via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: ab
> Date: Mon Jan 16 21:10:06 2017
> New Revision: 292189
>
> URL: http://llvm.org/viewvc/llvm-project?rev=292189&view=rev
> Log:
> [TLI] Robustize SDAG proto checking by merging it into TLI.
>
> 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 two 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.
>
> I don't think it's worth supporting either of these (IMO) broken
> testcases.  Instead, fix them to be more correct.
>
> Added:
>     llvm/trunk/test/CodeGen/X86/mempcpy-32.ll
> Modified:
>     llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>     llvm/trunk/test/CodeGen/X86/memcmp.ll
>     llvm/trunk/test/CodeGen/X86/mempcpy.ll
>


More information about the llvm-commits mailing list