]> granicus.if.org Git - llvm/commitdiff
[SystemZ] NFC: use clearRegisterDeads() in SystemZElimCompare.cpp
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Mon, 9 Sep 2019 07:58:57 +0000 (07:58 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Mon, 9 Sep 2019 07:58:57 +0000 (07:58 +0000)
This is simpler than using findRegisterDefOperandIdx() + setIsDead().

Review: Ulrich Weigand.

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

lib/Target/SystemZ/SystemZElimCompare.cpp

index 36babf029921e7247bbc89200a8a5c97158de455..946eb2ba7c79cefeccb5c0da76ca625060d8d197 100644 (file)
@@ -378,11 +378,8 @@ bool SystemZElimCompare::adjustCCMasksForInstr(
   }
 
   // CC is now live after MI.
-  if (!ConvOpc) {
-    int CCDef = MI.findRegisterDefOperandIdx(SystemZ::CC, false, true, TRI);
-    assert(CCDef >= 0 && "Couldn't find CC set");
-    MI.getOperand(CCDef).setIsDead(false);
-  }
+  if (!ConvOpc)
+    MI.clearRegisterDeads(SystemZ::CC);
 
   // Check if MI lies before Compare.
   bool BeforeCmp = false;