[PATCH] D140635: Enabled DFAJumpThreading by Default

YangguangLi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 23 13:44:27 PST 2022


Yangguang created this revision.
Yangguang added reviewers: xbolva00, SjoerdMeijer, nikic.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Yangguang requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

I measured the compile time impact for the DFAJumpThreading pass and did functional test on SPEC2017. 
As the result shown below, there is almost no impact in compile time. And the SPEC2017 benchmark suit
can be successfully compiled with several DFAJumpThreading transforms being applied to some of the
benchmarks. So I suggest that we enable DFAJumpThreading by Default.

Compile time test:

|                                             | DFA false | DFA true | Change (off-on)/off |
| MultiSourc...Benchmarks/7zip/7zip-benchmark | 82.02     | 82.73    | -0.87%              |
| MultiSourc...nchmarks/tramp3d-v4/tramp3d-v4 | 39.14     | 39.14    | 0.00%               |
| MultiSourc.../DOE-ProxyApps-C++/CLAMR/CLAMR | 37.25     | 37.44    | -0.51%              |
| MultiSource/Benchmarks/Bullet/bullet        | 36.88     | 36.73    | 0.41%               |
| MultiSourc.../Applications/JM/lencod/lencod | 25.89     | 25.84    | 0.19%               |
| MultiSourc...e/Applications/ClamAV/clamscan | 20.57     | 20.42    | 0.73%               |
| MultiSource/Applications/SPASS/SPASS        | 18.17     | 18.22    | -0.28%              |
| MultiSource/Applications/kimwitu++/kc       | 18.02     | 18.00    | 0.11%               |
| MultiSourc...e/Applications/sqlite3/sqlite3 | 16.65     | 16.78    | -0.78%              |
| MultiSourc...enchmarks/mafft/pairlocalalign | 14.59     | 14.54    | 0.34%               |
| MultiSourc...sumer-typeset/consumer-typeset | 13.58     | 13.68    | -0.74%              |
| MultiSourc...-ProxyApps-C++/PENNANT/PENNANT | 11.70     | 11.84    | -1.20%              |
| MultiSourc.../Applications/JM/ldecod/ldecod | 10.59     | 10.52    | 0.66%               |
| SingleSour...nchmarks/Adobe-C++/loop_unroll | 9.49      | 9.57     | -0.84%              |
| MicroBench...CALS/SubsetCRawLoops/lcalsCRaw | 9.20      | 9.17     | 0.33%               |
|

Number of DFAJumpThreading transforms in compile time test:

  "test-suite :: MultiSource/Applications/lua/lua.test" : "dfa-jump-threading.NumTransforms": 1.0, 
  "test-suite :: MultiSource/Applications/SPASS/SPASS.test" : "dfa-jump-threading.NumTransforms": 2.0, 
  "test-suite :: MultiSource/Benchmarks/7zip/7zip-benchmark.test" : "dfa-jump-threading.NumTransforms": 24.0, 
  "test-suite :: MultiSource/Applications/sqlite3/sqlite3.test" : "dfa-jump-threading.NumTransforms": 4.0, 
  "test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/CLAMR.test" : "dfa-jump-threading.NumTransforms": 2.0,
  "test-suite :: MultiSource/Applications/obsequi/Obsequi.test" : "dfa-jump-threading.NumTransforms": 1.0, 
  "test-suite :: MultiSource/Benchmarks/Ptrdist/bc/bc.test" : "dfa-jump-threading.NumTransforms": 1.0, 
  "test-suite :: MultiSource/Applications/ClamAV/clamscan.test" : "dfa-jump-threading.NumTransforms": 7.0, 
  "test-suite :: MultiSource/Applications/kimwitu++/kc.test" : "dfa-jump-threading.NumTransforms": 2.0, 
  "test-suite :: MultiSource/Benchmarks/MiBench/consumer-typeset/consumer-typeset.test" : "dfa-jump-threading.NumTransforms": 4.0, 
  "test-suite :: MultiSource/Benchmarks/McCat/01-qbsort/qbsort.test" : "dfa-jump-threading.NumTransforms": 1.0, 
  "test-suite :: MultiSource/Benchmarks/MallocBench/gs/gs.test" : "dfa-jump-threading.NumTransforms": 1.0, 
  "test-suite :: MultiSource/Benchmarks/MiBench/consumer-jpeg/consuuner-j peg. test" : "dfa-jump-threading.NumTransforms": 1.0, 
  "test-suite :: MultiSource/Benchmarks/mediabench/jpeg/jpeg-6a/cjpeg.test" : "dfa-jump-threading.NumTransforms": 1.0, 

SPEC2017 function test result:

| Benchmark | Compilation | # DFAJumpThreading Transforms |
| 554       | Success     | 0                             |
| 549       | Success     | 0                             |
| 544       | Success     | 0                             |
| 538       | Success     | 2                             |
| 527       | Success     | 1                             |
| 526       | Success     | 2                             |
| 521       | Success     | 1                             |
| 519       | Success     | 0                             |
| 511       | Success     | 2                             |
| 510       | Success     | 4                             |
| 508       | Success     | 0                             |
| 507       | Success     | 2                             |
| 503       | Success     | 0                             |
| 557       | Success     | 4                             |
| 548       | Success     | 0                             |
| 541       | Success     | 0                             |
| 531       | Success     | 0                             |
| 525       | Success     | 0                             |
| 523       | Success     | 7                             |
| 520       | Success     | 6                             |
| 505       | Success     | 0                             |
| 502       | Success     | 3                             |
| 500       | Success     | 10                            |
|


https://reviews.llvm.org/D140635

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp


Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -216,7 +216,7 @@
 static cl::opt<bool>
     EnableDFAJumpThreading("enable-dfa-jump-thread",
                            cl::desc("Enable DFA jump threading"),
-                           cl::init(false), cl::Hidden);
+                           cl::init(true), cl::Hidden);

 static cl::opt<bool>
     EnableHotColdSplit("hot-cold-split",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140635.484398.patch
Type: text/x-patch
Size: 549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221223/cb7ed19a/attachment.bin>


More information about the llvm-commits mailing list