Skip to content

Commit

Permalink
made threshold tiny bit more permissive
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mie6 committed Jul 31, 2023
1 parent 442c1ec commit 3d30b4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ entry to a machine are actually used in the computation.
-}
shouldInline :: (?flags :: Opt.Flags) => Fix4 (Instr o) xs n r a -> Bool
shouldInline
| Just thresh <- Opt.secondaryInlineThreshold ?flags = (< thresh) . getWeight . cata4 (InlineWeight . alg)
| Just thresh <- Opt.secondaryInlineThreshold ?flags = (<= thresh) . getWeight . cata4 (InlineWeight . alg)
| otherwise = const False

newtype InlineWeight xs (n :: Nat) r a = InlineWeight { getWeight :: Rational }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ inliner occs _ body
inliner _ μ _ = In (Let μ)

shouldInline :: Int -> Rational -> Fix Combinator a -> Bool
shouldInline occs inlineThreshold = (< inlineThreshold) . (* toRational occs) . subtract callCost . getWeight . cata (InlineWeight . alg)
shouldInline occs inlineThreshold = (<= inlineThreshold) . (* toRational occs) . subtract callCost . getWeight . cata (InlineWeight . alg)

newtype InlineWeight a = InlineWeight { getWeight :: Rational }

Expand Down

0 comments on commit 3d30b4b

Please sign in to comment.