<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 19, 2016, at 10:33 AM, Krzysztof Wiśniewski via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class="">I've been working on new checker that registers for region change update. Together with Artem Dergachev, we noticed that the function</div><div class=""><i class="">wantsRegionChangeUpdate </i>never seems to be called. The heavy work necessary to fill data structures for <i class="">checkRegionChanges </i>is being done regardless of it in <i class="">ProgramState::invalidateRegionsImpl.</i> The documentation for <i class="">checkRegionChanges</i> says the following:</div><div class="">"Note that this callback will not be invoked unless wantsRegionChangeUpdate returns true"</div><div class=""> and for <i class="">wantsRegionChangeUpdate:</i></div><div class="">"Since it is not necessarily cheap to compute which regions are being changed, this allows the analyzer core to skip the more expensive <i class="">checkRegionChanges</i> when no checkers are tracking any state." <i class=""><br class=""></i></div><div class=""><br class=""></div><div class="">My question is whether someone can confirm that this is indeed an invalid behavior? For me it looks like it used to work differently and at some point someone changed the logic rendering <i class="">wantsRegionChangeUpdate </i>useless.</div></div></div></blockquote><div><br class=""></div><div>Interesting. It looks like Anna removed the call in to wantsRegionChangeUpdate() in r170625 when adding the checkPointerEscape callback. It also looks to me like the code path in <span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(52, 149, 175);" class="">ProgramState</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">::invalidateRegionsImpl</span> that doesn’t call processRegionChanges() may be completely dead.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">If this indeed is a bug, I suggest we might wish to consult <i class="">CheckerManager </i> in <i class="">ProgramState::invalidateRegionsImpl</i> <i class=""> </i>whether there is some one checker registered for an update and only then prepare the input data in order to improve performance.</div></div></div></blockquote><div><br class=""></div><div>I think we would still need to call <span style="color: rgb(52, 149, 175); font-family: Menlo; font-size: 11px;" class="">invalidateRegions()</span> on the store manager to actually invalidate the transitively reachable regions, so any savings would be in not filling in the ‘out’ parameters <span style="font-family: Menlo; font-size: 11px;" class="">TopLevelInvalidated</span> and <span style="font-family: Menlo; font-size: 11px;" class="">Invalidated</span>. I’m not sure skipping this will actually result in any significant performance gains. You could try it and see — but I wonder if the better thing to do here might be to remove the wantsRegionChangeUpdate callback from the checker API.</div><div><br class=""></div><div>Devin</div></div></body></html>