<div dir="ltr">yeah.<div><br></div><div>opt -gvn-hoist definitely works.<div><br></div><div>-O1/-O2 already requires various flags/not flags to enable  passes, so this is no different (-enable-load-pre is an example)</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 29, 2016 at 9:19 AM, Hans Wennborg <span dir="ltr"><<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hans added a comment.<br>
<span class=""><br>
In <a href="https://reviews.llvm.org/D22639#500689" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22639#500689</a>, @probinson wrote:<br>
<br>
> This means to enable the pass in opt I need to do both `-enable-gvn-hoist` and `-O1` which is not usual for opt.  (For example I need just `-dce` to get DCE.)  Is that the intent?<br>
<br>
<br>
</span>I thought opt didn't use PassManagerBuilder, but added passes through some other magic. I don't actually know that this is how it works, but I assumed it was something like it, because test/Transforms/GVN/hoist.ll still just runs "opt -gvn-hoist" and it seems to work.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D22639" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22639</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>