<div dir="ltr">Dear all:<div><br></div><div>     I am currently writing an analysis pass. I would like to split myPass into three analysis passes A, B, C which makes the original code more structured. Pass A depends on the results of Pass B and C. </div><div><br></div><div>     But the problem is that when A requires B and C at the same time, the (unable to schedule pass) error happens. But when A only requires one pass B or C, the code works correctly. But both B and C are analysis pass, why can't they be scheduled when they are required at the same time? The requiring code looks like this.</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span style="font-variant-ligatures:no-common-ligatures"> getAnalysisUsage(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">AnalysisUsage</span><span style="font-variant-ligatures:no-common-ligatures"> &AU) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">const</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">override</span><span style="font-variant-ligatures:no-common-ligatures"> {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            AU.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">setPreservesAll</span><span style="font-variant-ligatures:no-common-ligatures">();</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">            AU.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">addRequired</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><</span><span style="font-variant-ligatures:no-common-ligatures">idxAnalysis</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">::</span><span style="font-variant-ligatures:no-common-ligatures">IndexAnalysis</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">>();</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">            AU.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">addRequired</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><</span><span style="font-variant-ligatures:no-common-ligatures">argAnalysis</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">::</span><span style="font-variant-ligatures:no-common-ligatures">ArgumentAnalysis</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">>();</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">}</span></p></div><div><br></div><div>Thanks!</div><div><br></div><div>Dong</div><div><br></div><div>Error massage:</div><div><br></div><div><p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">/Users/dongchen/tools/llvm_xcode/Debug/bin/opt -load /Users/dongchen/tools/llvm_xcode/Debug/lib/LLVMSymFP.dylib -symFP <./src_bc/stencil.bc> ./src_bc/stencil.bc.opt</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">Unable to schedule 'B' required by 'A'</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">Unable to schedule pass</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">UNREACHABLE executed at /Users/dongchen/tools/llvm-4.0.0.src/lib/IR/LegacyPassManager.cpp:1243!</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">0  opt                      0x000000010a336bbc llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">1  opt                      0x000000010a337139 PrintStackTraceSignalHandler(void*) + 25</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">2  opt                      0x000000010a333269 llvm::sys::RunSignalHandlers() + 425</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">3  opt                      0x000000010a337802 SignalHandler(int) + 354</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">4  libsystem_platform.dylib 0x00007fffb90bab3a _sigtramp + 26</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">5  libsystem_platform.dylib 0x00007fff58221020 _sigtramp + 2669044992</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">6  libsystem_c.dylib        0x00007fffb8f3f420 abort + 129</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">7  opt                      0x000000010a2e9f70 LLVMInstallFatalErrorHandler + 0</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">8  opt                      0x00000001099e8904 llvm::PMDataManager::addLowerLevelRequiredPass(llvm::Pass*, llvm::Pass*) + 244</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">9  opt                      0x00000001099e73d5 llvm::PMDataManager::add(llvm::Pass*, bool) + 1237</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">10 opt                      0x00000001099ec493 llvm::FunctionPass::assignPassManager(llvm::PMStack&, llvm::PassManagerType) + 627</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">11 opt                      0x00000001099e3a81 llvm::PMTopLevelManager::schedulePass(llvm::Pass*) + 2049</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">12 opt                      0x00000001099ebacf llvm::legacy::PassManagerImpl::add(llvm::Pass*) + 47</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">13 opt                      0x00000001099eba91 llvm::legacy::PassManager::add(llvm::Pass*) + 33</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">14 opt                      0x0000000107a0ee6f addPass(llvm::legacy::PassManagerBase&, llvm::Pass*) + 47</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">15 opt                      0x0000000107a09f9e main + 20094</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">16 libdyld.dylib            0x00007fffb8eab235 start + 1</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">17 libdyld.dylib            0x0000000000000004 start + 1192578512</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">Stack dump:</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">0.<span class="gmail-Apple-tab-span" style="white-space:pre">      </span>Program arguments: /Users/dongchen/tools/llvm_xcode/Debug/bin/opt -load /Users/dongchen/tools/llvm_xcode/Debug/lib/LLVMSymFP.dylib -symFP </span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">/bin/sh: line 1:  1198 Abort trap: 6           /Users/dongchen/tools/llvm_xcode/Debug/bin/opt -load /Users/dongchen/tools/llvm_xcode/Debug/lib/LLVMSymFP.dylib -symFP < ./src_bc/stencil.bc > ./src_bc/stencil.bc.opt</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(43,102,201)"><span style="font-variant-ligatures:no-common-ligatures">make: *** [check] Error 134</span></p></div></div>