<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 23, 2012, at 10:31 PM, Andrew Trick <<a href="mailto:atrick@apple.com">atrick@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 19, 2012, at 10:43 PM, xiaoming gu <<a href="mailto:xiaoming.gu@gmail.com">xiaoming.gu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi, all. I'm using <font class="Apple-style-span" 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></blockquote><br></div><div>Users generally expect a unique set of exit blocks, but don't make any strong assumption. The worst that can happen is missed optimization or redundant analysis. In most cases, the loop is in LoopSimplifyForm, so it's probably not a problem in practice.</div></div></blockquote><br></div><div>Another thing I should mention. The iteration order of ExitBlocks is important. In llvm, generating unique sets is a pain because values are not numbered and iteration order needs to be reproducible. We would need to keep a SmallPtrSet for membership checking while populating the result vector.</div><br><div>-Andy</div></body></html>