else
Chain = DAG.getRoot();
- // Second pass over the constraints: compute which constraint option to use
- // and assign registers to constraints that want a specific physreg.
+ // Second pass over the constraints: compute which constraint option to use.
for (SDISelAsmOperandInfo &OpInfo : ConstraintOperands) {
// If this is an output operand with a matching input operand, look up the
// matching input. If their types mismatch, e.g. one is an integer, the
OpInfo.isIndirect = true;
}
- // If this constraint is for a specific register, allocate it before
- // anything else.
- SDISelAsmOperandInfo &RefOpInfo =
- OpInfo.isMatchingInputConstraint()
- ? ConstraintOperands[OpInfo.getMatchedOperand()]
- : OpInfo;
- if (RefOpInfo.ConstraintType == TargetLowering::C_Register)
- GetRegistersForValue(DAG, getCurSDLoc(), OpInfo, RefOpInfo);
}
// Third pass - Loop over all of the operands, assigning virtual or physregs
? ConstraintOperands[OpInfo.getMatchedOperand()]
: OpInfo;
- // C_Register operands have already been allocated, Other/Memory don't need
- // to be.
- if (RefOpInfo.ConstraintType == TargetLowering::C_RegisterClass)
+ if (RefOpInfo.ConstraintType == TargetLowering::C_Register ||
+ RefOpInfo.ConstraintType == TargetLowering::C_RegisterClass)
GetRegistersForValue(DAG, getCurSDLoc(), OpInfo, RefOpInfo);
}