Expose hasLiveCondCodeDef as a member function of the X86InstrInfo class. NFC
authorAndrew Kaylor <andrew.kaylor@intel.com>
Wed, 26 Aug 2015 20:36:52 +0000 (20:36 +0000)
committerAndrew Kaylor <andrew.kaylor@intel.com>
Wed, 26 Aug 2015 20:36:52 +0000 (20:36 +0000)
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.

Patch by: Kevin B. Smith
Differential Revision: http://reviews.llvm.org/D12371

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

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

index c3e862b09edb9bec8e02195f62922dbbe1368c3f..17980e6a80531ec5f132a9464284bbcd6e030c31 100644 (file)
@@ -2431,7 +2431,7 @@ void X86InstrInfo::reMaterialize(MachineBasicBlock &MBB,
 }
 
 /// 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 71a48866df4a6705029e60c0077053b21c7bfc10..2e8fb9a518a8b56475cc8bba38e944ac4463e248 100644 (file)
@@ -401,6 +401,10 @@ public:
   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());