Hi, all. I'm using <font class="Apple-style-span" color="#3366ff" style="font-style:italic">void LoopBase::getExitBlocks (SmallVectorImpl< BlockT * > &ExitBlocks) const </font>to get all <div>exit blocks for a loop. The problem I find with this API is that it returns repetitive basic blocks in certain </div>
<div>situations. Should repetitive basic blocks be removed?</div><div><br></div><div>I have an example to show the problem. Following is the source code and the CFG is enclosed.</div><div><div><font class="Apple-style-span" color="#3366ff">int main()</font></div>
<div><font class="Apple-style-span" color="#3366ff">{</font></div><div><font class="Apple-style-span" color="#3366ff">  int i = rand()%10;</font></div><div><font class="Apple-style-span" color="#3366ff"><br></font></div><div>
<font class="Apple-style-span" color="#3366ff">  while ( i < 20 )</font></div><div><font class="Apple-style-span" color="#3366ff">    {</font></div><div><font class="Apple-style-span" color="#3366ff">      i++;</font></div>
<div><font class="Apple-style-span" color="#3366ff">      if ( i == 5)</font></div><div><font class="Apple-style-span" color="#3366ff"><span class="Apple-tab-span" style="white-space:pre">      </span>return 21;</font></div><div>
<font class="Apple-style-span" color="#3366ff">      if ( i == 9)</font></div><div><font class="Apple-style-span" color="#3366ff"><span class="Apple-tab-span" style="white-space:pre"> </span>continue;</font></div><div><font class="Apple-style-span" color="#3366ff">      else if ( i == 10)</font></div>
<div><font class="Apple-style-span" color="#3366ff"><span class="Apple-tab-span" style="white-space:pre">     </span>break;</font></div><div><font class="Apple-style-span" color="#3366ff">    }</font></div><div><font class="Apple-style-span" color="#3366ff">  return i;</font></div>
<div><font class="Apple-style-span" color="#3366ff">}</font></div></div><div><font class="Apple-style-span" color="#3366ff"><br></font></div><div>If you use <span class="Apple-style-span" style="color:rgb(51,102,255);font-style:italic">getExitBlocks() </span>to get the exit basic blocks for the loop, the block "10" will show up <font class="Apple-style-span" color="#ff0000">twice</font> in the </div>
<div>results.</div><div><br></div><div>Xiaoming</div>