[MIPS GlobalISel] Select any extending load and truncating store
commitbc2f8354dce1579d22cca9c52f3a75afbe42891c
authorPetar Avramovic <Petar.Avramovic@rt-rk.com>
Fri, 8 Feb 2019 14:27:23 +0000 (8 14:27 +0000)
committerPetar Avramovic <Petar.Avramovic@rt-rk.com>
Fri, 8 Feb 2019 14:27:23 +0000 (8 14:27 +0000)
tree2100a8fe88b22ffae50457f35f388b7284c2b27b
parentc7df218148d91750b7856c32686a40685572459f
[MIPS GlobalISel] Select any extending load and truncating store

Make behavior of G_LOAD in widenScalar same as for G_ZEXTLOAD and
G_SEXTLOAD. That is perform widenScalarDst to size given by the target
and avoid additional checks in common code. Targets can reorder or add
additional rules in LegalizeRuleSet for the opcode to achieve desired
behavior.

Select extending load that does not have specified type of extension
into zero extending load.

Select truncating store that stores number of bytes indicated by size
in MachineMemoperand.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353520 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
lib/Target/Mips/MipsInstructionSelector.cpp
lib/Target/Mips/MipsLegalizerInfo.cpp
test/CodeGen/AMDGPU/GlobalISel/legalize-sextload-flat.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-zextload-flat.mir
test/CodeGen/Mips/GlobalISel/instruction-select/truncStore_and_aExtLoad.mir [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/legalizer/truncStore_and_aExtLoad.mir [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/llvm-ir/truncStore_and_aExtLoad.ll [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/regbankselect/truncStore_and_aExtLoad.mir [new file with mode: 0644]