ignore register zero in isRegTiedToUseOperand, following the example of
authorChris Lattner <sabre@nondot.org>
Thu, 9 Apr 2009 23:33:34 +0000 (23:33 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 9 Apr 2009 23:33:34 +0000 (23:33 +0000)
isRegTiedToDefOperand.  Thanks to Bob for pointing this out!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68734 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineInstr.cpp

index d3b2e9a91c8e272f546ad4e6d82cc91f273adf0f..a227f25190a4f5951ff52520952259c95333c56a 100644 (file)
@@ -698,7 +698,7 @@ bool MachineInstr::isRegTiedToUseOperand(unsigned DefOpIdx, unsigned *UseOpIdx){
   if (getOpcode() == TargetInstrInfo::INLINEASM) {
     assert(DefOpIdx >= 2);
     const MachineOperand &MO = getOperand(DefOpIdx);
-    if (!MO.isReg() || !MO.isDef())
+    if (!MO.isReg() || !MO.isDef() || MO.getReg() == 0)
       return false;
     // Determine the actual operand no corresponding to this index.
     unsigned DefNo = 0;