Re: [PATCH 6/9] perf: Generic pci uncore device support

Peter Zijlstra
2012-05-03T21:37:44Z

On Wed, 2012-05-02 at 10:07 +0800, Yan, Zheng wrote:
> + if (box->pci_dev) {
> + hwc->config_base = uncore_pci_event_ctl(box,
> hwc->idx);
> + hwc->event_base = uncore_pci_perf_ctr(box, hwc->idx);
> + } else {
> + hwc->config_base = uncore_msr_event_ctl(box,
> hwc->idx);
> + hwc->event_base = uncore_msr_perf_ctr(box, hwc->idx);
> + }

Since box is already an argument to uncore_*_event_ct[lr]() it could
include this conditional. Is GCC smart enough to pull it out and not
evaluate the condition twice in that case?