<div dir="ltr">Yeah there's currently no equivalent of doInitialization() in the new pass manager. Creating a per-module RNG to work on functions seems a bit weird to me. Module::createRNG() attempts to be consistent based on the module nameĀ + a per-call site salt, but that makes so changes in one function affect functions visited after. It would make more sense to me to use a per-function RNG salted with the module name and function name. Or if you really want a per-module RNG you could just lazily initialize it in the run(Function &). (Also Module::createRNG() isn't used in tree AFAICT)</div><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 8, 2021 at 7:59 PM Zhang via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.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"><div><font>Hi:</font></div><div>In my legacy pass, I usually use doInitialization() to call Module::createRNG() to create a RandomNumberGenerator, which my FunctionPass later uses.</div><div>How does this model fit into the new PassManager interface? Creating my new pass as run(Function&F ....) and re-create my RNG each time doesn't preserve its internal state, but using run(Module& M) seems a bit overkill to me?</div><div><u></u><u></u></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>