dnovillo added a comment. Once this is in, please update lib/Transforms/IPO/SampleProfile.cpp. It does something similar. Also, should cold functions be marked with the cold hint? Repository: rL LLVM http://reviews.llvm.org/D15245