llvm.org GIT mirror llvm / d4201b6
TiedTo flag can now be placed on implicit operands. isTwoAddrUse() should look at all of the operands. Previously it was skipping over implicit operands which cause infinite looping when the two-address pass try to reschedule a two-address instruction below the kill of tied operand. I'm unable to come up with a reasonably sized test case. rdar://13747577 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180906 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 7 years ago
1 changed file(s) with 3 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
6161 // Temporary flag to disable rescheduling.
6262 static cl::opt
6363 EnableRescheduling("twoaddr-reschedule",
64 cl::desc("Coalesce copies by rescheduling (default=true)"), cl::init(true), cl::Hidden);
64 cl::desc("Coalesce copies by rescheduling (default=true)"),
65 cl::init(true), cl::Hidden);
6566
6667 namespace {
6768 class TwoAddressInstructionPass : public MachineFunctionPass {
431432 /// isTwoAddrUse - Return true if the specified MI uses the specified register
432433 /// as a two-address use. If so, return the destination register by reference.
433434 static bool isTwoAddrUse(MachineInstr &MI, unsigned Reg, unsigned &DstReg) {
434 const MCInstrDesc &MCID = MI.getDesc();
435 unsigned NumOps = MI.isInlineAsm()
436 ? MI.getNumOperands() : MCID.getNumOperands();
437 for (unsigned i = 0; i != NumOps; ++i) {
435 for (unsigned i = 0, NumOps = MI.getNumOperands(); i != NumOps; ++i) {
438436 const MachineOperand &MO = MI.getOperand(i);
439437 if (!MO.isReg() || !MO.isUse() || MO.getReg() != Reg)
440438 continue;