[PATCH] D98908: Update basic deref API to account for possiblity of free [NFC]

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 09:34:18 PDT 2021


reames added a comment.

In D98908#2637360 <https://reviews.llvm.org/D98908#2637360>, @nlopes wrote:

> Sounds good to me, as long as you commit to removing that cmd switch within a reasonable time frame. Otherwise we accumulate technical debt.

I do.  Just to be clear, your SGTM is meant as an LGTM right?

> This patch just shows how terrible this LLVM thing of traversing things backwards can be. Just because a pointer can be freed, it doesn't mean it was. This patch is quite pessimistic; essentially it assumes all pointers are dead. What's the plan to avoid regressions?

This patch is extraordinarily pessimistic.  :)

First step is to add a predicate for when we know an object can't be freed in the queried scope.  I have an initial version of that implemented, and it does cover a large number of existing cases.  After that, I'm going to be looking closely at existing test cases to see what other inference looks profitable.   (I've already spotted a couple of additional inference rules which look possible that way.)  I want to get each "interesting" inference rule into it's own review for ease of discussion.  (Or at least small batches of related inference rules.)

Once all of that is done, I'll post a final review which flips the flag with all the doc changes, and any remaining test changes.  If we feel that the remaining delta in optimization potential is too large, we can explore one of the other attribute options mentioned in the RFC thread.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98908/new/

https://reviews.llvm.org/D98908



More information about the llvm-commits mailing list