diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-07-02 22:29:50 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-07-02 22:29:50 +0000 |
commit | a4e1ba53ddedd08669886b2849926bb33facc198 (patch) | |
tree | e18ec10ce3958c838ea1e5e98a9075e12c354081 /include | |
parent | f5cd8c51e3d09a2af32e03414e75d3b50f47d0aa (diff) | |
download | external_llvm-a4e1ba53ddedd08669886b2849926bb33facc198.zip external_llvm-a4e1ba53ddedd08669886b2849926bb33facc198.tar.gz external_llvm-a4e1ba53ddedd08669886b2849926bb33facc198.tar.bz2 |
Add a new target independent COPY instruction and code to lower it.
The COPY instruction is intended to replace the target specific copy
instructions for virtual registers as well as the EXTRACT_SUBREG and
INSERT_SUBREG instructions in MachineFunctions. It won't we used in a selection
DAG.
COPY is lowered to native register copies by LowerSubregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107529 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 5 | ||||
-rw-r--r-- | include/llvm/Target/Target.td | 8 | ||||
-rw-r--r-- | include/llvm/Target/TargetOpcodes.h | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 44d716e..003ed15 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -227,7 +227,10 @@ public: bool isRegSequence() const { return getOpcode() == TargetOpcode::REG_SEQUENCE; } - + bool isCopy() const { + return getOpcode() == TargetOpcode::COPY; + } + /// readsRegister - Return true if the MachineInstr reads the specified /// register. If TargetRegisterInfo is passed, then it also checks if there /// is a read of a super-register. diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index 51a501e..9a89dc9 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -476,7 +476,6 @@ def DBG_VALUE : Instruction { let AsmString = "DBG_VALUE"; let isAsCheapAsAMove = 1; } - def REG_SEQUENCE : Instruction { let OutOperandList = (outs unknown:$dst); let InOperandList = (ins variable_ops); @@ -484,6 +483,13 @@ def REG_SEQUENCE : Instruction { let neverHasSideEffects = 1; let isAsCheapAsAMove = 1; } +def COPY : Instruction { + let OutOperandList = (outs unknown:$dst); + let InOperandList = (ins unknown:$src); + let AsmString = ""; + let neverHasSideEffects = 1; + let isAsCheapAsAMove = 1; +} } //===----------------------------------------------------------------------===// diff --git a/include/llvm/Target/TargetOpcodes.h b/include/llvm/Target/TargetOpcodes.h index 55e93ec..e710c70 100644 --- a/include/llvm/Target/TargetOpcodes.h +++ b/include/llvm/Target/TargetOpcodes.h @@ -75,7 +75,11 @@ namespace TargetOpcode { /// e.g. v1027 = REG_SEQUENCE v1024, 3, v1025, 4, v1026, 5 /// After register coalescing references of v1024 should be replace with /// v1027:3, v1025 with v1027:4, etc. - REG_SEQUENCE = 12 + REG_SEQUENCE = 12, + + /// COPY - Target-independent register copy. This instruction can also be + /// used to copy between subregisters of virtual registers. + COPY = 13 }; } // end namespace TargetOpcode } // end namespace llvm |