diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-05-28 22:54:52 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-05-28 22:54:52 +0000 |
commit | aa25bb1320b4e94d2f90326ab73f2a42e5a4c3b7 (patch) | |
tree | 4689ca3c0b6ee971d3aef6ec8536642eefb377a8 /lib | |
parent | 023520fc86b25d1db939d9de179118f684948d1c (diff) | |
download | external_llvm-aa25bb1320b4e94d2f90326ab73f2a42e5a4c3b7.tar.gz external_llvm-aa25bb1320b4e94d2f90326ab73f2a42e5a4c3b7.tar.bz2 external_llvm-aa25bb1320b4e94d2f90326ab73f2a42e5a4c3b7.zip |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 6 | ||||
-rw-r--r-- | lib/Target/Target.td | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 135718acc7..e008c9a61b 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -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()) { diff --git a/lib/Target/Target.td b/lib/Target/Target.td index 6e2ba91b95..a268e16410 100644 --- a/lib/Target/Target.td +++ b/lib/Target/Target.td @@ -203,22 +203,25 @@ class Instruction { bit usesCustomDAGSchedInserter = 0; // Pseudo instr needing special help. bit hasCtrlDep = 0; // Does this instruction r/w ctrl-flow chains? bit isNotDuplicable = 0; // Is it unsafe to duplicate this instruction? + bit isAsCheapAsAMove = 0; // As cheap (or cheaper) than a move instruction. // Side effect flags - When set, the flags have these meanings: // // hasSideEffects - The instruction has side effects that are not // captured by any operands of the instruction or other flags. + // // mayHaveSideEffects - Some instances of the instruction can have side // effects. The virtual method "isReallySideEffectFree" is called to // determine this. Load instructions are an example of where this is // useful. In general, loads always have side effects. However, loads from // constant pools don't. Individual back ends make this determination. + // // neverHasSideEffects - Set on an instruction with no pattern if it has no // side effects. bit hasSideEffects = 0; bit mayHaveSideEffects = 0; bit neverHasSideEffects = 0; - + InstrItinClass Itinerary = NoItinerary;// Execution steps used for scheduling. string Constraints = ""; // OperandConstraint, e.g. $src = $dst. |