[ARM] GlobalISel: Select G_CONSTANT with CImm operands
authorDiana Picus <diana.picus@linaro.org>
Mon, 24 Apr 2017 06:30:56 +0000 (06:30 +0000)
committerDiana Picus <diana.picus@linaro.org>
Mon, 24 Apr 2017 06:30:56 +0000 (06:30 +0000)
commit95a8aa93e231d7a6cd3ab5ef75d2b016f11dc004
tree49c0bd84f684f068073a75c358c12133ec7a0523
parent01b880a954364f03ee42087a67a29bf289f1f1a5
[ARM] GlobalISel: Select G_CONSTANT with CImm operands

When selecting a G_CONSTANT to a MOVi, we need the value to be an Imm
operand. We used to just leave the G_CONSTANT operand unchanged, which
works in some cases (such as the GEP offsets that we create when
referring to stack slots). However, in many other places the G_CONSTANTs
are created with CImm operands. This patch makes sure to handle those as
well, and to error out gracefully if in the end we don't end up with an
Imm operand.

Thanks to Oliver Stannard for reporting this issue.

llvm-svn: 301162
llvm/lib/Target/ARM/ARMInstructionSelector.cpp
llvm/test/CodeGen/ARM/GlobalISel/arm-instruction-select.mir
llvm/test/CodeGen/ARM/GlobalISel/arm-isel.ll