forked from OSchip/llvm-project
Edit and clarify comments for TargetInstrInfo methods:
None of the existing implementations of commuteInstruction create new instructions unless the NewMI parameter is true, but the comment had implied otherwise. findCommutedOpIndices returns false, not true, when it doesn't know how to commute the instruction. llvm-svn: 106761
This commit is contained in:
parent
5235cc2c25
commit
1cfe454c87
|
@ -237,23 +237,19 @@ public:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// commuteInstruction - If a target has any instructions that are commutable,
|
/// commuteInstruction - If a target has any instructions that are
|
||||||
/// but require converting to a different instruction or making non-trivial
|
/// commutable but require converting to different instructions or making
|
||||||
/// changes to commute them, this method can overloaded to do this. The
|
/// non-trivial changes to commute them, this method can overloaded to do
|
||||||
/// default implementation of this method simply swaps the first two operands
|
/// that. The default implementation simply swaps the commutable operands.
|
||||||
/// of MI and returns it.
|
/// If NewMI is false, MI is modified in place and returned; otherwise, a
|
||||||
///
|
/// new machine instruction is created and returned. Do not call this
|
||||||
/// If a target wants to make more aggressive changes, they can construct and
|
/// method for a non-commutable instruction, but there may be some cases
|
||||||
/// return a new machine instruction. If an instruction cannot commute, it
|
/// where this method fails and returns null.
|
||||||
/// can also return null.
|
|
||||||
///
|
|
||||||
/// If NewMI is true, then a new machine instruction must be created.
|
|
||||||
///
|
|
||||||
virtual MachineInstr *commuteInstruction(MachineInstr *MI,
|
virtual MachineInstr *commuteInstruction(MachineInstr *MI,
|
||||||
bool NewMI = false) const = 0;
|
bool NewMI = false) const = 0;
|
||||||
|
|
||||||
/// findCommutedOpIndices - If specified MI is commutable, return the two
|
/// findCommutedOpIndices - If specified MI is commutable, return the two
|
||||||
/// operand indices that would swap value. Return true if the instruction
|
/// operand indices that would swap value. Return false if the instruction
|
||||||
/// is not in a form which this routine understands.
|
/// is not in a form which this routine understands.
|
||||||
virtual bool findCommutedOpIndices(MachineInstr *MI, unsigned &SrcOpIdx1,
|
virtual bool findCommutedOpIndices(MachineInstr *MI, unsigned &SrcOpIdx1,
|
||||||
unsigned &SrcOpIdx2) const = 0;
|
unsigned &SrcOpIdx2) const = 0;
|
||||||
|
|
Loading…
Reference in New Issue