Hi, 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. Question 1: For example, I issued the following command $: opt-trunk -si-lower-control-flow t.c_00.bc -o t.c_01.bc Then I got the following error, -------------------------------------------------------------- Error Start -------------------------------------------------------------- Pass 'SI Lower control flow pseudo instructions' is not initialized. Verify if there is a pass dependency cycle. Required Passes: 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. -------------------------------------------------------------- Error End -------------------------------------------------------------- Question 2: Some passes depend on other dependencies. Is there any convenient way to get the dependency for a specific pass? Thank you and best regards, Chengnian. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160304/e6951bed/attachment.html>
> On Mar 4, 2016, at 12:44 AM, Chengnian Sun via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi, > > 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. > > Question 1: > > For example, I issued the following command > > $: opt-trunk -si-lower-control-flow t.c_00.bc -o t.c_01.bc >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.> Then I got the following error, > > -------------------------------------------------------------- Error Start -------------------------------------------------------------- > Pass 'SI Lower control flow pseudo instructions' is not initialized. > > Verify if there is a pass dependency cycle. > > Required Passes: > > 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. > > > > -------------------------------------------------------------- Error End -------------------------------------------------------------- > Question 2: > > Some passes depend on other dependencies. Is there any convenient way to get the dependency for a specific pass? >Not than I know of (other than reading the source code, which is fortunately very easy: look for getAnalysisUsage()) -- Mehdi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160304/e1a38432/attachment.html>
On 3/4/16 10:40 AM, Mehdi Amini via llvm-dev wrote:> > [snip] >> >> >> -------------------------------------------------------------- Error >> End -------------------------------------------------------------- >> >> Question 2: >> >> Some passes depend on other dependencies. Is there any convenient way >> to get the dependency for a specific pass? >> > Not than I know of (other than reading the source code, which is > fortunately very easy: look for getAnalysisUsage())The -debug-pass=structure option to opt will print out the passes that are run and in what order. From that output, you can generally determine which set of analysis passes are used by which set of optimizations. It can help narrow down which source code you need to examine. Regards, John Criswell> > > -- > Mehdi > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- John Criswell Assistant Professor Department of Computer Science, University of Rochester http://www.cs.rochester.edu/u/criswell -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160304/2cf8ceb4/attachment.html>
Hi All, 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? Thank you. ============================================================ $: opt-trunk -loop-data-prefetch t.c_000.bc -o temp.bc 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. 0 opt-trunk 0x00000000018249b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37 1 opt-trunk 0x0000000001822946 llvm::sys::RunSignalHandlers() + 54 2 opt-trunk 0x0000000001822b64 3 libpthread.so.0 0x00007f6b3f3e1340 4 libc.so.6 0x00007f6b3e5ffcc9 gsignal + 57 5 libc.so.6 0x00007f6b3e6030d8 abort + 328 6 libc.so.6 0x00007f6b3e5f8b86 7 libc.so.6 0x00007f6b3e5f8c32 8 opt-trunk 0x00000000016d9e1c 9 opt-trunk 0x00000000014877e3 llvm::FPPassManager::runOnFunction(llvm::Function&) + 643 10 opt-trunk 0x0000000001487e2b llvm::legacy::PassManagerImpl::run(llvm::Module&) + 619 11 opt-trunk 0x00000000006f9ce9 main + 7353 12 libc.so.6 0x00007f6b3e5eaec5 __libc_start_main + 245 13 opt-trunk 0x0000000000738368 Stack dump: 0. Program arguments: opt-trunk -loop-data-prefetch t.c_000.bc -o temp.bc 1. Running pass 'Function Pass Manager' on module 't.c_000.bc'. 2. Running pass 'Loop Data Prefetch' on function '@main' Aborted (core dumped) $: On Fri, Mar 4, 2016 at 12:44 AM, Chengnian Sun <chengniansun at gmail.com> wrote:> Hi, > > 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. > > Question 1: > > For example, I issued the following command > > $: opt-trunk -si-lower-control-flow t.c_00.bc -o t.c_01.bc > > Then I got the following error, > > -------------------------------------------------------------- Error Start > -------------------------------------------------------------- > > Pass 'SI Lower control flow pseudo instructions' is not initialized. > > Verify if there is a pass dependency cycle. > > Required Passes: > > 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. > > -------------------------------------------------------------- Error End > -------------------------------------------------------------- > > Question 2: > > Some passes depend on other dependencies. Is there any convenient way to > get the dependency for a specific pass? > > Thank you and best regards, > > Chengnian. >-- Best Regards. Chengnian SUN. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160307/b88d623a/attachment.html>
Hi,> On Mar 7, 2016, at 12:40 AM, Chengnian Sun via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi All, > > 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? > > Thank you. > > ============================================================> > $: opt-trunk -loop-data-prefetch t.c_000.bc -o temp.bc > 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.This assertions is telling you that the TTI seems not well initialized. Also, usually the test suite is a good source of example to see how to run passes: $ grep loop-data-prefetch test/ -R test//Transforms/LoopDataPrefetch/PowerPC/basic.ll:; RUN: opt -mcpu=a2 -loop-data-prefetch -S < %s | FileCheck %s Here notice how the cpu is defined on the command line. -- Mehdi> 0 opt-trunk 0x00000000018249b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37 > 1 opt-trunk 0x0000000001822946 llvm::sys::RunSignalHandlers() + 54 > 2 opt-trunk 0x0000000001822b64 > 3 libpthread.so.0 0x00007f6b3f3e1340 > 4 libc.so.6 0x00007f6b3e5ffcc9 gsignal + 57 > 5 libc.so.6 0x00007f6b3e6030d8 abort + 328 > 6 libc.so.6 0x00007f6b3e5f8b86 > 7 libc.so.6 0x00007f6b3e5f8c32 > 8 opt-trunk 0x00000000016d9e1c > 9 opt-trunk 0x00000000014877e3 llvm::FPPassManager::runOnFunction(llvm::Function&) + 643 > 10 opt-trunk 0x0000000001487e2b llvm::legacy::PassManagerImpl::run(llvm::Module&) + 619 > 11 opt-trunk 0x00000000006f9ce9 main + 7353 > 12 libc.so.6 0x00007f6b3e5eaec5 __libc_start_main + 245 > 13 opt-trunk 0x0000000000738368 > Stack dump: > 0. Program arguments: opt-trunk -loop-data-prefetch t.c_000.bc -o temp.bc > 1. Running pass 'Function Pass Manager' on module 't.c_000.bc'. > 2. Running pass 'Loop Data Prefetch' on function '@main' > Aborted (core dumped) > $: > > > On Fri, Mar 4, 2016 at 12:44 AM, Chengnian Sun <chengniansun at gmail.com <mailto:chengniansun at gmail.com>> wrote: > Hi, > > 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. > > Question 1: > > For example, I issued the following command > > $: opt-trunk -si-lower-control-flow t.c_00.bc -o t.c_01.bc > > Then I got the following error, > > -------------------------------------------------------------- Error Start -------------------------------------------------------------- > Pass 'SI Lower control flow pseudo instructions' is not initialized. > > Verify if there is a pass dependency cycle. > > Required Passes: > > 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. > > > > -------------------------------------------------------------- Error End -------------------------------------------------------------- > Question 2: > > Some passes depend on other dependencies. Is there any convenient way to get the dependency for a specific pass? > > Thank you and best regards, > > Chengnian. > > > > > -- > Best Regards. > > Chengnian SUN. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160307/08641d16/attachment.html>