[PATCH] D65148: [SimplifyCFG] Bump phi-node-folding-threshold from 2 to 3

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 02:40:44 PDT 2019


lebedev.ri added a comment.
Herald added a subscriber: ychen.

In D65148#1658556 <https://reviews.llvm.org/D65148#1658556>, @efriedma wrote:

> > So, what metric specifically do you want to see, a count of CMOV instructions at the end of codegen, how it is changed by this patch?
>
> I guess more the number of branches at the end of codegen... because there are really three possibilities here: the select is lowered to cmov, the select is lowered to branch, or the select gets optimized to some non-select computation.   But yes, something like that. I would guess most of the selects generated this way can't be significantly optimized, so if everything is working correctly, most of them should be getting converted back to branches.


Okay, wrote a pass to count the interesting metrics at the final pass in backend (D67240 <https://reviews.llvm.org/D67240>).
Numbers for RawSpeed:

| metric                                 | old    | new    | cnt change | % change |  |
| x86-mi-counting.NumMachineFunctions    | 10513  | 10513  | 0          | 0.00%    |
| x86-mi-counting.NumMachineBasicBlocks  | 200350 | 200163 | -187       | -0.09%   |
| x86-mi-counting.NumMachineInstructions | 3307866      | 3305504      | -2362      | -0.07%   |
| x86-mi-counting.NumUncondBR            | 33479  | 33465  | -14        | -0.04%   |
| x86-mi-counting.NumCondBR              | 91062  | 90908  | -154       | -0.17%   |
| x86-mi-counting.NumCMOV                | 4195   | 4284   | 89         | 2.12%    |
| x86-mi-counting.NumVecBlend            | 17     | 17     | 0          | 0.00%    |
|

As it is evident, while there is an increase in cmov count,
the decrease of branch count is almost twice that,
and there is notable decrease of total instruction count, basic block count.
I believe that supports the benchmark numbers.

F9931070: results-old.json <https://reviews.llvm.org/F9931070> F9931071: results-new.json <https://reviews.llvm.org/F9931071>

Does that line up with what you wanted to see?

Will post test-suite numbers a bit later, not sure how to aggregate them..


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65148/new/

https://reviews.llvm.org/D65148





More information about the llvm-commits mailing list