Fix Trac #2486: restore the specialiser to a working state
authorsimonpj@microsoft.com <unknown>
Sat, 9 Aug 2008 16:31:23 +0000 (16:31 +0000)
committersimonpj@microsoft.com <unknown>
Sat, 9 Aug 2008 16:31:23 +0000 (16:31 +0000)
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

index 055c858..41bdfd7 100644 (file)
@@ -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}