From 3d30b4b8cf3eef1b70d9ceff40230cd405e982fd Mon Sep 17 00:00:00 2001 From: Jamie Willis Date: Mon, 31 Jul 2023 20:32:33 +0100 Subject: [PATCH] made threshold tiny bit more permissive --- .../src/ghc/Parsley/Internal/Backend/Analysis/Inliner.hs | 2 +- .../src/ghc/Parsley/Internal/Frontend/Analysis/Inliner.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parsley-core/src/ghc/Parsley/Internal/Backend/Analysis/Inliner.hs b/parsley-core/src/ghc/Parsley/Internal/Backend/Analysis/Inliner.hs index c740468..e9fe579 100644 --- a/parsley-core/src/ghc/Parsley/Internal/Backend/Analysis/Inliner.hs +++ b/parsley-core/src/ghc/Parsley/Internal/Backend/Analysis/Inliner.hs @@ -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 } diff --git a/parsley-core/src/ghc/Parsley/Internal/Frontend/Analysis/Inliner.hs b/parsley-core/src/ghc/Parsley/Internal/Frontend/Analysis/Inliner.hs index fbb492b..e817f86 100644 --- a/parsley-core/src/ghc/Parsley/Internal/Frontend/Analysis/Inliner.hs +++ b/parsley-core/src/ghc/Parsley/Internal/Frontend/Analysis/Inliner.hs @@ -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 }