Function rustc_metadata::rmeta::encoder::should_encode_mir
source · fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool)
Expand description
Whether we should encode MIR.
Computing, optimizing and encoding the MIR is a relatively expensive operation. We want to avoid this work when not required. Therefore:
- we only compute
mir_for_ctfe
on items with const-eval semantics; - we skip
optimized_mir
for check runs.
Return a pair, resp. for CTFE and for LLVM.