2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_JIT_IRLOWER_H_
18 #define incl_HPHP_JIT_IRLOWER_H_
20 #include "hphp/runtime/vm/jit/code-cache.h"
21 #include "hphp/runtime/vm/jit/state-vector.h"
22 #include "hphp/runtime/vm/jit/types.h"
23 #include "hphp/runtime/vm/jit/vasm-emit.h"
24 #include "hphp/runtime/vm/jit/vasm-reg.h"
25 #include "hphp/runtime/vm/jit/vasm-unit.h"
26 #include "hphp/runtime/vm/jit/vasm.h"
28 namespace HPHP
{ namespace jit
{
33 ///////////////////////////////////////////////////////////////////////////////
37 ///////////////////////////////////////////////////////////////////////////////
39 enum class SyncOptions
{
46 * State updated and tracked across vasm generation for individual instructions
50 explicit IRLS(const IRUnit
& unit
)
52 , labels(unit
, Vlabel())
57 * The unit being lowered to vasm.
62 * The vasm output streams.
64 * These may be updated during codegen of an instruction to point to new
71 * Vasm block labels, one for each HHIR block.
73 StateVector
<Block
,Vlabel
> labels
;
76 * Vlocs for each SSATmp used or defined in a reachable block.
78 StateVector
<SSATmp
,Vloc
> locs
;
82 * Estimate the cost of unit.
84 Vcost
computeIRUnitCost(const IRUnit
& unit
);
87 * Lower the given HHIR unit to a Vunit, then optimize, regalloc, and return
88 * the Vunit. Returns nullptr on failure.
90 std::unique_ptr
<Vunit
> lowerUnit(const IRUnit
&, CodeKind
= CodeKind::Trace
,
91 bool regAlloc
= true) noexcept
;
93 ///////////////////////////////////////////////////////////////////////////////