[MIPS GlobalISel] Combine extending loads
commit2e46a962e82297f2966c813c282d0c7ae7566792
authorPetar Avramovic <Petar.Avramovic@rt-rk.com>
Thu, 24 Jan 2019 10:09:52 +0000 (24 10:09 +0000)
committerPetar Avramovic <Petar.Avramovic@rt-rk.com>
Thu, 24 Jan 2019 10:09:52 +0000 (24 10:09 +0000)
tree4680d2edc5dbbe1ee5d479319aadabcc42cf6f88
parent920ce5ccedb13a52182c2d801d8dadcbea7cd985
[MIPS GlobalISel] Combine extending loads

Use CombinerHelper to combine extending load instructions.
G_LOAD combined with G_ZEXT, G_SEXT or G_ANYEXT gives G_ZEXTLOAD,
G_SEXTLOAD or G_LOAD with same type as def of extending instruction
respectively.
Similarly G_ZEXTLOAD combined with G_ZEXT gives G_ZEXTLOAD and
G_SEXTLOAD combined with G_SEXT gives G_SEXTLOAD with same type
as def of extending instruction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352037 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsPreLegalizerCombiner.cpp
test/CodeGen/Mips/GlobalISel/mips-prelegalizer-combiner/truncStore_and_aExtLoad.mir [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/mips-prelegalizer-combiner/zextLoad_and_sextLoad.mir [new file with mode: 0644]