Add option to commuteInstruction() which forces it to create a new (commuted) instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52308 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2008-06-16 07:33:11 +00:00
parent 3557801289
commit 58dcb0e0cd
6 changed files with 51 additions and 13 deletions

View File

@@ -155,7 +155,10 @@ public:
/// return a new machine instruction. If an instruction cannot commute, it
/// can also return null.
///
virtual MachineInstr *commuteInstruction(MachineInstr *MI) const = 0;
/// If NewMI is true, then a new machine instruction must be created.
///
virtual MachineInstr *commuteInstruction(MachineInstr *MI,
bool NewMI = false) const = 0;
/// CommuteChangesDestination - Return true if commuting the specified
/// instruction will also changes the destination operand. Also return the
@@ -411,7 +414,8 @@ protected:
TargetInstrInfoImpl(const TargetInstrDesc *desc, unsigned NumOpcodes)
: TargetInstrInfo(desc, NumOpcodes) {}
public:
virtual MachineInstr *commuteInstruction(MachineInstr *MI) const;
virtual MachineInstr *commuteInstruction(MachineInstr *MI,
bool NewMI = false) const;
virtual bool CommuteChangesDestination(MachineInstr *MI,
unsigned &OpIdx) const;
virtual bool PredicateInstruction(MachineInstr *MI,