<div dir="ltr">Frontends _are_ using PassBuilder, but they need to hook into the default pipeline creation to insert the sanitizer passes.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 25, 2018 at 12:15 PM Fedor Sergeev <<a href="mailto:fedor.sergeev@azul.com">fedor.sergeev@azul.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hmm... frontends should be using PassBuilder anyway.<br>
    And if they are using PassBuilder then they are using
    PassRegistry.def as well - all the<br>
    PassBuilder::register*/parse*/is* methods do include
    PassRegistry.def in their bodies.<br>
    <br>
    I was under impression that callbacks are primarily for plugins
    usage.<br>
    <br>
    regards,<br>
      Fedor.<br>
    <br>
    <div class="m_8681120792048361585moz-cite-prefix">On 09/25/2018 12:43 PM, Philip Pfaffe
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr">Hi Leonard, Fedor,
          <div><br>
          </div>
          <div>while it's true that RegisterPass is not applicable for
            new-pm passes, PassRegistry.def is not the whole story.
            Passes in PassRegistry are available for the opt tool. The
            sanitizers are passes that usually get added to the pipeline
            by the frontend. There, you need to use PassBuilder's
            callbacks mechanism to hook the sanitizer into the
            optimizer.</div>
          <div><br>
          </div>
          <div>Assuming you're willing to contribute your changes,
            please share your progress! Thank you for making a move on
            this!</div>
          <div><br>
          </div>
          <div>Cheers,</div>
          <div>Philip</div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Tue, Sep 25, 2018 at 8:27 AM Fedor Sergeev 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Leonard,<br>
          <br>
          nope, the PassRegistry stuff is all about legacy pass manager.<br>
          legacy namespace has not been extensively used to mark all the
          <br>
          legacy-related stuff<br>
          (say, even Pass class which is a base for legacy passes is not
          under <br>
          legacy namespace).<br>
          <br>
          Registration for new-pass-manager passes happens in <br>
          lib/Passes/PassRegistry.def.<br>
          <br>
          Usually, when porting from legacy to new the main difference
          is analysis <br>
          handling,<br>
          so people factor out the worker code into a method that takes
          analyses <br>
          and call<br>
          this function both in legacy and new-pm passes.<br>
          In many cases it takes just a handful lines of code.<br>
          <br>
          Feel free to ask questions, if any.<br>
          <br>
          regards,<br>
             Fedor.<br>
          <br>
          On 09/25/2018 02:54 AM, Leonard Chan via llvm-dev wrote:<br>
           > Hi all,<br>
           ><br>
           > I'm attempting to move the AddressSanitizer pass from
          the legacy<br>
           > PassManager to the new one because the new one has
          various benefits<br>
           > over legacy and wanted to clarify on something. Does
          creating the<br>
           > static RegisterPass struct register the pass with the
          new PassManager?<br>
           ><br>
           > It seems that RegisterPass does the same things that the<br>
           > INITIALIZE_PASS_* macros do but it registers the pass
          with<br>
           > PassRegistry::getPassRegistry(). What I'm not sure of is
          if this uses<br>
           > the new PassManager infrastructure. Exploring the code
          doesn't seem to<br>
           > show that this PassRegistry touches anything in the
          legacy namespace,<br>
           > but I wanted double confirmation on this.<br>
           ><br>
           > Thanks,<br>
           > Leonard<br>
           > _______________________________________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
          <br>
          _______________________________________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div>