Add the Optimize Compares pass (disabled by default).
[oota-llvm.git] / lib / Target / ARM / ARMBaseInstrInfo.h
index 20fae2e54ee73e4ab690c7a31052e3f9b20c5127..4f1c4539243136ee6cf411ab295b85a4f0e2a784 100644 (file)
@@ -336,6 +336,17 @@ public:
                                          unsigned NumInstrs) const {
     return NumInstrs && NumInstrs == 1;
   }
+
+  /// isCompareInstr - If the machine instruction is a comparison instruction,
+  /// then return true. Also return the source register in SrcReg and the value
+  /// it compares against in CmpValue.
+  virtual bool isCompareInstr(const MachineInstr *MI, unsigned &SrcReg,
+                              int &CmpValue) const;
+
+  /// convertToSetZeroFlag - Convert the instruction to set the zero flag so
+  /// that we can remove a "comparison with zero".
+  virtual bool convertToSetZeroFlag(MachineInstr *Instr,
+                                    MachineInstr *CmpInstr) const;
 };
 
 static inline