`flagRecompile` is unreliable, because modifying a function doesn't necessarily modify its fingerprint
I ran into the following problem:
- Module
Foo
contains a functionfoo
. InFoo.hi
,foo
has no unfolding (because of the lack ofINLINABLE
, orNOINLINE
, orfoo
is too large) - One modifies
Foo.foo
. Nowfoo
is a different function, but its fingerprint inFoo.hi
remains the same (this is not always the case, but it is sometimes). - There's a GHC plugin which depends on
Foo.foo
, and whosepluginRecompile
isflagRecompile
. - The plugin does not re-run after modifying
foo
because its fingerprint remains the same, even though its behavior has now changed.
So it seems 2 is the culprit. Is it possible to compute the fingerprint of a function from its definition, which ensures a different definition always has a different fingerprint?