MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / new_value

Method new_value

src/debug_utils/generic_function/arbitrary.rs:317–335  ·  view source on GitHub ↗

Defines a new value with randomized properties.

(&mut self, bank: RegBank)

Source from the content-addressed store, hash-verified

315
316 /// Defines a new value with randomized properties.
317 fn new_value(&mut self, bank: RegBank) -> Result<Value> {
318 let remat = if !self.remat_class_per_bank[bank].is_empty() && self.u.arbitrary()? {
319 let cost = if self.u.arbitrary()? {
320 RematCost::CheaperThanMove
321 } else {
322 RematCost::CheaperThanLoad
323 };
324 let class = *self.u.choose(&self.remat_class_per_bank[bank])?;
325 Some((cost, class))
326 } else {
327 None
328 };
329 let value = self.func.values.push(ValueData {
330 bank,
331 remat,
332 indirect_remat: None,
333 });
334 Ok(value)
335 }
336
337 /// Adds incoming block parameters to blocks that allow them.
338 fn add_blockparams(&mut self) -> Result<()> {

Callers 5

arbitrary_with_configMethod · 0.80
add_blockparamsMethod · 0.80
get_value_for_useMethod · 0.80
gen_defMethod · 0.80
gen_instMethod · 0.80

Calls 3

pushMethod · 0.80
is_emptyMethod · 0.45
arbitraryMethod · 0.45

Tested by

no test coverage detected