[mips] Sign extend i32 return values on MIPS64
authorStefan Maksimovic <stefan.maksimovic@mips.com>
Thu, 26 Jul 2018 10:59:35 +0000 (10:59 +0000)
committerStefan Maksimovic <stefan.maksimovic@mips.com>
Thu, 26 Jul 2018 10:59:35 +0000 (10:59 +0000)
commit4a612d4bf290346ec018a74fd245c8e30ff93de7
tree5fbefdf47bdb50c54befcd4907c4b294e487501e
parent9dafd6f6d93ca67f63c09aa091b28ddf88ddfc14
[mips] Sign extend i32 return values on MIPS64

Override getTypeForExtReturn so that functions returning
an i32 typed value have it sign extended on MIPS64.

Also provide patterns to get rid of unneeded sign extensions
for arithmetic instructions which implicitly sign extend
their results.

Differential Revision: https://reviews.llvm.org/D48374

llvm-svn: 338019
llvm/lib/Target/Mips/Mips64InstrInfo.td
llvm/lib/Target/Mips/Mips64r6InstrInfo.td
llvm/lib/Target/Mips/MipsISelLowering.cpp
llvm/lib/Target/Mips/MipsISelLowering.h
llvm/test/CodeGen/Mips/delay-slot-kill.ll
llvm/test/CodeGen/Mips/llvm-ir/and.ll
llvm/test/CodeGen/Mips/llvm-ir/not.ll
llvm/test/CodeGen/Mips/llvm-ir/or.ll
llvm/test/CodeGen/Mips/llvm-ir/select-int.ll
llvm/test/CodeGen/Mips/llvm-ir/xor.ll
llvm/test/CodeGen/Mips/shrink-wrapping.ll