[all-commits] [llvm/llvm-project] 8d5b28: [LoopDelete][Assume] Allow deleting loops with ass...

Ralender via All-commits all-commits at lists.llvm.org
Sat Sep 26 03:34:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8d5b289a4681d89f4dedcd8926225333e0772967
      https://github.com/llvm/llvm-project/commit/8d5b289a4681d89f4dedcd8926225333e0772967
  Author: Tyker <tyker1 at outlook.com>
  Date:   2020-09-26 (Sat, 26 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopDeletion.cpp
    A llvm/test/Transforms/LoopDeletion/assume.ll

  Log Message:
  -----------
  [LoopDelete][Assume] Allow deleting loops with assumes

This pervent very poor optimization caused by a signle assume like https://godbolt.org/z/EK3oMh

baseline flags: -O3
patched flags: -O3 -mllvm --enable-knowledge-retention

Before the patch
```
Metric: compile_time
Program                                                      baseline patched diff
             test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test  20.72    29.74  43.5%
                     test-suite :: CTMark/Bullet/bullet.test  24.39    24.91   2.2%
               test-suite :: CTMark/7zip/7zip-benchmark.test  37.39    38.06   1.8%
                      test-suite :: CTMark/kimwitu++/kc.test  11.76    11.94   1.5%
                   test-suite :: CTMark/sqlite3/sqlite3.test  12.94    12.91  -0.3%
                       test-suite :: CTMark/SPASS/SPASS.test  11.72    11.70  -0.2%
                     test-suite :: CTMark/lencod/lencod.test  16.12    16.10  -0.1%
                   test-suite :: CTMark/ClamAV/clamscan.test  13.31    13.30  -0.1%
              test-suite :: CTMark/mafft/pairlocalalign.test   9.12     9.12  -0.1%
 test-suite :: CTMark/consumer-typeset/consumer-typeset.test   9.34     9.34  -0.1%
                                          Geomean difference                   4.2%

Metric: compiler_Kinst_count
Program                                                      baseline     patched      diff
             test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test 107576069.87 172886418.90 60.7%
                     test-suite :: CTMark/Bullet/bullet.test 123291865.66 125457117.96  1.8%
                      test-suite :: CTMark/kimwitu++/kc.test  56347884.64  57298544.14  1.7%
               test-suite :: CTMark/7zip/7zip-benchmark.test 180637699.58 183341656.57  1.5%
                   test-suite :: CTMark/sqlite3/sqlite3.test  66723788.85  66664692.80 -0.1%
                   test-suite :: CTMark/ClamAV/clamscan.test  69581500.56  69597863.92  0.0%
                     test-suite :: CTMark/lencod/lencod.test  94236501.48  94216545.32 -0.0%
                       test-suite :: CTMark/SPASS/SPASS.test  58516756.95  58505089.07 -0.0%
 test-suite :: CTMark/consumer-typeset/consumer-typeset.test  48832815.53  48841989.39  0.0%
              test-suite :: CTMark/mafft/pairlocalalign.test  49682720.53  49686324.34  0.0%
                                          Geomean difference                            5.4%
```

After the patch
```
Metric: compile_time
Program                                                      baseline patched diff
             test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test  20.70    22.40   8.2%
               test-suite :: CTMark/7zip/7zip-benchmark.test  37.13    38.05   2.5%
                     test-suite :: CTMark/Bullet/bullet.test  24.25    24.83   2.4%
                      test-suite :: CTMark/kimwitu++/kc.test  11.69    11.94   2.2%
                   test-suite :: CTMark/ClamAV/clamscan.test  13.19    13.36   1.3%
                     test-suite :: CTMark/lencod/lencod.test  16.02    16.19   1.1%
 test-suite :: CTMark/consumer-typeset/consumer-typeset.test   9.29     9.36   0.7%
                       test-suite :: CTMark/SPASS/SPASS.test  11.64    11.73   0.7%
              test-suite :: CTMark/mafft/pairlocalalign.test   9.10     9.15   0.5%
                   test-suite :: CTMark/sqlite3/sqlite3.test  12.95    12.96   0.0%
                                          Geomean difference                   1.9%

Metric: compiler_Kinst_count
Program                                                      baseline     patched      diff
             test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test 107590933.61 114044834.72  6.0%
                      test-suite :: CTMark/kimwitu++/kc.test  56344526.77  57235806.29  1.6%
                     test-suite :: CTMark/Bullet/bullet.test 123291285.10 125128334.97  1.5%
               test-suite :: CTMark/7zip/7zip-benchmark.test 180641540.10 183155706.39  1.4%
                   test-suite :: CTMark/sqlite3/sqlite3.test  66725619.22  66668713.92 -0.1%
                       test-suite :: CTMark/SPASS/SPASS.test  58509029.85  58478704.75 -0.1%
 test-suite :: CTMark/consumer-typeset/consumer-typeset.test  48843711.23  48826894.68 -0.0%
                     test-suite :: CTMark/lencod/lencod.test  94233305.79  94207544.23 -0.0%
                   test-suite :: CTMark/ClamAV/clamscan.test  69587887.66  69603549.90  0.0%
              test-suite :: CTMark/mafft/pairlocalalign.test  49686968.65  49689291.04  0.0%
                                          Geomean difference                            1.0%
```

Reviewed By: jdoerfert, efriedma

Differential Revision: https://reviews.llvm.org/D86816




More information about the All-commits mailing list