[PATCH] D12371: Expose hasLiveCondCodeDef as a member function of the X86InstrInfo class. NFC

Kevin B. Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 10:41:51 PDT 2015


kbsmith1 created this revision.
kbsmith1 added reviewers: ab, mkuper, spatel.
kbsmith1 added a subscriber: llvm-commits.

This takes the existing static function hasLiveCondCodeDef and makes it a member function of the X86InstrInfo class.  This is a useful utility function that an upcoming change would like to use. NFC.

http://reviews.llvm.org/D12371

Files:
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86InstrInfo.h

Index: lib/Target/X86/X86InstrInfo.cpp
===================================================================
--- lib/Target/X86/X86InstrInfo.cpp
+++ lib/Target/X86/X86InstrInfo.cpp
@@ -2431,7 +2431,7 @@
 }
 
 /// True if MI has a condition code def, e.g. EFLAGS, that is not marked dead.
-static bool hasLiveCondCodeDef(MachineInstr *MI) {
+bool X86InstrInfo::hasLiveCondCodeDef(MachineInstr *MI) const {
   for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
     MachineOperand &MO = MI->getOperand(i);
     if (MO.isReg() && MO.isDef() &&
Index: lib/Target/X86/X86InstrInfo.h
===================================================================
--- lib/Target/X86/X86InstrInfo.h
+++ lib/Target/X86/X86InstrInfo.h
@@ -401,6 +401,10 @@
   bool isSafeToClobberEFLAGS(MachineBasicBlock &MBB,
                              MachineBasicBlock::iterator I) const;
 
+  /// True if MI has a condition code def, e.g. EFLAGS, that is
+  /// not marked dead.
+  bool hasLiveCondCodeDef(MachineInstr *MI) const;
+
   static bool isX86_64ExtendedReg(const MachineOperand &MO) {
     if (!MO.isReg()) return false;
     return X86II::isX86_64ExtendedReg(MO.getReg());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12371.33218.patch
Type: text/x-patch
Size: 1163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150826/d00d7b2a/attachment.bin>


More information about the llvm-commits mailing list