<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="">Hi,<div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 7, 2016, at 12:40 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" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><div class="">Hi All,<span class="Apple-converted-space"> </span><br class=""><br class=""></div>I run into another problem with "opt-trunk -loop-data-prefetch". The pass is in Transforms/Scalar/LoopDataPrefetch.cpp. How to avoid the following assertion failure, or I should just avoiding using this pass in isolation?<span class="Apple-converted-space"> </span><br class=""><br class=""></div>Thank you.<br class=""><br class="">=============================================================<br class=""><div class=""><br class="">$: opt-trunk -loop-data-prefetch t.c_000.bc -o temp.bc<br class="">opt-trunk: /tmp/llvm-builder/llvm-source-trunk/lib/Transforms/Scalar/LoopDataPrefetch.cpp:102: virtual bool {anonymous}::LoopDataPrefetch::runOnFunction(llvm::Function&): Assertion `TTI->getCacheLineSize() && "Cache line size is not set for target"' failed.<br class=""></div></div></div></blockquote><div><br class=""></div><div>This assertions is telling you that the TTI seems not well initialized.</div><div><br class=""></div><div><div class="">Also, usually the test suite is a good source of example to see how to run passes:</div><div class=""><br class=""></div><div class="">$ grep loop-data-prefetch  test/ -R<br class="">test//Transforms/LoopDataPrefetch/PowerPC/basic.ll:; RUN: opt -mcpu=a2 -loop-data-prefetch -S < %s | FileCheck %s</div><div class=""><br class=""></div><div class="">Here notice how the cpu is defined on the command line.</div><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div><div class=""><br class=""></div></div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="">0  opt-trunk       0x00000000018249b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37<br class="">1  opt-trunk       0x0000000001822946 llvm::sys::RunSignalHandlers() + 54<br class="">2  opt-trunk       0x0000000001822b64<br class="">3  libpthread.so.0 0x00007f6b3f3e1340<br class="">4  libc.so.6       0x00007f6b3e5ffcc9 gsignal + 57<br class="">5  libc.so.6       0x00007f6b3e6030d8 abort + 328<br class="">6  libc.so.6       0x00007f6b3e5f8b86<br class="">7  libc.so.6       0x00007f6b3e5f8c32<br class="">8  opt-trunk       0x00000000016d9e1c<br class="">9  opt-trunk       0x00000000014877e3 llvm::FPPassManager::runOnFunction(llvm::Function&) + 643<br class="">10 opt-trunk       0x0000000001487e2b llvm::legacy::PassManagerImpl::run(llvm::Module&) + 619<br class="">11 opt-trunk       0x00000000006f9ce9 main + 7353<br class="">12 libc.so.6       0x00007f6b3e5eaec5 __libc_start_main + 245<br class="">13 opt-trunk       0x0000000000738368<br class="">Stack dump:<br class="">0.      Program arguments: opt-trunk -loop-data-prefetch t.c_000.bc -o temp.bc<span class="Apple-converted-space"> </span><br class="">1.      Running pass 'Function Pass Manager' on module 't.c_000.bc'.<br class="">2.      Running pass 'Loop Data Prefetch' on function '@main'<br class="">Aborted (core dumped)<br class="">$:<span class="Apple-converted-space"> </span><br class=""><br class=""></div></div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class="gmail_quote">On Fri, Mar 4, 2016 at 12:44 AM, Chengnian Sun<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:chengniansun@gmail.com" target="_blank" class="">chengniansun@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><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="">   <span class="Apple-converted-space"> </span>$: opt-trunk -si-lower-control-flow t.c_00.bc -o t.c_01.bc</div><div class=""><br class=""></div><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><p class=""><span class="">Thank you and best regards,</span></p><p class=""><span class="">Chengnian.<br class=""></span></p></div><div class=""></div></div></blockquote></div><br class=""><br clear="all" class=""><br class="">--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature">Best Regards.<br class=""><br class="">Chengnian SUN.</div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">LLVM Developers mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:llvm-dev@lists.llvm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">llvm-dev@lists.llvm.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></div></blockquote></div><br class=""></div></body></html>