Add a flag to indicate that an instruction is as cheap (or cheaper) than a move

instruction to execute. This can be used for transformations (like two-address
conversion) to remat an instruction instead of generating a "move"
instruction. The idea is to decrease the live ranges and register pressure and
all that jazz.

llvm-svn: 51660
This commit is contained in:
Bill Wendling
2008-05-28 22:54:52 +00:00
parent 5a83b097ed
commit 3f6bb2713e
6 changed files with 37 additions and 19 deletions

View File

@@ -639,9 +639,9 @@ void MachineInstr::copyPredicates(const MachineInstr *MI) {
}
}
/// isSafeToMove - Return true if it is safe to this instruction. If SawStore
/// true, it means there is a store (or call) between the instruction the
/// localtion and its intended destination.
/// isSafeToMove - Return true if it is safe to this instruction. If SawStore is
/// set to true, it means that there is a store (or call) between the
/// instruction's location and its intended destination.
bool MachineInstr::isSafeToMove(const TargetInstrInfo *TII, bool &SawStore) {
// Ignore stuff that we obviously can't move.
if (TID->mayStore() || TID->isCall()) {