[PATCH] D53362: [Prototype] Heap-To-Stack Conversion Pass

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 12:03:28 PDT 2018


hfinkel added a comment.

In https://reviews.llvm.org/D53362#1267929, @xbolva00 wrote:

> In https://reviews.llvm.org/D53362#1267885, @hfinkel wrote:
>
> > Add the pointer-capturing check when potential exits are found.
>
>
> Not sure if enough, since @efriedma noted in https://reviews.llvm.org/D47345:
>
> "Your "capture" function captures the pointer, but it's possible to write a function which takes the pointer as a parameter but doesn't capture it. For example, given the function void f(void *p) { free(p); }, LLVM will mark the parameter "p" nocapture."


free doesn't capture, but that's okay. I'm not depending on the capture check for that because, for free, the path reachability check takes care of that. For everything else, that's exactly correct, and in fact, I want to be able to handle cases where functions take the pointers and don't capture them (the tricky part there is actually that, if the pointer is captured, we also need to prove eventual termination).

I need to update the description to describe the algorithm and why I think that it works. ;) -- I'll do that soon.


https://reviews.llvm.org/D53362





More information about the llvm-commits mailing list