[ARM] Fix PR 47980: Use constrainRegClass during foldImmediate opt.
authorPirama Arumuga Nainar <pirama@google.com>
Tue, 10 Nov 2020 19:15:16 +0000 (11:15 -0800)
committerPirama Arumuga Nainar <pirama@google.com>
Tue, 10 Nov 2020 21:38:11 +0000 (13:38 -0800)
commit8262e94a6da77e176dbd13d9eadce76da74489d4
tree9fb13e36faaf8f58daaedd8412e161b70e8fceb7
parente408935bb5339e20035d84307c666fbdd15e99e0
[ARM] Fix PR 47980: Use constrainRegClass during foldImmediate opt.

Previously we used setRegClass to rgpr, which may expand the register
domain if the result was already in a constrained class (tcgpr in the
above PR).

Differential Revision: https://reviews.llvm.org/D91192
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/test/CodeGen/ARM/peephole-callee-save-regalloc.mir [new file with mode: 0644]