Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC Commits: 4fc506cb by Simon Peyton Jones at 2025-08-01T17:38:47+01:00 Fix specialiser ..needs documentation - - - - - 1 changed file: - compiler/GHC/Core/Opt/Specialise.hs Changes: ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1674,7 +1674,10 @@ specCalls spec_imp env existing_rules calls_for_me fn rhs return () -} - ; let env' = env { se_subst = subst'' } + ; let inner_rhs_bndrs = dropList all_call_args rhs_bndrs + env' = env { se_subst = subst'' } + (env'', inner_rhs_bndrs') = substBndrs env' inner_rhs_bndrs + all_rules = rules_acc ++ existing_rules -- all_rules: we look both in the rules_acc (generated by this invocation -- of specCalls), and in existing_rules (passed in to specCalls) @@ -1684,13 +1687,13 @@ specCalls spec_imp env existing_rules calls_for_me fn rhs then return spec_acc else do { -- Run the specialiser on the specialised RHS - (rhs_body', rhs_uds) <- specExpr env' $ - mkLams (dropList all_call_args rhs_bndrs) rhs_body + (rhs_body', rhs_uds) <- specExpr env'' rhs_body -- Add the { d1' = dx1; d2' = dx2 } usage stuff -- to the rhs_uds; see Note [Specialising Calls] - ; let (spec_uds, dumped_dbs) = dumpUDs spec_bndrs (dx_binds `consDictBinds` rhs_uds) - spec_rhs = mkLams spec_bndrs $ + ; let all_spec_bndrs = spec_bndrs ++ inner_rhs_bndrs' + (spec_uds, dumped_dbs) = dumpUDs all_spec_bndrs (dx_binds `consDictBinds` rhs_uds) + spec_rhs = mkLams all_spec_bndrs $ wrapDictBindsE dumped_dbs rhs_body' spec_fn_ty = exprType spec_rhs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4fc506cb5f4c355b5fe3138bae1cafbc... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4fc506cb5f4c355b5fe3138bae1cafbc... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)