- if (Op.OperandInfo)
- MIOperandList.push_back(std::make_pair(Op.OperandInfo->MIOperandNo, i));
- }
-
- // Find any tied operands.
- SmallVector<std::pair<unsigned, unsigned>, 4> TiedOperands;
- for (unsigned i = 0, e = II.OperandList.size(); i != e; ++i) {
- const CGIOperandList::OperandInfo &OpInfo = II.OperandList[i];
- for (unsigned j = 0, e = OpInfo.Constraints.size(); j != e; ++j) {
- const CGIOperandList::ConstraintInfo &CI = OpInfo.Constraints[j];
- if (!CI.isTied()) continue;
- TiedOperands.push_back(std::make_pair(OpInfo.MIOperandNo,
- CI.getTiedOperand()));
- }
- }
-
- array_pod_sort(MIOperandList.begin(), MIOperandList.end());
-
- // Compute the total number of operands.
- unsigned NumMIOperands = 0;
- for (unsigned i = 0, e = II.OperandList.size(); i != e; ++i) {
- const CGIOperandList::OperandInfo &OI = II.OperandList[i];
- NumMIOperands = std::max(NumMIOperands, OI.MIOperandNo+OI.MINumOperands);
+ if (!Op.OperandInfo) continue;
+
+ unsigned LogicalOpNum = Op.OperandInfo - &II.OperandList[0];
+ assert(LogicalOpNum < OperandMap.size() && "Invalid operand number");
+ OperandMap[LogicalOpNum] = i;