OSDN Git Service

in X86-64 CCC, i8/i16 arguments are already properly zext/sext'd on input.
authorChris Lattner <sabre@nondot.org>
Mon, 26 Feb 2007 03:18:56 +0000 (03:18 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 26 Feb 2007 03:18:56 +0000 (03:18 +0000)
commitdf5cdb52887bf0ce57473053cf955152ce92b568
tree82893c46467fcb6683eb83687eb2d5eb77f7ec35
parent6c0880c62460521dd8d9e0bcb8482517fa7b482c
in X86-64 CCC, i8/i16 arguments are already properly zext/sext'd on input.
Capture this so that downstream zext/sext's are optimized out.  This
compiles:
  int test(short X) { return (int)X; }

to:

_test:
        movl %edi, %eax
        ret

instead of:

_test:
        movswl %di, %eax
        ret

GCC produces this bizarre code:

_test:
        movw    %di, -12(%rsp)
        movswl  -12(%rsp),%eax
        ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34623 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp