[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h

Misha Brukman brukman at cs.uiuc.edu
Fri May 23 19:09:01 PDT 2003


Changes in directory llvm/include/llvm/Target:

TargetInstrInfo.h updated: 1.42 -> 1.43

---
Log message:

NOP instructions are pseudo-instructions. We should not have them explicitly in
our representation, since they are usually special cases of already-existing
instructions.

This abstracts away methods that let a pass create and verify a NOP instruction,
without relying on a `NOP' enum to be in existence in the target's instruction
info descriptor.


---
Diffs of the changes:

Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.42 llvm/include/llvm/Target/TargetInstrInfo.h:1.43
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.42	Tue Jan 14 15:59:58 2003
+++ llvm/include/llvm/Target/TargetInstrInfo.h	Fri May 23 19:08:39 2003
@@ -273,6 +273,20 @@
     return true;                        // safe but very conservative
   }
 
+
+  /// createNOPinstr - returns the target's implementation of NOP, which is
+  /// usually a pseudo-instruction, implemented by a degenerate version of
+  /// another instruction, e.g. X86: xchg ax, ax; SparcV9: sethi g0, 0
+  ///
+  virtual MachineInstr* createNOPinstr() const = 0;
+
+  /// isNOPinstr - since we no longer have a special NOP opcode, we need to know
+  /// if a given instruction is interpreted as an `official' NOP instr, i.e.,
+  /// there may be more than one way to `do nothing' but only one canonical
+  /// way to slack off.
+  ///
+  virtual bool isNOPinstr(const MachineInstr &MI) const = 0;
+
   //-------------------------------------------------------------------------
   // Code generation support for creating individual machine instructions
   //





More information about the llvm-commits mailing list