X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FCodeGenerator.html;h=a84534644cfeedd9c71ecaed6c23d4e1cec1e076;hb=f6474f69d3c3298499a4767f445f928fb83cd4d3;hp=376b91c8f1a621d8054b3a6cee4fb56ced081184;hpb=98c870f87b7f0c996a9ba67003d88d434d6dbcd0;p=oota-llvm.git diff --git a/docs/CodeGenerator.html b/docs/CodeGenerator.html index 376b91c8f1a..a84534644cf 100644 --- a/docs/CodeGenerator.html +++ b/docs/CodeGenerator.html @@ -1030,9 +1030,9 @@ printer, and the type generated by the assembly parser and disassembler. SelectionDAG optimizer is run to clean up redundancies exposed by type legalization. -
  • Legalize SelectionDAG Types — - This stage transforms SelectionDAG nodes to eliminate any types that are - unsupported on the target.
  • +
  • Legalize SelectionDAG Ops — + This stage transforms SelectionDAG nodes to eliminate any operations + that are unsupported on the target.
  • Optimize SelectionDAG — The SelectionDAG optimizer is run to eliminate inefficiencies introduced by @@ -1559,18 +1559,25 @@ bool RegMapping_Fer::compatible_class(MachineFunction &mf,

    Virtual registers are also denoted by integer numbers. Contrary to physical - registers, different virtual registers never share the same number. The - smallest virtual register is normally assigned the number 1024. This may - change, so, in order to know which is the first virtual register, you should - access TargetRegisterInfo::FirstVirtualRegister. Any register whose - number is greater than or equal - to TargetRegisterInfo::FirstVirtualRegister is considered a virtual - register. Whereas physical registers are statically defined in - a TargetRegisterInfo.td file and cannot be created by the - application developer, that is not the case with virtual registers. In order - to create new virtual registers, use the + registers, different virtual registers never share the same number. Whereas + physical registers are statically defined in a TargetRegisterInfo.td + file and cannot be created by the application developer, that is not the case + with virtual registers. In order to create new virtual registers, use the method MachineRegisterInfo::createVirtualRegister(). This method - will return a virtual register with the highest code.

    + will return a new virtual register. Use an IndexedMap<Foo, + VirtReg2IndexFunctor> to hold information per virtual register. If you + need to enumerate all virtual registers, use the function + TargetRegisterInfo::index2VirtReg() to find the virtual register + numbers:

    + +
    +
    +  for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) {
    +    unsigned VirtReg = TargetRegisterInfo::index2VirtReg(i);
    +    stuff(VirtReg);
    +  }
    +
    +

    Before register allocation, the operands of an instruction are mostly virtual registers, although physical registers may also be used. In order to check if @@ -1998,12 +2005,20 @@ def : InstAlias<"clrq $reg", (XOR64rr GR64:$reg, GR64:$reg)>;

    This example also shows that tied operands are only listed once. In the X86 backend, XOR8rr has two input GR8's and one output GR8 (where an input is tied to the output). InstAliases take a flattened operand list without duplicates -for tied operands. The result of an instruction alias can also use immediates, -which are added as simple immediate operands in the result, for example:

    +for tied operands. The result of an instruction alias can also use immediates +and fixed physical registers which are added as simple immediate operands in the +result, for example:

    +// Fixed Immediate operand.
     def : InstAlias<"aad", (AAD8i8 10)>;
    +
    +// Fixed register operand.
    +def : InstAlias<"fcomi", (COM_FIr ST1)>;
    +
    +// Simple alias.
    +def : InstAlias<"fcomi $reg", (COM_FIr RST:$reg)>;
     
    @@ -2099,7 +2114,7 @@ is the key:

    - + @@ -2114,7 +2129,7 @@ is the key:

    - + @@ -2131,7 +2146,7 @@ is the key:

    - + @@ -2148,9 +2163,9 @@ is the key:

    - + - + @@ -2162,12 +2177,12 @@ is the key:

    jit * - + - + @@ -2182,7 +2197,7 @@ is the key:

    - + @@ -2201,7 +2216,7 @@ is the key:

    - +