You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by Apache Wiki <wi...@apache.org> on 2008/05/08 13:01:38 UTC

[Harmony Wiki] Update of "Jitrino OPT/constraints" by Mikhail Fursov

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Harmony Wiki" for change notification.

The following page has been changed by Mikhail Fursov:
http://wiki.apache.org/harmony/Jitrino_OPT/constraints

New page:
''' 'constraints' ''' performs resolution of operand constraints and assigns calculated constraints (Opnd::ConstraintKind_Calculated) to operands.
[[BR]]The resulting calculated constraints of operands determine allowable physical location for the operand.
[[BR]]
[[BR]]
This transformer allows to insert operands into instructions before it regardless instruction constraints except that Initial constraints of explicit instruction operands must have non-null intersections with corresponding constraints of at least one opcode group of the instruction.
[[BR]]ConstraintResolver analyzes instruction constraints and splits operands when necessary.
[[BR]]This transformer ensures that 
[[BR]][[BR]]  {{{1)}}} All instruction constraints for EntryPoints, CALLs and RETs are set appropriately (IRManager::applyCallingConventions())
[[BR]][[BR]]  {{{2)}}}  All operands has non-null calculated constraints 
[[BR]][[BR]]  {{{3)}}}  All operands fits into instructions they are used in (in terms of instruction constraints)
[[BR]]For example:
[[BR]]Original code piece:
[[BR]]{{{
               I38: (AD:s65:double) =CopyPseudoInst (AU:t1:double) 
               I32: MULSD .s65.:double,.t2:double 
               I33: RET t66(0):int16 (AU:s65:double) 
           
               RET imposes constraint on s65 requiring to place it into FP0 register 
               (its FP0D alias in this particular case)
               MULSD imposes constraint on s65 requiring to place it into XMM register 
}}}                       
After the pass: 
[[BR]]{{{
               I38: (AD:s65:double) =CopyPseudoInst (AU:t1:double) 
               I32: MULSD .s65.:double,.t2:double 
               I46: (AD:t75:double) =CopyPseudoInst (AU:s65:double) 
               I33: RET t66(20):int16 (AU:t75:double) 
}}}           
               Thus, ConstraintResolver inserted I46 splitting s65 to s65 and t75. s65 is assigned with Mem|XMM calculated constraint and t75                is assigned with FP0D calculated calculated constraint
[[BR]][[BR]]  {{{4)}}}  If the live range of an operand crosses a call site and the operand is not redefined in the call site, the calculated constraint of the operand is narrowed the callee-save regs or memory (stack)
[[BR]][[BR]]  {{{5)}}}  If the operand (referred as original operand here) is live at entry of a catch handler then necessary operand splitting is performed as close as possible to the instruction which caused the splitting and original operand is used before and after the instruction. 
[[BR]]The main principle of the algorithm is anding of instruction constraints into operand calculated constraints and splitting operands to ensure that the calculated constraint is not null
[[BR]]This transformer must be inserted before register allocator which relies on calculated operand constraints.