[llvm-commits] PATCH: Add pass printing and a basic sanity test for BlockFrequencyInfo analysis

Chandler Carruth chandlerc at google.com
Wed Oct 19 03:25:45 PDT 2011


On Mon, Oct 17, 2011 at 3:06 PM, Nick Lewycky <nlewycky at google.com> wrote:

> diff --git a/lib/Analysis/BlockFrequencyInfo.cpp
> b/lib/Analysis/BlockFrequencyInfo.cpp
> index ee89915..9e05065 100644
> --- a/lib/Analysis/BlockFrequencyInfo.cpp
> +++ b/lib/Analysis/BlockFrequencyInfo.cpp
> @@ -49,6 +49,10 @@ bool BlockFrequencyInfo::runOnFunction(Function &F) {
>    return false;
>  }
>
> +void BlockFrequencyInfo::print(raw_ostream &O, const Module * /*M*/) const
> {
>
> Just const const Module* will do.
>
> +  if (BFI) BFI->print(O);
> +}
> +
>
> +; Loop backedges are weighted, and their bodies represented as having a
> greater
> +; frequency.
>
> Please re-english. :)
>
> Please commit once you've fixed those.
>

Fixed and committed as r142491. Thanks!


>
> Nick
>
> On 16 October 2011 23:30, Chandler Carruth <chandlerc at google.com> wrote:
>
>> (Sent to the wrong address for Jakub it seems...)
>>
>>
>> On Sun, Oct 16, 2011 at 11:25 PM, Chandler Carruth <chandlerc at google.com>wrote:
>>
>>> Hello,
>>>
>>> So it turns out that BranchProbabilityInfo and BlockFrequencyInfo aren't
>>> rigged up to __builtin_expect at all. I think no one realized because we
>>> have essentially no test coverage for these analysis passes. See
>>> http://llvm.org/PR2577
>>>
>>> This patch adds test coverage for BlockFrequencyInfo which is the easiest
>>> to test, and essentially a good way to strictly cover BranchProbabilityInfo.
>>> Subsequent patches to add the remaining features to actually use
>>> __builtin_expect will follow with tests based on this.
>>> -Chandler
>>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111019/42b819d9/attachment.html>


More information about the llvm-commits mailing list