<div dir="ltr">Looking through some of the remaining test failures under the new pass manager, I've narrowed down one of the failures in GWPAsan(!) to the fact that the new pass manager doesn't properly skip passes like the old pass manager. For example, when a function is marked optnone, or when using <a href="https://llvm.org/docs/OptBisect.html">https://llvm.org/docs/OptBisect.html</a>.<div><br></div><div>Lots of passes (e.g. SROA) will do the following under the legacy pass manager:<br><div><br></div><div><font face="monospace">  bool runOnFunction(Function &F) override {<br>    if (skipFunction(F))<br>      return false;<br></font></div><div><font face="monospace">    // do pass</font></div><div><font face="monospace">  }</font></div></div><div><br></div><div>What's the right way to proceed with this? There are 50-100 calls to skipFunction() in legacy passes. This doesn't even account for other types of IR units, like skipModule(Module&).</div><div><br></div><div>I suppose it's possible to manually go in and add in the same check in the new passes, but that seems tedious (and how do you test that at scale? clearly there aren't many tests for it right now since check-llvm passes under the new pass manager). An alternative of skipping passes at the pass manager level would require marking each pass as necessary/optional (I think...).</div></div>