summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-19 06:53:02 +0000
committerChris Lattner <sabre@nondot.org>2005-01-19 06:53:02 +0000
commiteadd41207d74c66b0fc07ce174107ca5da7459bf (patch)
tree3b9f9cf4593bea531e1f6031567d6c519528ad04 /llvm
parent892336a1b5df876c1a427ea1348f1ec61b84d69b (diff)
downloadbcm5719-llvm-eadd41207d74c66b0fc07ce174107ca5da7459bf.tar.gz
bcm5719-llvm-eadd41207d74c66b0fc07ce174107ca5da7459bf.zip
Add a new method, described in the comment.
llvm-svn: 19683
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Target/TargetInstrInfo.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/TargetInstrInfo.h b/llvm/include/llvm/Target/TargetInstrInfo.h
index 855ce86ed08..d5237f2f7cc 100644
--- a/llvm/include/llvm/Target/TargetInstrInfo.h
+++ b/llvm/include/llvm/Target/TargetInstrInfo.h
@@ -177,6 +177,18 @@ public:
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,
OpenPOWER on IntegriCloud