| 104 | } |
| 105 | |
| 106 | struct FunctionBuilder<'a, 'b, R> { |
| 107 | /// Source of randomness. |
| 108 | u: &'a mut Unstructured<'b>, |
| 109 | |
| 110 | /// Register description. |
| 111 | reginfo: &'a R, |
| 112 | |
| 113 | /// Function that is being built. |
| 114 | func: GenericFunction, |
| 115 | |
| 116 | /// Configuration options |
| 117 | config: ArbitraryFunctionConfig, |
| 118 | |
| 119 | /// Dominator tree of the function. |
| 120 | domtree: DominatorTree, |
| 121 | |
| 122 | /// Instructions for each basic block, in reverse order. |
| 123 | /// |
| 124 | /// These are later copied to the `GenericFunction` in proper block order |
| 125 | /// once instructions for all blocks have been generated. |
| 126 | block_insts: SecondaryMap<Block, Vec<InstData>>, |
| 127 | |
| 128 | /// List of register classes per register bank. |
| 129 | class_per_bank: SecondaryMap<RegBank, Vec<RegClass>>, |
| 130 | |
| 131 | /// List of register classes that are suitable for direct rematerialization. |
| 132 | remat_class_per_bank: SecondaryMap<RegBank, Vec<RegClass>>, |
| 133 | |
| 134 | /// List of registers per register bank. |
| 135 | reg_per_bank: SecondaryMap<RegBank, Vec<PhysReg>>, |
| 136 | |
| 137 | /// List of non-allocatable registers. |
| 138 | non_allocatable_regs: Vec<PhysReg>, |
| 139 | |
| 140 | /// Values that have been used but not yet defined, for each block they |
| 141 | /// should be defined in. This does not include incoming blockparams for |
| 142 | /// this block. |
| 143 | /// |
| 144 | /// As values are defined, they are removed from this list. |
| 145 | defs_by_blocks: SecondaryMap<Block, Vec<Value>>, |
| 146 | |
| 147 | /// Scratch space used to collect candidates for using an existing value. |
| 148 | use_candidates: Vec<Value>, |
| 149 | |
| 150 | /// Registers currently allocated with a fixed constraint in the current |
| 151 | /// instruction. |
| 152 | early_fixed: RegUnitSet, |
| 153 | late_fixed: RegUnitSet, |
| 154 | |
| 155 | /// Def operands which are suitable for `OperandConstraint::Reuse`. |
| 156 | reuse_operands: Vec<usize>, |
| 157 | } |
| 158 | |
| 159 | impl<'a, 'b, R: RegInfo> FunctionBuilder<'a, 'b, R> { |
| 160 | /// Initializes the `FunctionBuilder`. |
nothing calls this directly
no outgoing calls
no test coverage detected