Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSE] [InstCombine] Compiling a single file with optimizations on takes > 10 minutes #10328

Closed
akyrtzi opened this issue May 20, 2011 · 4 comments
Labels
backend:X86 bugzilla Issues migrated from bugzilla

Comments

@akyrtzi
Copy link
Contributor

akyrtzi commented May 20, 2011

Bugzilla Link 9956
Resolution FIXED
Resolved on Mar 25, 2019 04:47
Version trunk
OS All
Attachments Preprocessed file
CC @fhahn,@nico

Extended Description

$ time /usr/bin/clang++ -O3 -c DiagnosticIDs-1.ii

real 13m17.118s
user 13m14.292s
sys 0m2.795s

gcc for comparison:

$ time /usr/bin/g++ -O3 -c DiagnosticIDs-1.ii

real 9m12.501s
user 9m10.618s
sys 0m1.867s

@akyrtzi
Copy link
Contributor Author

akyrtzi commented May 20, 2011

Cloned in rdar://9471075.

@akyrtzi
Copy link
Contributor Author

akyrtzi commented May 20, 2011

Possibly due to StringRef("foo") in the macros, leading to excessive strlen calls.

@lattner
Copy link
Collaborator

lattner commented May 22, 2011

There is something clearly bad happening here, all the time is spent in two passes (DSE and instcombine):

---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
465.8930 ( 50.2%) 0.3707 ( 18.8%) 466.2637 ( 50.1%) 466.3025 ( 50.0%) Dead Store Elimination
426.0553 ( 45.9%) 1.0178 ( 51.6%) 427.0731 ( 45.9%) 429.4982 ( 46.0%) Combine redundant instructions
20.8264 ( 2.2%) 0.1089 ( 5.5%) 20.9353 ( 2.3%) 20.9357 ( 2.2%) Function Integration/Inlining
10.0879 ( 1.1%) 0.4157 ( 21.1%) 10.5036 ( 1.1%) 10.5043 ( 1.1%) X86 DAG->DAG Instruction Selection
3.5036 ( 0.4%) 0.0009 ( 0.0%) 3.5044 ( 0.4%) 3.5045 ( 0.4%) Calculate spill weights

@fhahn
Copy link
Contributor

fhahn commented Mar 25, 2019

This completes in ~15s on recent hardware. The imbalance is much smaller and DSE does not stick out hugely any more. There is still a problem with DSE on huge basic blocks, but the code here does not really show the issue.

===-------------------------------------------------------------------------===
... Pass execution timing report ...
===-------------------------------------------------------------------------===
Total Execution Time: 14.4792 seconds (14.5075 wall clock)

---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
3.7700 ( 27.2%) 0.0082 ( 1.4%) 3.7782 ( 26.1%) 3.7885 ( 26.1%) Dead Store Elimination
3.1398 ( 22.6%) 0.4919 ( 81.6%) 3.6317 ( 25.1%) 3.6369 ( 25.1%) Global Variable Optimizer #​2
2.1581 ( 15.6%) 0.0111 ( 1.8%) 2.1692 ( 15.0%) 2.1718 ( 15.0%) Function Integration/Inlining
1.1521 ( 8.3%) 0.0032 ( 0.5%) 1.1553 ( 8.0%) 1.1580 ( 8.0%) Dead Global Elimination
1.1421 ( 8.2%) 0.0030 ( 0.5%) 1.1451 ( 7.9%) 1.1466 ( 7.9%) Dead Global Elimination #​2
0.4032 ( 2.9%) 0.0050 ( 0.8%) 0.4082 ( 2.8%) 0.4085 ( 2.8%) Combine redundant instructions

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

3 participants