summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-07-22 11:41:08 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2021-07-26 17:15:01 +0100
commit51af8af0a729751f946c87badf0a515d40050076 (patch)
treef10a17ee0fa6c0cb24348d75cddb754107e39f09 /hadrian
parent5f3991c7cab8ccc9ab8daeebbfce57afbd9acc33 (diff)
downloadhaskell-wip/T20143.tar.gz
Eliminate unnecessary unsafeEqualityProofwip/T20143
This patch addresses #20143, which wants to discard unused calls to unsafeEqualityProof. There are two parts: * In exprOkForSideEffects, we want to know that unsafeEqualityProof indeed terminates, without any exceptions etc * But we can only discard the case if we know that the coercion variable is not used, which means we have to gather accurate occurrence info for CoVars. Previously OccurAnal only did a half hearted job of doing so; this patch finishes the job. See Note [Gather occurrences of coercion variables] in OccurAnal. Because the occurrence analyser does more work, there is a small compile-time cost but it's pretty small. The compiler perf tests are usually 0.0% but occasionally up to 0.3% increase. I'm just going to accept this -- gathering accurate occurrence information really seems like the Right Thing to do. There is an increase in `compile_time/peak_megabytes_allocated`, for T11545, or around 14%; but I can't reproduce it on my machine (it's the same before and after), and the peak-usage stats are vulnerable to when exactly the GC takes place, so I'm just going to accept it. Metric Increase: T11545
Diffstat (limited to 'hadrian')
0 files changed, 0 insertions, 0 deletions