Add a special case in simplAlt to record that the result of
seq# is in WHNF.
Details
- Reviewers
simonmar bgamari simonpj - Commits
- rGHCd964b054d530: Let the simplifier know that seq# forces
- Trac Issues
- #15226
Diff Detail
- Repository
- rGHC Glasgow Haskell Compiler
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Fine, modulo some refactoring
compiler/simplCore/Simplify.hs | ||
---|---|---|
2605–2606 | I think this is the Right place to do this, but
|
@simonpj, I didn't really want to use collectArgsTicks because it seems a bit expensive for the job. So for the moment I've written a function to just drop the arguments and ticks I need to make the comparison. Your other refactor request was definitely a major improvement. Thanks.
Much nicer!
compiler/coreSyn/CoreSyn.hs | ||
---|---|---|
2050 | Or, even simpler, getAppHead, which fiinds the non-App head of a chain of apps. We don't really need to have the right number of args in this case. But it's not a big deal | |
compiler/simplCore/Simplify.hs | ||
2679 | Make this into a top-level function and call it from the isUnboxedTupleCon case. |
compiler/coreSyn/CoreSyn.hs | ||
---|---|---|
2050 | Even getAppHead seems slightly more expensive than necessary. If there are more than four arguments, we can immediately conclude that we don't have seq#. | |
compiler/simplCore/Simplify.hs | ||
2679 | I certainly should call it for the unboxed tuple case. If you want it top-level I won't complain too much, but the function name will end up a substantial fraction of the size of the function body. |