<div dir="ltr">Can you post the .ll file that doesn't work and the command you ran?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 10, 2021 at 3:21 PM Joshua R Hilke <<a href="mailto:jrhilke@mit.edu">jrhilke@mit.edu</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 style="overflow-wrap: break-word;">Got it. Thank you. I tried using the new pass manager from the new tutorial as well but was having an issue where the ‘helloworld’ pass would only work if I manually removed all the metadata from my hello.ll file to where the only thing in it was the function. Otherwise, it would run silently and not print out any function names. Any solution to that?<div><br><div></div><div><br><blockquote type="cite"><div>On Feb 10, 2021, at 2:11 PM, Arthur Eubanks <<a href="mailto:aeubanks@google.com" target="_blank">aeubanks@google.com</a>> wrote:</div><br><div><div dir="ltr">That's due to the recent transition to the new pass manager. Adding -enable-new-pm=0 to the opt command should work.<div><br></div><div>I'll update the documentation to explicitly say that the legacy pass manager is no longer the default in big red letters.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 10, 2021 at 1:49 PM Joshua R Hilke 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>I’m just trying to run the hello world example from the LLVM Writing a Pass Tutorial (<a href="https://llvm.org/docs/WritingAnLLVMPass.html" target="_blank">https://llvm.org/docs/WritingAnLLVMPass.html</a>), but whenever I run:<div><br></div><div>$BUILD_DIR/bin/clang -c -emit-llvm hello.c<br><div><br></div><div>$BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so -hello < hello.bc > /dev/null</div><div><br></div><div><br></div><div><br></div><div>I get the following error:</div><div><br></div><div>bin/opt: unknown pass name ‘hello’</div><div><br></div><div><br></div><div><br></div><div>Which seems odd because if I run:</div><div><br></div><div>$BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so --help | grep hello</div><div><br></div><div><br></div><div>I get:</div><div><br></div><div>--hello <span style="white-space:pre-wrap">         </span>- Hello World Pass</div><div><br></div><div><br></div><div>To build LLVM I’m running the following commands from my build directory:</div><div><br></div><div>cmake -G Ninja -DLLVM_ENABLE_PROJECTS=‘clang’ ../llvm</div><div><br></div><div>cmake --build . </div><div><br></div><div><br></div><div>Just to clarify, I’m not writing my own pass. Just trying to run the ‘hello’ pass that comes default when building LLVM</div><div><br></div></div></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>
</div></blockquote></div><br></div></div></blockquote></div>