[PATCH] D84108: [SimplifyCFG][LoopRotate] SimplifyCFG: disable common instruction hoisting by default, enable late in pipeline

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 19 02:01:46 PDT 2020


lebedev.ri added a comment.

In D84108#2160496 <https://reviews.llvm.org/D84108#2160496>, @lebedev.ri wrote:

> In D84108#2160494 <https://reviews.llvm.org/D84108#2160494>, @nikic wrote:
>
> > > this does regress compile-time by +0.5% geomean (unsurprizingly)
> >
> > FWIW, a large part of the regressions seems to come down to a single file that regresses big time:
> >
> > > CMakeFiles/lencod.dir/context_ini.c.o 	3917M 	7067M (+80.41%)
> >
> > Probably worth taking a look whether that can be mitigated.
>
>
> Thanks, i will take a look, just really wanted to finally post this after two dry-runs due to the rG0fdcca07ad2c0bdc2cdd40ba638109926f4f513b <https://reviews.llvm.org/rG0fdcca07ad2c0bdc2cdd40ba638109926f4f513b>/rG8d487668d09fb0e4e54f36207f07c1480ffabbfd <https://reviews.llvm.org/rG8d487668d09fb0e4e54f36207f07c1480ffabbfd> :)


I presently don't know what is actually going on, but [old] GVN is to blame there, it goes from

  Total Execution Time: 0.9114 seconds (0.9113 wall clock)
  
   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   0.1325 ( 14.7%)   0.0000 (  0.0%)   0.1325 ( 14.5%)   0.1325 ( 14.5%)  Global Value Numbering

to

  ===-------------------------------------------------------------------------===
    Total Execution Time: 1.7953 seconds (1.7952 wall clock)
  
     ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
     0.9874 ( 55.9%)   0.0095 ( 32.7%)   0.9970 ( 55.5%)   0.9970 ( 55.5%)  Global Value Numbering

Stats delta:

| statistic name                             | baseline | proposed | Δ      | %        | abs(%)   |
| ------------------------------------------ | -------- | -------- | ------ | -------- | -------- |
| memdep.NumCacheNonLocalPtr                 | 2804     | 114188   | 111384 | 3972.33% | 3972.33% |
| memdep.NumUncacheNonLocalPtr               | 2638     | 91937    | 89299  | 3385.10% | 3385.10% |
| memory-builtins.ObjectVisitorArgument      | 380      | 4606     | 4226   | 1112.11% | 1112.11% |
| simplifycfg.NumHoistCommonCode             | 49       | 223      | 174    | 355.10%  | 355.10%  |
| basicaa.SearchTimes                        | 99200    | 445902   | 346702 | 349.50%  | 349.50%  |
| local.NumRemoved                           | 35       | 137      | 102    | 291.43%  | 291.43%  |
| simplifycfg.NumHoistCommonInstrs           | 378      | 803      | 425    | 112.43%  | 112.43%  |
| mem2reg.NumLocalPromoted                   | 3        | 1        | -2     | -66.67%  | 66.67%   |
| indvars.NumElimExt                         | 106      | 148      | 42     | 39.62%   | 39.62%   |
| licm.NumSunk                               | 3063     | 3855     | 792    | 25.86%   | 25.86%   |
| instcombine.NumDeadInst                    | 428      | 525      | 97     | 22.66%   | 22.66%   |
| jump-threading.NumThreads                  | 18       | 22       | 4      | 22.22%   | 22.22%   |
| licm.NumHoisted                            | 453      | 552      | 99     | 21.85%   | 21.85%   |
| gvn.NumGVNLoad                             | 111      | 135      | 24     | 21.62%   | 21.62%   |
| simplifycfg.NumSinkCommonInstrs            | 396      | 312      | -84    | -21.21%  | 21.21%   |
| instcombine.NumSunkInst                    | 10       | 12       | 2      | 20.00%   | 20.00%   |
| simplifycfg.NumSimpl                       | 1195     | 1424     | 229    | 19.16%   | 19.16%   |
| early-cse.NumCSELoad                       | 97       | 114      | 17     | 17.53%   | 17.53%   |
| sroa.MaxUsesPerAllocaPartition             | 120      | 138      | 18     | 15.00%   | 15.00%   |
| sroa.NumAllocaPartitionUses                | 770      | 884      | 114    | 14.81%   | 14.81%   |
| instcombine.NumCombined                    | 1328     | 1522     | 194    | 14.61%   | 14.61%   |
| sroa.NumDeleted                            | 828      | 942      | 114    | 13.77%   | 13.77%   |
| gvn.NumGVNInstr                            | 303      | 343      | 40     | 13.20%   | 13.20%   |
| simplifycfg.NumSinkCommonCode              | 188      | 167      | -21    | -11.17%  | 11.17%   |
| bdce.NumRemoved                            | 18       | 16       | -2     | -11.11%  | 11.11%   |
| licm.NumMovedLoads                         | 77       | 69       | -8     | -10.39%  | 10.39%   |
| gvn.NumGVNSimpl                            | 31       | 28       | -3     | -9.68%   | 9.68%    |
| lcssa.NumLCSSA                             | 293      | 265      | -28    | -9.56%   | 9.56%    |
| instsimplify.NumSimplified                 | 54       | 49       | -5     | -9.26%   | 9.26%    |
| correlated-value-propagation.NumPhis       | 25       | 27       | 2      | 8.00%    | 8.00%    |
| memdep.NumCacheDirtyNonLocalPtr            | 26       | 28       | 2      | 7.69%    | 7.69%    |
| gvn.NumGVNBlocks                           | 58       | 55       | -3     | -5.17%   | 5.17%    |
| loop-vectorize.LoopsAnalyzed               | 58       | 55       | -3     | -5.17%   | 5.17%    |
| scalar-evolution.NumTripCountsComputed     | 264      | 251      | -13    | -4.92%   | 4.92%    |
| memdep.NumCacheCompleteNonLocalPtr         | 41       | 42       | 1      | 2.44%    | 2.44%    |
| assume-queries.NumAssumeQueries            | 616      | 604      | -12    | -1.95%   | 1.95%    |
| instcombine.NegatorNumValuesVisited        | 2333     | 2289     | -44    | -1.89%   | 1.89%    |
| instcombine.NegatorTotalNegationsAttempted | 2333     | 2289     | -44    | -1.89%   | 1.89%    |
| scalar-evolution.NumTripCountsNotComputed  | 0        | 1        | 1      | 0.00%    | 0.00%    |
|


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84108





More information about the llvm-commits mailing list