[MIPS] Use custom bitcast lowering to avoid excessive instructions
authorSimon Atanasyan <simon@atanasyan.com>
Thu, 25 Apr 2019 07:47:28 +0000 (07:47 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Thu, 25 Apr 2019 07:47:28 +0000 (07:47 +0000)
commita0291110da6835f5c5afa4b77cda31a5b1af3ef8
tree202065df3713f7c9dcecaa7bee6de936a48ed83d
parent013503c78d7b648152a07022e75b98219aba2ba9
[MIPS] Use custom bitcast lowering to avoid excessive instructions

On Mips32r2 bitcast can be expanded to two sw instructions and an ldc1
when using bitcast i64 to double or an sdc1 and two lw instructions when
using bitcast double to i64. By introducing custom lowering that uses
mtc1/mthc1 we can avoid excessive instructions.

Patch by Mirko Brkusanin.

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

llvm-svn: 359171
llvm/lib/Target/Mips/MipsISelLowering.cpp
llvm/lib/Target/Mips/MipsSEISelLowering.cpp
llvm/lib/Target/Mips/MipsSEISelLowering.h
llvm/test/CodeGen/Mips/llvm-ir/bitcast.ll