X86: More efficient legalization of wide integer compares
[oota-llvm.git] / lib / CodeGen / AggressiveAntiDepBreaker.cpp
index 7eac7ce163fa246b503d3967bcc607d507c8976f..845408f15f5c052faa8824937ba80c60dde8b3c0 100644 (file)
@@ -142,7 +142,7 @@ void AggressiveAntiDepBreaker::StartBlock(MachineBasicBlock *BB) {
   assert(!State);
   State = new AggressiveAntiDepState(TRI->getNumRegs(), BB);
 
-  bool IsReturnBlock = (!BB->empty() && BB->back().isReturn());
+  bool IsReturnBlock = BB->isReturnBlock();
   std::vector<unsigned> &KillIndices = State->GetKillIndices();
   std::vector<unsigned> &DefIndices = State->GetDefIndices();
 
@@ -224,7 +224,12 @@ bool AggressiveAntiDepBreaker::IsImplicitDefUse(MachineInstr *MI,
   if (Reg == 0)
     return false;
 
-  MachineOperand *Op = MI->findRegisterUseOperand(Reg, /*isKill=*/MO.isDef());
+  MachineOperand *Op = nullptr;
+  if (MO.isDef())
+    Op = MI->findRegisterUseOperand(Reg, true);
+  else
+    Op = MI->findRegisterDefOperand(Reg);
+
   return(Op && Op->isImplicit());
 }