<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The new version attached. OK to commit now?<div><br><div><div>On Jun 17, 2011, at 4:10 PM, Andrew Trick wrote:</div><br><blockquote type="cite"><div>Hi Kuba,<br><br>If you define the constructor and destructor in the .cpp, then do you still need to include InitializePasses.h from BlockFrequency.h. </div></blockquote><div>Done, i also removed "LoopInfo.h"</div><br><blockquote type="cite"><div>And do you really need a "deinit" method?<br></div></blockquote><div>Yes, if I try to delete BFI in destructor I get a warning ("<span class="Apple-style-span" style="font-size: 12px; ">note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.").</span></div><br><blockquote type="cite"><div>The block frequency pass should only require a *single* CFG graph traversal. I'm not sure how to do that with LLVM's current rpot/pot iterators. Ideally, LLVM would have a DFSOrder analysis to order the blocks. That ordering will remain valid until some CFG transform.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote>I removed PO vector, so we have one RPO and one PO traversal now.<br><br><blockquote type="cite"><div>For, now I think you can at least limit it to two traversals (one reverse postorder and one postorder) and add a FIXME so we remember to fold it into one traversal later. Subsequently whenever you need to visit blocks in RPO/PO order, just use the RPO/PO vectors directly.<br><br>Can you also comment that LoopSimplify can make the algorithm converge faster.<br></div></blockquote>Done.</div><div><br><blockquote type="cite"><div>Can frequency reach zero in divBlockFreq? Don't you want to saturate at 1?<br></div></blockquote><div>I think it can, so i jest set it to 1/START_FREQ.</div></div></div></body></html>