<div dir="ltr"><div><div><div><div><div><div>Further to my previous email, I now have some answers.  The culprit is the IR verifier.<br><br></div>1. opt -time-passes does not report time spent in the IR verifier.<br><br></div>If I add -disable-verify, opt's run time drops from 71 seconds to 37 seconds.<br><br></div>2. -disable-verify doesn't disable all verification runs.<br><br></div>The IR verifier is run 3 times: once prior to any optimization work, once between running the module passes and running the function passes, and finally at the end of all optimization prior to writing out optimized IR.<br><br></div>-disable-verify knocks out the first and last invocations of the verifier, but leaves the middle invocation in. You can see this by throwing -debug-pass=Executions and running in a debugger. There is a noticeable pause between running the module and function passes. If you backtrace during this pause, you will see that you are in the verifier.<br><br></div>If I account for time spent in the middle invocation of the verifier, the non-verifier run time agrees with the output of -time-passes.<br><br></div>