forked from OSchip/llvm-project
SDAG: Make sure we use an allocatable reg class when we create this vreg
As per the discussion on r280783, if constrainRegClass fails we need to call getAllocatableClass like we did before that commit. llvm-svn: 285467
This commit is contained in:
parent
0c3b87d925
commit
db6b6a7f0c
|
@ -338,6 +338,8 @@ InstrEmitter::AddRegisterOperand(MachineInstrBuilder &MIB,
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue