[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h
Chris Lattner
lattner at cs.uiuc.edu
Tue Jan 18 22:53:15 PST 2005
Changes in directory llvm/include/llvm/Target:
TargetInstrInfo.h updated: 1.74 -> 1.75
---
Log message:
Add a new method, described in the comment.
---
Diffs of the changes: (+12 -0)
Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.74 llvm/include/llvm/Target/TargetInstrInfo.h:1.75
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.74 Sat Jan 1 20:28:31 2005
+++ llvm/include/llvm/Target/TargetInstrInfo.h Wed Jan 19 00:53:02 2005
@@ -177,6 +177,18 @@
return 0;
}
+ /// commuteInstruction - If a target has any instructions that are commutable,
+ /// but require converting to a different instruction or making non-trivial
+ /// changes to commute them, this method can overloaded to do this. The
+ /// default implementation of this method simply swaps the first two operands
+ /// of MI and returns it.
+ ///
+ /// If a target wants to make more aggressive changes, they can construct and
+ /// return a new machine instruction. If an instruction cannot commute, it
+ /// can also return null.
+ ///
+ virtual MachineInstr *commuteInstruction(MachineInstr *MI) const;
+
/// Insert a goto (unconditional branch) sequence to TMBB, at the
/// end of MBB
virtual void insertGoto(MachineBasicBlock& MBB,
More information about the llvm-commits
mailing list