<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 4, 2016, at 12:44 AM, Chengnian Sun via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi, <div class=""><br class=""></div><div class="">I am new to llvm, and recently am playing with opt. I want to use opt to apply one optimization pass to a .bc file. However, I encounter some problems which I failed to find the answers on the internet. Any suggestions are highly appreciated. </div><div class=""><br class=""></div><div class="">Question 1:</div><div class=""> </div><div class="">For example, I issued the following command</div><div class=""><br class=""></div><div class="">    $: opt-trunk -si-lower-control-flow t.c_00.bc -o t.c_01.bc</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>This pass is a *machine function* pass, it does not operates on the LLVM IR but on on MIs (machine instructions), i.e. after instruction selection. You cannot run it with opt and there is no easy way to run it in isolation.</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">Then I got the following error,</div><div class=""><br class=""></div><div class="">-------------------------------------------------------------- Error Start -------------------------------------------------------------- </div><div class=""><p class=""><span class="">Pass 'SI Lower control flow pseudo instructions' is not initialized.</span></p><p class=""><span class="">Verify if there is a pass dependency cycle.</span></p><p class=""><span class="">Required Passes:</span></p><p class=""><span class="">opt-trunk: /tmp/llvm-builder/llvm-source-trunk/lib/IR/LegacyPassManager.cpp:668: void llvm::PMTopLevelManager::schedulePass(llvm::Pass*): Assertion `PI && "Expected required passes to be initialized"' failed.</span></p><div class=""><span class=""></span><br class="webkit-block-placeholder"></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""></div><div class=""><br class="webkit-block-placeholder"></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">-------------------------------------------------------------- Error End -------------------------------------------------------------- </div><p class="">Question 2:</p><p class="">Some passes depend on other dependencies. Is there any convenient way to get the dependency for a specific pass? </p></div></div></div></blockquote><div>Not than I know of (other than reading the source code, which is fortunately very easy: look for getAnalysisUsage())</div><div><br class=""></div></div><br class=""><div class="">-- </div><div class="">Mehdi</div><div class=""><br class=""></div></body></html>