- | not do_deforest &&
- maybeToBool maybe_unfolding_info &&
- (not essential_unfoldings_only || idMustBeINLINEd var) &&
- -- If "essential_unfolds_only" is true we do no inlinings at all,
+ -- If there's an InUnfolding it means that there's no
+ -- let-binding left for the thing, so we'd better inline it!
+ | must_unfold
+ = let
+ Just (_, _, InUnfolding rhs_env rhs) = info_from_env
+ in
+ unfold var rhs_env rhs args result_ty
+
+
+ -- Conditional unfolding. There's a binding for the
+ -- thing, but perhaps we want to inline it anyway
+ | ( maybeToBool maybe_unfolding_info
+ && (not essential_unfoldings_only || idMustBeINLINEd var)
+ -- If "essential_unfoldings_only" is true we do no inlinings at all,