Make rules available in RHS
authorsimonpj@microsoft.com <unknown>
Thu, 4 May 2006 11:15:00 +0000 (11:15 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 4 May 2006 11:15:00 +0000 (11:15 +0000)
After some earlier re-factoring, the code that was carefully trying
to make RULES available in a function's own RHS was plain wrong.

This commit fixes it.  Some programs should go faster!

compiler/simplCore/SimplEnv.lhs

index 00f035e..c91ca58 100644 (file)
@@ -562,7 +562,7 @@ when substituting in h's RULE.
 \begin{code}
 addLetIdInfo :: SimplEnv -> InBinder -> OutBinder -> (SimplEnv, OutBinder)
 addLetIdInfo env in_id out_id
 \begin{code}
 addLetIdInfo :: SimplEnv -> InBinder -> OutBinder -> (SimplEnv, OutBinder)
 addLetIdInfo env in_id out_id
-  = (modifyInScope env out_id out_id, final_id)
+  = (modifyInScope env out_id final_id, final_id)
   where
     final_id = out_id `setIdInfo` new_info
     subst = mkCoreSubst env
   where
     final_id = out_id `setIdInfo` new_info
     subst = mkCoreSubst env