<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Isn't this effectively the halting problem? Consider the case where block Y is the exit block of main() and block X is the entry block of main().<div><br></div><div>Jim<br><div><br></div><div><br><div>On Oct 2, 2012, at 4:29 PM, Stephen Schiffli <<a href="mailto:sschiffli@gmail.com">sschiffli@gmail.com</a>> wrote:<div><br class="Apple-interchange-newline"><blockquote type="cite"><p class="MsoNormal">Is there any inter-procedural analysis that could tell me if
some BasicBlock Y is guaranteed to execute based on my knowledge that
BasicBlock X will execute?  For example:</p><p class="MsoNormal"><br></p><p class="MsoNormal">extern int x;</p><p class="MsoNormal">void foo() { }</p><p class="MsoNormal">int main() {</p><p class="MsoNormal">            if (x) {</p><p class="MsoNormal">                        foo();</p><p class="MsoNormal">            } else {</p><p class="MsoNormal">                        foo();</p><p class="MsoNormal" style="text-indent:.5in">}</p><p class="MsoNormal">}</p><div> <br class="webkit-block-placeholder"></div><p class="MsoNormal">I want to be told that the entry block of foo is guaranteed
to be executed since I know the entry block of main is guaranteed to be
executed.  Basically that all paths from X to program termination go through Y at some point.  Please ignore the folding of identical branches and function in-lining, I want to use this type of analysis in the general case.</p><p class="MsoNormal"><br></p><p class="MsoNormal">Thanks,</p><p class="MsoNormal">-Stephen</p>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></div></div></body></html>