Lines Matching defs:ED
365 ExtValue(const ExtDesc &ED) : ExtValue(ED.getOp()) {}
395 OffsetRange getOffsetRange(const ExtDesc &ED) const;
406 bool replaceInstrExact(const ExtDesc &ED, Register ExtR);
407 bool replaceInstrExpr(const ExtDesc &ED, const ExtenderInit &ExtI,
426 friend raw_ostream &operator<< (raw_ostream &OS, const ExtDesc &ED);
493 raw_ostream &operator<< (raw_ostream &OS, const HCE::ExtDesc &ED) {
494 assert(ED.OpNum != -1u);
495 const MachineBasicBlock &MBB = *ED.getOp().getParent()->getParent();
499 if (ED.Rd.Reg != 0)
500 OS << printReg(ED.Rd.Reg, &HRI, ED.Rd.Sub);
503 OS << " = " << PrintExpr(ED.Expr, HRI);
504 if (ED.IsDef)
1093 // Return the allowable deviation from the current value of the extender ED,
1094 // for which the instruction corresponding to ED can be modified without
1100 OffsetRange HCE::getOffsetRange(const ExtDesc &ED) const {
1102 // the instruction using ED will be converted to an indexed memory
1104 unsigned IdxOpc = getRegOffOpcode(ED.UseMI->getOpcode());
1114 if (!ED.UseMI->mayLoad() && !ED.UseMI->mayStore())
1144 ExtDesc ED;
1145 ED.OpNum = OpNum;
1164 ED.Rd = MI.getOperand(OpNum-1);
1165 ED.IsDef = true;
1172 ED.Expr.Rs = MI.getOperand(OpNum-1);
1175 ED.Expr.Rs = MI.getOperand(OpNum-2);
1176 ED.Expr.S = MI.getOperand(OpNum-1).getImm();
1184 ED.Rd = MI.getOperand(0);
1185 ED.IsDef = true;
1189 ED.Rd = { MI.getOperand(0).getReg(), Hexagon::isub_hi };
1190 ED.IsDef = true;
1193 ED.Rd = { MI.getOperand(0).getReg(), Hexagon::isub_lo };
1194 ED.IsDef = true;
1197 ED.Rd = MI.getOperand(0);
1198 ED.Expr.Rs = MI.getOperand(OpNum-1);
1203 ED.Expr.Rs = MI.getOperand(OpNum-1);
1206 ED.Rd = MI.getOperand(0);
1207 ED.Expr.Rs = MI.getOperand(OpNum+1);
1208 ED.Expr.Neg = true;
1211 ED.Expr.Rs = MI.getOperand(OpNum+1);
1212 ED.Expr.Neg = true;
1219 ED.UseMI = &MI;
1222 ExtRoot ER(ED.getOp());
1230 Extenders.push_back(ED);
1279 const ExtDesc &ED = Extenders[I];
1280 if (!ED.IsDef)
1282 ExtValue EV(ED);
1283 LLVM_DEBUG(dbgs() << " =" << I << ". " << EV << " " << ED << '\n');
1284 assert(ED.Rd.Reg != 0);
1285 Ranges[I-Begin] = getOffsetRange(ED.Rd).shift(EV.Offset);
1290 if (ED.UseMI->getOpcode() == Hexagon::A2_tfrsi) {
1299 const ExtDesc &ED = Extenders[I];
1300 if (ED.IsDef)
1302 ExtValue EV(ED);
1303 LLVM_DEBUG(dbgs() << " " << I << ". " << EV << " " << ED << '\n');
1304 OffsetRange Dev = getOffsetRange(ED);
1468 const ExtDesc &ED = Extenders[I];
1469 return ED.Expr.Rs.isSlot() == IsStack &&
1470 ExtValue(ED).Offset == EV.Offset;
1498 const ExtDesc &ED = Extenders[Refs[i]];
1499 MachineBasicBlock *MBB = ED.UseMI->getParent();
1500 RefMIs.insert(ED.UseMI);
1606 bool HCE::replaceInstrExact(const ExtDesc &ED, Register ExtR) {
1607 MachineInstr &MI = *ED.UseMI;
1651 unsigned RegN = ED.OpNum;
1722 // Replace the extender ED with a form corresponding to the initializer ExtI.
1723 bool HCE::replaceInstrExpr(const ExtDesc &ED, const ExtenderInit &ExtI,
1725 MachineInstr &MI = *ED.UseMI;
1854 const ExtDesc &ED = Extenders[Idx];
1855 assert((!ED.IsDef || ED.Rd.Reg != 0) && "Missing Rd for def");
1857 assert(ExtRoot(ExtValue(ED)) == ExtRoot(DefV) && "Extender root mismatch");
1860 ExtValue EV(ED);
1862 const MachineInstr &MI = *ED.UseMI;
1876 // If ED is a def, and Diff is not 0, then all uses of the register Rd
1877 // defined by ED must be in the form (Rd, imm), i.e. the immediate offset
1880 if (ED.IsDef && Diff != 0) {
1881 for (MachineOperand &Op : MRI->use_operands(ED.Rd.Reg)) {
1890 Replaced = replaceInstrExact(ED, ExtR);
1892 Replaced = replaceInstrExpr(ED, ExtI, ExtR, Diff);
1894 if (Diff != 0 && Replaced && ED.IsDef) {
1908 assert(ED.Rd.Sub == 0 && ExtR.Sub == 0);
1909 MRI->replaceRegWith(ED.Rd.Reg, ExtR.Reg);