[PATCH] D127726: [InstCombiner] Add option to replace PHI of GEPs with GEP with PHI as index

Elena Lepilkina via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 06:07:14 PDT 2022


eklepilkina added a comment.

I added this under the flag and run subset of test-suite with flag turned on.
The comparasion results are in cycles (got by perf).

  Program                                       lhs             rhs             diff 
  test-suite...ks/McCat/12-IOtest/iotest.test     1730119179.50   1759987511.50  1.7%
  test-suite...dbl/InductionVariable-dbl.test    15970628662.00  16143688715.00  1.1%
  test-suite...ks/Shootout/Shootout-ary3.test     6325347117.00   6381912099.50  0.9%
  test-suite...nchmarks/McCat/05-eks/eks.test        8518913.50      8587491.50  0.8%
  test-suite...ootout/Shootout-ackermann.test       25282176.00     25469480.50  0.7%
  test-suite...arks/Misc-C++/mandel-text.test        4674518.00      4703841.50  0.6%
  test-suite...hmarks/Linpack/linpack-pc.test    11993126592.50  12064251950.50  0.6%
  test-suite...hmarks/McCat/08-main/main.test      225665552.50    226796119.00  0.5%
  test-suite...nchmarks/llubenchmark/llu.test    49595221348.00  49825997987.50  0.5%
  test-suite...ks/BenchmarkGame/fannkuch.test     8840456858.50   8875706667.00  0.4%
  test-suite...enchmarks/Misc-C++/bigfib.test     1115784166.50   1119810490.00  0.4%
  test-suite...s/Shootout/Shootout-lists.test    15792799815.50  15841314384.00  0.3%
  test-suite...hootout/Shootout-methcall.test    23138087710.50  23207934639.00  0.3%
  test-suite...enchmarks/SmallPT/smallpt.test   133647137171.50 134007183990.00  0.3%
  test-suite...pansion-dbl/Expansion-dbl.test    15082523126.50  15122058550.00  0.3%
  test-suite...ks/VersaBench/8b10b/8b10b.test    16297287940.00  16334546875.50  0.2%
  test-suite...g/correlation/correlation.test    22344211730.00  22376027642.50  0.1%
  test-suite...dbl/LoopRestructuring-dbl.test    17866275862.50  17891513886.50  0.1%
  test-suite...tions/lambda-0.1.3/lambda.test    23848609431.50  23874580616.00  0.1%
  test-suite...isc-C++/Large/sphereflake.test    22534218048.50  22557448226.50  0.1%
  test-suite...arks/CoyoteBench/fftbench.test     9755232988.50   9764752974.50  0.1%
  test-suite...BenchmarkGame/Large/fasta.test     2953324792.00   2956162851.00  0.1%
  test-suite...hootout/Shootout-heapsort.test    12178551710.50  12189772510.50  0.1%
  test-suite.../VersaBench/ecbdes/ecbdes.test     7658433342.00   7665010262.00  0.1%
  test-suite...lications/minisat/minisat.test    36458868838.50  36487032574.50  0.1%
  test-suite...nch/beamformer/beamformer.test     3386405080.50   3388803280.00  0.1%
  test-suite...s/BenchmarkGame/recursive.test     4357781157.50   4360511842.50  0.1%
  test-suite...sc-C++/stepanov_container.test    19735457132.50  19744002826.00  0.0%
  test-suite...ing/covariance/covariance.test    22339342859.00  22345554589.50  0.0%
  test-suite...nchmarks/McCat/18-imp/imp.test      220190325.50    220233858.50  0.0%
  test-suite...nchmarkGame/spectral-norm.test     5131851853.00   5132763450.50  0.0%
  test-suite...ications/JM/lencod/lencod.test    22163302318.00  22164857640.00  0.0%
  test-suite.../Shootout/Shootout-random.test     6800321466.00   6800648301.50  0.0%
  test-suite...C/Packing-flt/Packing-flt.test    11853900866.00  11854075069.50  0.0%
  test-suite...arks/Misc-C++/oopack_v1p8.test      469347892.00    469345852.00 -0.0%
  test-suite.../Shootout/Shootout-matrix.test     7736484059.50   7736206171.50 -0.0%
  test-suite...arks/BenchmarkGame/n-body.test     5077979989.50   5077524708.00 -0.0%
  test-suite...ks/Shootout/Shootout-fib2.test     6044285917.00   6042939836.50 -0.0%
  test-suite...rks/CoyoteBench/almabench.test    55903132772.00  55888456245.00 -0.0%
  test-suite...arks/VersaBench/dbms/dbms.test     6377529281.00   6375371712.00 -0.0%
  test-suite...lFlow-flt/ControlFlow-flt.test    14248096032.50  14243188640.00 -0.0%
  test-suite...BenchmarkGame/partialsums.test     1751834064.50   1751013687.00 -0.0%
  test-suite...ks/Shootout/Shootout-hash.test    26538589089.00  26525947808.00 -0.0%
  test-suite...ks/McCat/04-bisect/bisect.test      461377892.00    461131908.00 -0.1%
  test-suite...rks/CoyoteBench/huffbench.test    51898090546.50  51863510434.00 -0.1%
  test-suite...ks/Misc-C++/stepanov_v1p2.test    19604519098.50  19590038581.00 -0.1%
  test-suite...s/Shootout/Shootout-sieve.test    17504360694.50  17489338906.00 -0.1%
  test-suite...gebra/kernels/syr2k/syr2k.test    19044493844.00  19023576343.00 -0.1%
  test-suite...marks/CoyoteBench/lpbench.test    31592682170.00  31555540368.00 -0.1%
  test-suite...lications/SIBsim4/SIBsim4.test    12830348755.00  12814944423.50 -0.1%
  test-suite...hmarks/VersaBench/bmm/bmm.test    15498981844.00  15471594390.00 -0.2%
  test-suite...ications/JM/ldecod/ldecod.test      200649404.50    200267732.50 -0.2%
  test-suite...hmarks/Misc-C++/Large/ray.test    11946912378.00  11921434993.50 -0.2%
  test-suite...ing-flt/LoopRerolling-flt.test    16000457270.00  15951286477.00 -0.3%
  test-suite...hmarks/Misc-C++-EH/spirit.test    51411075104.00  51251308313.00 -0.3%
  test-suite...arks/mafft/pairlocalalign.test    70582165091.00  70319704425.50 -0.4%
  test-suite...ks/McCat/01-qbsort/qbsort.test      329657452.50    328273253.00 -0.4%
  test-suite.../Shootout/Shootout-strcat.test      440747280.00    438762150.00 -0.5%
  test-suite...s/Shootout/Shootout-hello.test        1553176.00      1545444.50 -0.5%
  test-suite...BenchmarkGame/nsieve-bits.test     3450081201.50   3431868282.50 -0.5%
  test-suite...arks/BenchmarkGame/puzzle.test      401683862.50    399282456.00 -0.6%
  test-suite...nchmarks/McCat/09-vor/vor.test      391180151.50    388582881.50 -0.7%
  test-suite...algebra/kernels/symm/symm.test   147266145123.00 146250484895.00 -0.7%
  test-suite.../Applications/spiff/spiff.test    10344289458.00  10271890620.00 -0.7%
  test-suite...cCat/03-testtrie/testtrie.test       40115596.50     39727934.00 -1.0%
  test-suite...lications/sqlite3/sqlite3.test    14597138412.50  14408790445.50 -1.3%
  test-suite...hmarks/McCat/15-trie/trie.test        4096874.00      4027291.50 -1.7%
  test-suite...arks/McCat/17-bintr/bintr.test      304726204.50    297527095.00 -2.4%
  test-suite...Shootout/Shootout-objinst.test        1592863.50      1541648.50 -3.2%
  test-suite...otout/Shootout-nestedloop.test        1656967.50      1538899.00 -7.1%
  Geomean difference                                                            -0.2%
                  lhs           rhs       diff
  count  7.000000e+01  7.000000e+01  70.000000
  mean   1.673824e+10  1.672873e+10 -0.001837 
  std    2.611553e+10  2.605807e+10  0.010844 
  min    1.553176e+06  1.538899e+06 -0.071256 
  25%    6.309570e+08  6.319620e+08 -0.002075 
  50%    1.004976e+10  1.001832e+10 -0.000020 
  75%    1.946451e+10  1.944842e+10  0.001332 
  max    1.472661e+11  1.462505e+11  0.017264 

I didn't get any real regressions. The first 2 regressions (`iotest.test ` and `InductionVariable-dbl.test`) aren't real regressions, IR isn't changed by InstCombine and assembly is the same.

At the same time we got improvement of Coremark with this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127726



More information about the llvm-commits mailing list