<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Dec 27, 2011, at 6:16 AM, Hanfeng Qin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">volatile int a;<br>int b,e ;<br>....<br><br>void *f1 (void *notused)<br>{<br>    int *c;<br>    int d;<br><br>    while (1) {<br>        c = &a;<br>        if (*c != 0 ) d = 1;<br>        if ( d != 1 && e != 0 && e != d ) break;<br>        if ( *c == e) break;<br>    }<br>    b = 1;<br>}<br><br>In the BB flow chart, B15 and B20 is the exiting block recognized by LLVM. But One of the loop exit conditions is a combination of the compounded branches located in B15, B12 and B9.<span class="Apple-converted-space"> </span><br><br>Can any suggestion be shared with me to solve this problem?</span></blockquote></div><br><div>I didn't see a response to this, but clearly you're asking for control dependence information within the loop. You'll have to look for CFG predecessors of the exiting block that are not deeper in the postdominator tree. For a fully qualified loop exiting condition, you have to do this iteratively as you walk down the postdominator tree. Eventually you'll hit a leaf in the tree or the loop header. I'm sure you can find a paper on control dependence.</div><div><br></div><div>-Andy</div></body></html>