From a0a541a8d342d6189d5e76ba65a8e914251d1d84 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Sat, 9 Aug 2008 16:31:23 +0000 Subject: [PATCH] Fix Trac #2486: restore the specialiser to a working state In improving the specialiser's data reprsentaion, thus Mon Apr 28 16:57:11 GMT Daylight Time 2008 simonpj@microsoft.com * Fix Trac #1969: perfomance bug in the specialiser I got the sense of a pair of filter functions back to front. As a result, almost all specialisation opportunities were being filtered out, and no specialisations were being generated. Fortunately, dolio notice and reported Trac #2486. The fix is simple: put the filters the right way roud. --- compiler/specialise/Specialise.lhs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/specialise/Specialise.lhs b/compiler/specialise/Specialise.lhs index 055c858..41bdfd7 100644 --- a/compiler/specialise/Specialise.lhs +++ b/compiler/specialise/Specialise.lhs @@ -1191,10 +1191,10 @@ filterCalls :: VarSet -> CallDetails -> CallDetails -- Remove any calls that mention the variables filterCalls bs calls = mapFM (\_ cs -> filter_calls cs) $ - filterFM (\k _ -> k `elemVarSet` bs) calls + filterFM (\k _ -> not (k `elemVarSet` bs)) calls where filter_calls :: CallInfo -> CallInfo - filter_calls = filterFM (\_ (_, fvs) -> fvs `intersectsVarSet` bs) + filter_calls = filterFM (\_ (_, fvs) -> not (fvs `intersectsVarSet` bs)) \end{code} -- 1.7.10.4