<div dir="ltr"><div>Yes. Resetting them will not cause correctness problems.</div><div><br></div>Note that SampleProfileLoader is a module scope object -- we initialize it in a module pass. LoopInfo, DOM etc are a module level analysis obj. After inline, we need to invalidate and recompute.<div><br><div>This is different for MIRProfileLoader (which is a function level object). The loopInfo and Dom etc are specific to this function. Since we do not do any transformation (except changing the BranchProb). I don't think we need to invalidate them either.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 18, 2021 at 1:36 PM Wenlei He via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">wenlei accepted this revision.<br>
wenlei added inline comments.<br>
<br>
<br>
================<br>
Comment at: llvm/lib/CodeGen/FlowSensitiveSampleProfile.cpp:293<br>
+  Function &Func = F.getFunction();<br>
+  clearFunctionData(false);<br>
+  Samples = Reader->getSamplesFor(Func);<br>
----------------<br>
xur wrote:<br>
> wenlei wrote:<br>
> > xur wrote:<br>
> > > wenlei wrote:<br>
> > > > Why do we keep dominator tree and loop info?<br>
> > > Profile loader does not invalid these infos (this is different in SampleLoader, where inline will change it)<br>
> > This is still all per-function info, so it needs to be cleared before we use the profile loader to process the next function, right? or did i miss anything?<br>
> We initialize these data structures per function in setInitVals(). Each function will have its own value and no need to clear. <br>
Ok, but resetting it isn't going to cause problem either, right? Just trying to understand if there's a correctness issue that requires not resetting these fields. If not, might as well not adding the special case and always reset/clear. Seem unnecessary to skip reset, but not a big deal though.<br>
<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D107878/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D107878/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D107878" rel="noreferrer" target="_blank">https://reviews.llvm.org/D107878</a><br>
<br>
</blockquote></div>