| 390 | #[cfg_attr(feature = "clap", derive(clap::Args))] |
| 391 | #[non_exhaustive] |
| 392 | pub struct Options { |
| 393 | /// Controls how moves are optimized after register allocation. |
| 394 | #[cfg_attr(feature = "clap", clap(long, default_value = "global"))] |
| 395 | pub move_optimization: MoveOptimizationLevel, |
| 396 | |
| 397 | /// Enable elimination of spills whose destination is never read. |
| 398 | #[cfg_attr( |
| 399 | feature = "clap", |
| 400 | clap( |
| 401 | long = "no-dead-spill-elimination", |
| 402 | action = clap::ArgAction::SetFalse, |
| 403 | help = "Disable the dead spill elimination pass" |
| 404 | ) |
| 405 | )] |
| 406 | pub dead_spill_elimination: bool, |
| 407 | |
| 408 | /// Selects the algorithm for live range splitting. |
| 409 | #[cfg_attr(feature = "clap", clap(long, default_value = "linear"))] |
| 410 | pub split_strategy: SplitStrategy, |
| 411 | |
| 412 | /// Selects the adjustment factor used for spill weight calculation. |
| 413 | /// |
| 414 | /// The ideal number is workload-dependent, but the default should be fine |
| 415 | /// for most cases. |
| 416 | #[cfg_attr(feature = "clap", clap(long, default_value = "200"))] |
| 417 | pub spill_weight_adjust: u32, |
| 418 | |
| 419 | /// Scale applied to the spill cost of directly rematerializable target |
| 420 | /// values with [`RematCost::CheaperThanMove`]. |
| 421 | /// |
| 422 | /// [`RematCost::CheaperThanMove`]: crate::function::RematCost::CheaperThanMove |
| 423 | #[cfg_attr(feature = "clap", clap(long, default_value = "0.2"))] |
| 424 | pub direct_remat_cheaper_than_move_cost_scale: f32, |
| 425 | |
| 426 | /// Scale applied to the spill cost of directly rematerializable target |
| 427 | /// values with [`RematCost::CheaperThanLoad`]. |
| 428 | /// |
| 429 | /// [`RematCost::CheaperThanLoad`]: crate::function::RematCost::CheaperThanLoad |
| 430 | #[cfg_attr(feature = "clap", clap(long, default_value = "0.25"))] |
| 431 | pub direct_remat_cheaper_than_load_cost_scale: f32, |
| 432 | |
| 433 | /// Scale applied to the spill cost of indirectly rematerializable target |
| 434 | /// values. |
| 435 | #[cfg_attr(feature = "clap", clap(long, default_value = "0.3"))] |
| 436 | pub indirect_remat_cost_scale: f32, |
| 437 | } |
| 438 | |
| 439 | #[cfg(feature = "arbitrary")] |
| 440 | impl<'a> arbitrary::Arbitrary<'a> for Options { |
nothing calls this directly
no outgoing calls
no test coverage detected