<div dir="ltr">Mehdi. <br><br>Thank you so much for the pointer. <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 7, 2016 at 12:48 AM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div><br></div><div><br><div><span class=""><blockquote type="cite"><div>On Mar 7, 2016, at 12:40 AM, Chengnian Sun via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><div>Hi All,<span> </span><br><br></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> </span><br><br></div>Thank you.<br><br>=============================================================<br><div><br>$: opt-trunk -loop-data-prefetch t.c_000.bc -o temp.bc<br>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></div></div></div></blockquote><div><br></div></span><div>This assertions is telling you that the TTI seems not well initialized.</div><div><br></div><div><div>Also, usually the test suite is a good source of example to see how to run passes:</div><div><br></div><div>$ grep loop-data-prefetch test/ -R<br>test//Transforms/LoopDataPrefetch/PowerPC/basic.ll:; RUN: opt -mcpu=a2 -loop-data-prefetch -S < %s | FileCheck %s</div><div><br></div><div>Here notice how the cpu is defined on the command line.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Mehdi</div><div><br></div></font></span></div><div><br></div><div><br></div><br><blockquote type="cite"><div><div><div class="h5"><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>0 opt-trunk 0x00000000018249b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37<br>1 opt-trunk 0x0000000001822946 llvm::sys::RunSignalHandlers() + 54<br>2 opt-trunk 0x0000000001822b64<br>3 libpthread.so.0 0x00007f6b3f3e1340<br>4 libc.so.6 0x00007f6b3e5ffcc9 gsignal + 57<br>5 libc.so.6 0x00007f6b3e6030d8 abort + 328<br>6 libc.so.6 0x00007f6b3e5f8b86<br>7 libc.so.6 0x00007f6b3e5f8c32<br>8 opt-trunk 0x00000000016d9e1c<br>9 opt-trunk 0x00000000014877e3 llvm::FPPassManager::runOnFunction(llvm::Function&) + 643<br>10 opt-trunk 0x0000000001487e2b llvm::legacy::PassManagerImpl::run(llvm::Module&) + 619<br>11 opt-trunk 0x00000000006f9ce9 main + 7353<br>12 libc.so.6 0x00007f6b3e5eaec5 __libc_start_main + 245<br>13 opt-trunk 0x0000000000738368<br>Stack dump:<br>0. Program arguments: opt-trunk -loop-data-prefetch t.c_000.bc -o temp.bc<span> </span><br>1. Running pass 'Function Pass Manager' on module 't.c_000.bc'.<br>2. Running pass 'Loop Data Prefetch' on function '@main'<br>Aborted (core dumped)<br>$:<span> </span><br><br></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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br><div class="gmail_quote">On Fri, Mar 4, 2016 at 12:44 AM, Chengnian Sun<span> </span><span dir="ltr"><<a href="mailto:chengniansun@gmail.com" target="_blank">chengniansun@gmail.com</a>></span><span> </span>wrote:<br><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">Hi, <div><br></div><div>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><br></div><div>Question 1:</div><div> </div><div>For example, I issued the following command</div><div><br></div><div> <span> </span>$: opt-trunk -si-lower-control-flow t.c_00.bc -o t.c_01.bc</div><div><br></div><div>Then I got the following error,</div><div><br></div><div>-------------------------------------------------------------- Error Start -------------------------------------------------------------- </div><div><p><span>Pass 'SI Lower control flow pseudo instructions' is not initialized.</span></p><p><span>Verify if there is a pass dependency cycle.</span></p><p><span>Required Passes:</span></p><p><span>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><span></span><br></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"></div><div><br></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">-------------------------------------------------------------- Error End -------------------------------------------------------------- </div><p>Question 2:</p><p>Some passes depend on other dependencies. Is there any convenient way to get the dependency for a specific pass? </p><p><span>Thank you and best regards,</span></p><p><span>Chengnian.<br></span></p></div><div></div></div></blockquote></div><br><br clear="all"><br>--<span> </span><br><div>Best Regards.<br><br>Chengnian SUN.</div></div></div></div><span class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></span></div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Best Regards.<br><br>Chengnian SUN.</div>
</div>