Lines Matching defs:LEAs
55 #define DEBUG_TYPE "x86-optimize-LEAs"
247 /// been calculated by LEA. Also, remove redundant LEAs.
281 /// by these LEAs is returned in \p AddrDispShift. It'll be used for proper
289 void findLEAs(const MachineBasicBlock &MBB, MemOpMap &LEAs);
292 bool removeRedundantAddrCalc(MemOpMap &LEAs);
300 /// Removes LEAs which calculate similar addresses.
301 bool removeRedundantLEAs(MemOpMap &LEAs);
369 // as well. Also note that the list is sorted by the order in which the LEAs
418 // 1) Addresses calculated by LEAs differ only by displacement.
419 // 2) Def registers of LEAs belong to the same class.
479 MemOpMap &LEAs) {
490 LEAs[getMemOpKey(MI, 1)].push_back(const_cast<MachineInstr *>(&MI));
497 bool X86OptimizeLEAPass::removeRedundantAddrCalc(MemOpMap &LEAs) {
500 assert(!LEAs.empty());
501 MachineBasicBlock *MBB = (*LEAs.begin()->second.begin())->getParent();
520 auto Insns = LEAs.find(getMemOpKey(MI, MemOpNo));
521 if (Insns == LEAs.end())
621 // Try to find similar LEAs in the list and replace one with another.
622 bool X86OptimizeLEAPass::removeRedundantLEAs(MemOpMap &LEAs) {
626 for (auto &E : LEAs) {
638 // LEAs should be in occurrence order in the list, so we can freely
639 // replace later LEAs with earlier ones.
641 "LEAs must be in occurrence order in the list");
729 MemOpMap LEAs;
733 findLEAs(MBB, LEAs);
735 // If current basic block has no LEAs, move on to the next one.
736 if (LEAs.empty())
740 Changed |= removeRedundantLEAs(LEAs);
745 Changed |= removeRedundantAddrCalc(LEAs);