qsharp-compiler icon indicating copy to clipboard operation
qsharp-compiler copied to clipboard

Clean up and caching for callables during QIR generation

Open bettinaheim opened this issue 2 years ago • 3 comments

I started some clean up a while back as a prep for potentially using stack allocations more extensively. I didn't really have time to get as far as I wanted, but let me put what I have up.

bettinaheim avatar Jul 28 '22 06:07 bettinaheim

/azp run

swernli avatar Aug 29 '22 17:08 swernli

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Aug 29 '22 17:08 azure-pipelines[bot]

Some feedback and questions above, but nothing that I think should be blocking. The callable memory leak is a little worrisome, but does not appear to be a new problem due to these changes.

@swernli Nothing should get leaked (actually I think the clean up should also clean up the memory management for targeted QIR, even though that is largely irrelevant since it is going to get stripped by subsequent compilation in any case). I responded to the concrete case of callable %8 in your comment above, which is stored in a tuple and should be released as part of that (i.e. the memory management can be hard to read due to the caching optimizations which can cause the deallocations to happen via unexpected handles).

bettinaheim avatar Sep 14 '22 21:09 bettinaheim