LLVM API Documentation

TargetOpcodes.h
Go to the documentation of this file.
00001 //===-- llvm/Target/TargetOpcodes.h - Target Indep Opcodes ------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines the target independent instruction opcodes.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_TARGET_TARGETOPCODES_H
00015 #define LLVM_TARGET_TARGETOPCODES_H
00016 
00017 namespace llvm {
00018 
00019 /// Invariant opcodes: All instruction sets have these as their low opcodes.
00020 ///
00021 /// Every instruction defined here must also appear in Target.td and the order
00022 /// must be the same as in CodeGenTarget.cpp.
00023 ///
00024 namespace TargetOpcode {
00025 enum {
00026   PHI = 0,
00027   INLINEASM = 1,
00028   CFI_INSTRUCTION = 2,
00029   EH_LABEL = 3,
00030   GC_LABEL = 4,
00031 
00032   /// KILL - This instruction is a noop that is used only to adjust the
00033   /// liveness of registers. This can be useful when dealing with
00034   /// sub-registers.
00035   KILL = 5,
00036 
00037   /// EXTRACT_SUBREG - This instruction takes two operands: a register
00038   /// that has subregisters, and a subregister index. It returns the
00039   /// extracted subregister value. This is commonly used to implement
00040   /// truncation operations on target architectures which support it.
00041   EXTRACT_SUBREG = 6,
00042 
00043   /// INSERT_SUBREG - This instruction takes three operands: a register that
00044   /// has subregisters, a register providing an insert value, and a
00045   /// subregister index. It returns the value of the first register with the
00046   /// value of the second register inserted. The first register is often
00047   /// defined by an IMPLICIT_DEF, because it is commonly used to implement
00048   /// anyext operations on target architectures which support it.
00049   INSERT_SUBREG = 7,
00050 
00051   /// IMPLICIT_DEF - This is the MachineInstr-level equivalent of undef.
00052   IMPLICIT_DEF = 8,
00053 
00054   /// SUBREG_TO_REG - This instruction is similar to INSERT_SUBREG except that
00055   /// the first operand is an immediate integer constant. This constant is
00056   /// often zero, because it is commonly used to assert that the instruction
00057   /// defining the register implicitly clears the high bits.
00058   SUBREG_TO_REG = 9,
00059 
00060   /// COPY_TO_REGCLASS - This instruction is a placeholder for a plain
00061   /// register-to-register copy into a specific register class. This is only
00062   /// used between instruction selection and MachineInstr creation, before
00063   /// virtual registers have been created for all the instructions, and it's
00064   /// only needed in cases where the register classes implied by the
00065   /// instructions are insufficient. It is emitted as a COPY MachineInstr.
00066   COPY_TO_REGCLASS = 10,
00067 
00068   /// DBG_VALUE - a mapping of the llvm.dbg.value intrinsic
00069   DBG_VALUE = 11,
00070 
00071   /// REG_SEQUENCE - This variadic instruction is used to form a register that
00072   /// represents a consecutive sequence of sub-registers. It's used as a
00073   /// register coalescing / allocation aid and must be eliminated before code
00074   /// emission.
00075   // In SDNode form, the first operand encodes the register class created by
00076   // the REG_SEQUENCE, while each subsequent pair names a vreg + subreg index
00077   // pair.  Once it has been lowered to a MachineInstr, the regclass operand
00078   // is no longer present.
00079   /// e.g. v1027 = REG_SEQUENCE v1024, 3, v1025, 4, v1026, 5
00080   /// After register coalescing references of v1024 should be replace with
00081   /// v1027:3, v1025 with v1027:4, etc.
00082   REG_SEQUENCE = 12,
00083 
00084   /// COPY - Target-independent register copy. This instruction can also be
00085   /// used to copy between subregisters of virtual registers.
00086   COPY = 13,
00087 
00088   /// BUNDLE - This instruction represents an instruction bundle. Instructions
00089   /// which immediately follow a BUNDLE instruction which are marked with
00090   /// 'InsideBundle' flag are inside the bundle.
00091   BUNDLE = 14,
00092 
00093   /// Lifetime markers.
00094   LIFETIME_START = 15,
00095   LIFETIME_END = 16,
00096 
00097   /// A Stackmap instruction captures the location of live variables at its
00098   /// position in the instruction stream. It is followed by a shadow of bytes
00099   /// that must lie within the function and not contain another stackmap.
00100   STACKMAP = 17,
00101 
00102   /// Patchable call instruction - this instruction represents a call to a
00103   /// constant address, followed by a series of NOPs. It is intended to
00104   /// support optimizations for dynamic languages (such as javascript) that
00105   /// rewrite calls to runtimes with more efficient code sequences.
00106   /// This also implies a stack map.
00107   PATCHPOINT = 18,
00108 
00109   /// This pseudo-instruction loads the stack guard value. Targets which need
00110   /// to prevent the stack guard value or address from being spilled to the
00111   /// stack should override TargetLowering::emitLoadStackGuardNode and
00112   /// additionally expand this pseudo after register allocation.
00113   LOAD_STACK_GUARD = 19
00114 };
00115 } // end namespace TargetOpcode
00116 } // end namespace llvm
00117 
00118 #endif