summaryrefslogtreecommitdiffstats
path: root/lld/ELF/CallGraphSort.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a few typos in lld/ELF to cycle botsNico Weber2019-10-281-4/+4
|
* [ELF] Wrap things in `namespace lld { namespace elf {`, NFCFangrui Song2019-10-071-3/+7
| | | | | | | | | | | This makes it clear `ELF/**/*.cpp` files define things in the `lld::elf` namespace and simplifies `elf::foo` to `foo`. Reviewed By: atanasyan, grimar, ruiu Differential Revision: https://reviews.llvm.org/D68323 llvm-svn: 373885
* [ELF] Use union-find set and doubly linked list in Call-Chain Clustering ↵Fangrui Song2019-10-041-52/+62
| | | | | | | | | | | | | | | | | (C³) heuristic Before, SecToClusters[*] was used to track the belonged cluster. During a merge (From -> Into), every element of From has to be updated. Use a union-find set to speed up this use case. Also, replace `std::vector<int> Sections;` with a doubly-linked pointers: int Next, Prev; Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D46228 llvm-svn: 373708
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-051-1/+1
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* [ELF] Fix variable names in comments after VariableName -> variableName changeFangrui Song2019-07-161-3/+3
| | | | | | Also fix some typos. llvm-svn: 366181
* [Coding style change] Rename variables so that they start with a lowercase ↵Rui Ueyama2019-07-101-89/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | letter This patch is mechanically generated by clang-llvm-rename tool that I wrote using Clang Refactoring Engine just for creating this patch. You can see the source code of the tool at https://reviews.llvm.org/D64123. There's no manual post-processing; you can generate the same patch by re-running the tool against lld's code base. Here is the main discussion thread to change the LLVM coding style: https://lists.llvm.org/pipermail/llvm-dev/2019-February/130083.html In the discussion thread, I proposed we use lld as a testbed for variable naming scheme change, and this patch does that. I chose to rename variables so that they are in camelCase, just because that is a minimal change to make variables to start with a lowercase letter. Note to downstream patch maintainers: if you are maintaining a downstream lld repo, just rebasing ahead of this commit would cause massive merge conflicts because this patch essentially changes every line in the lld subdirectory. But there's a remedy. clang-llvm-rename tool is a batch tool, so you can rename variables in your downstream repo with the tool. Given that, here is how to rebase your repo to a commit after the mass renaming: 1. rebase to the commit just before the mass variable renaming, 2. apply the tool to your downstream repo to mass-rename variables locally, and 3. rebase again to the head. Most changes made by the tool should be identical for a downstream repo and for the head, so at the step 3, almost all changes should be merged and disappear. I'd expect that there would be some lines that you need to merge by hand, but that shouldn't be too many. Differential Revision: https://reviews.llvm.org/D64121 llvm-svn: 365595
* Use llvm::stable_sortFangrui Song2019-04-231-6/+5
| | | | | | | | | Make some small adjustment while touching the code: make parameters const, use less_first(), etc. Differential Revision: https://reviews.llvm.org/D60989 llvm-svn: 358943
* Replace `typedef A B` with `using B = A`. NFC.Rui Ueyama2019-04-011-2/+2
| | | | | | | | I did this using Perl. Differential Revision: https://reviews.llvm.org/D60003 llvm-svn: 357372
* [ELF] Dump symbols ordered by profiled guided section layout to file.Rui Ueyama2019-03-271-0/+21
| | | | | | | | | | | | | | | | Patch by Tiancong Wang. In D36351, Call-Chain Clustering (C3) heuristic is implemented with option --call-graph-ordering-file <file>. This patch adds a flag --print-symbol-order=<file> to LLD, and when specified, it prints out the symbols ordered by the heuristics to the file. The symbols printout is helpful to those who want to understand the heuristics and want to reproduce the ordering with --symbol-ordering-file in later pass. Differential Revision: https://reviews.llvm.org/D59311 llvm-svn: 357133
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Simplify. NFC.Rui Ueyama2018-10-121-11/+8
| | | | | | | | - Removed redundant `llvm::` - Typedef a long type name - Initialize members by member initializers llvm-svn: 344427
* [LLD][ELF] - Simplify Call-Chain Clustering implementation a bit.George Rimar2018-08-281-16/+10
| | | | | | | | | | Looking at the current implementation and algorithm description, it does not seem we need to keep vector with all edges for each cluster and can just remember the best one. This is NFC change. Differential revision: https://reviews.llvm.org/D50609 llvm-svn: 340806
* [LLF][ELF] - Simplify. NFC.George Rimar2018-08-121-3/+3
| | | | llvm-svn: 339510
* [ELF] - Never use std::sort.George Rimar2018-04-241-4/+4
| | | | | | | | | | | | | | | It turns out we should not use the std::sort anymore. r327219 added a new wrapper llvm::sort (D39245). When EXPENSIVE_CHECKS is defined, it shuffles the input container and that helps to find non-deterministic ordering. Patch changes code to use llvm::sort and std::stable_sort instead of std::sort Differential revision: https://reviews.llvm.org/D45969 llvm-svn: 330702
* [ELF] - Simplify. NFC.George Rimar2018-04-231-5/+3
| | | | llvm-svn: 330597
* [ELF] Add profile guided section layoutMichael J. Spencer2018-04-171-0/+251
This adds profile guided layout using the Call-Chain Clustering (C³) heuristic from https://research.fb.com/wp-content/uploads/2017/01/cgo2017-hfsort-final1.pdf . RFC: [llvm-dev] [RFC] Profile guided section layout http://lists.llvm.org/pipermail/llvm-dev/2017-June/114178.html Pass `--call-graph-ordering-file <file>` to read a call graph profile where each line has the format: <from symbol> <to symbol> <call count> Differential Revision: https://reviews.llvm.org/D36351 llvm-svn: 330234
OpenPOWER on IntegriCloud