Replying to simonpj:
Maybe the code compiled by Template Haskell can be un-profiled? That might be an easy fix.
The problem is that when the compiler is profiled, the byte-code compiler and interpreter have to coexist with profiled object code, which means
- different heap object layouts
- different stack frame layouts
- we need to push/pop/set cost centres as necessary
- do other profiling-related things (update the LDVW for biographical profilng when creating and entering an object, for example)
there's no fundamental problem with any of this, but it would probably take a few days to straighten it all out.