As per the discussion on r280783, if constrainRegClass fails we need
to call getAllocatableClass like we did before that commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285467
91177308-0d34-0410-b5e6-
96231b3b80d8
const TargetRegisterClass *ConstrainedRC
= MRI->constrainRegClass(VReg, OpRC, MinRCSize);
if (!ConstrainedRC) {
+ OpRC = TRI->getAllocatableClass(OpRC);
+ assert(OpRC && "Constraints cannot be fulfilled for allocation");
unsigned NewVReg = MRI->createVirtualRegister(OpRC);
BuildMI(*MBB, InsertPos, Op.getNode()->getDebugLoc(),
TII->get(TargetOpcode::COPY), NewVReg).addReg(VReg);