[ARM GlobalISel] Import MOVi32imm into GlobalISel
authorDiana Picus <diana.picus@linaro.org>
Mon, 14 Jan 2019 12:04:08 +0000 (12:04 +0000)
committerDiana Picus <diana.picus@linaro.org>
Mon, 14 Jan 2019 12:04:08 +0000 (12:04 +0000)
commit8987d00653a15214c5e21691c139ea8304bc99e6
tree1b28f69d68bf190bd1bac3377f66d3b08edc20ad
parent3d42815cd85783a815263fd4c0166ddafe37cfd8
[ARM GlobalISel] Import MOVi32imm into GlobalISel

Make it possible for TableGen to produce code for selecting MOVi32imm.
This allows reasonably recent ARM targets to select a lot more constants
than before.

We achieve this by adding GISelPredicateCode to arm_i32imm. It's
impossible to use the exact same code for both DAGISel and GlobalISel,
since one uses "Subtarget->" and the other "STI." to refer to the
subtarget. Moreover, in GlobalISel we don't have ready access to the
MachineFunction, so we need to add a bit of code for obtaining it from
the instruction that we're selecting. This is also the reason why it
needs to remain a PatLeaf instead of the more specific IntImmLeaf.

llvm-svn: 351056
llvm/lib/Target/ARM/ARMInstrInfo.td
llvm/test/CodeGen/ARM/GlobalISel/arm-instruction-select.mir