[llvm-commits] BlockFrequency for BasicBlocks

Jakub Staszak jstaszak at apple.com
Sat Jun 18 16:39:26 PDT 2011


> 
> Hi Kuba,
> 
> If you define the constructor and destructor in the .cpp, then do you still need to include InitializePasses.h from BlockFrequency.h. And do you really need a "deinit" method?
Fixed. Also "LoopInfo.h" header wasn't needed.

> 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.
I've been looking for something like that in LLVM, but I couldn't find it. 

> 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.
I removed PO vector, which is not needed anymore, so we have one RPO and one PO traversal now.

> Can you also comment that LoopSimplify can make the algorithm converge faster.
Done

> Can frequency reach zero in divBlockFreq? Don't you want to saturate at 1?
IMO it can. What do you mean by "saturate at 1"?

Thanks!
- Kuba




More information about the llvm-commits mailing list