summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MCA/HardwareUnits/ResourceManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Fixes -Wrange-loop-analysis warningsMark de Wever2020-01-011-1/+1
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-2/+2
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* [MCA] Slightly refactor the logic in ResourceManager. NFCIAndrea Di Biagio2019-08-151-22/+33
| | | | | | | | This patch slightly changes the API in the attempt to simplify resource buffer queries. It is done in preparation for a patch that will enable support for macro fusion. llvm-svn: 368994
* [MCA][ResourceManager] Add a table that maps processor resource indices to ↵Andrea Di Biagio2019-02-201-21/+24
| | | | | | | | | | | | processor resource identifiers. This patch adds a lookup table to speed up resource queries in the ResourceManager. This patch also moves helper function 'getResourceStateIndex()' from ResourceManager.cpp to Support.h, so that we can reuse that logic in the SummaryView (and potentially other views in llvm-mca). No functional change intended. llvm-svn: 354470
* [MCA] Store a bitmask of used groups in the instruction descriptor.Andrea Di Biagio2019-02-131-4/+11
| | | | | | | This is to speedup 'checkAvailability' queries in class ResourceManager. No functional change intended. llvm-svn: 353949
* [MCA] Return a mask of busy resources from method ↵Andrea Di Biagio2019-02-111-9/+21
| | | | | | | | | | | ResourceManager::checkAvailability(). NFCI In case of bottlenecks caused by pipeline pressure, we want to be able to correctly report the set of problematic pipelines. This is a first step towards adding support for bottleneck hints in llvm-mca (see PR37494). No functional change intended. llvm-svn: 353706
* [MCA] Speedup ResourceManager queries. NFCIAndrea Di Biagio2019-02-061-8/+9
| | | | | | | | | | | | | When a resource unit R is released, the ResourceManager notifies groups that contain R. Before this patch, the logic in method ResourceManager::release() implemented a potentially slow iterative search of dependent groups on the entire set of processor resources. This patch replaces that logic with a simpler (and often faster) lookup on array `Resource2Groups`. This patch gives an average speedup of ~3-4% (observed on a release build when testing for target btver2). No functional change intended. llvm-svn: 353301
* 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
* [MCA] Fix wrong definition of ResourceUnitMask in DefaultResourceStrategy.Andrea Di Biagio2019-01-101-4/+2
| | | | | | | | | | | | | | Field ResourceUnitMask was incorrectly defined as a 'const unsigned' mask. It should have been a 64 bit quantity instead. That means, ResourceUnitMask was always implicitly truncated to a 32 bit quantity. This issue has been found by inspection. Surprisingly, that bug was latent, and it never negatively affected any existing upstream targets. This patch fixes the wrong definition of ResourceUnitMask, and adds a bunch of extra debug prints to help debugging potential issues related to invalid processor resource masks. llvm-svn: 350820
* [llvm-mca] Display masks in hexEvandro Menezes2019-01-091-3/+3
| | | | | | Display the resources masks as hexadecimal. Otherwise, NFC. llvm-svn: 350777
* [llvm-mca] Improve debugging (NFC)Evandro Menezes2019-01-081-0/+1
| | | | llvm-svn: 350661
* [MCA] Improved handling of in-order issue/dispatch resources.Andrea Di Biagio2019-01-041-18/+0
| | | | | | | | | | | Added field 'MustIssueImmediately' to the instruction descriptor of instructions that only consume in-order issue/dispatch processor resources. This speeds up queries from the hardware Scheduler, and gives an average ~5% speedup on a release build. No functional change intended. llvm-svn: 350397
* [MCA] Store extra information about processor resources in the ResourceManager.Andrea Di Biagio2019-01-041-14/+32
| | | | | | | | | | | | | | | | | | | | | Method ResourceManager::use() is responsible for updating the internal state of used processor resources, as well as notifying resource groups that contain used resources. Before this patch, method 'use()' didn't know how to quickly obtain the set of groups that contain a particular resource unit. It had to discover groups by perform a potentially slow search (done by iterating over the set of processor resource descriptors). With this patch, the relationship between resource units and groups is stored in the ResourceManager. That means, method 'use()' no longer has to search for groups. This gives an average speedup of ~4-5% on a release build. This patch also adds extra code comments in ResourceManager.h to better describe the resource mask layout, and how resouce indices are computed from resource masks. llvm-svn: 350387
* [MCA] Improve code comment and reuse an helper function in ResourceManager. NFCIAndrea Di Biagio2019-01-031-9/+10
| | | | llvm-svn: 350322
* [MCA] Minor refactoring of method DefaultResourceStrategy::select. NFCIAndrea Di Biagio2019-01-021-18/+21
| | | | | | | | | | | | | | | | | Common code used by the default resource strategy to select pipeline resources has been moved to an helper function. The new selection logic has been slightly rewritten to get rid of a redundant zero check on the `ReadyMask` value. Before this patch, method select internally called function `PowerOf2Floor` to compute the next ready pipeline resource. However, `PowerOf2Floor` forces an implicit (redundant) zero check on the input value. By construction, `ReadyMask` can never be zero. This patch replaces the call to `PowerOf2Floor` with an equivalent block of code which avoids the redundant zero check. This gives a minor 3-3.5% speedup on a release build. No functional change intended. llvm-svn: 350218
* [llvm-mca] Dump mask in hexEvandro Menezes2018-12-181-2/+4
| | | | | | Dump the resources masks as hexadecimal. llvm-svn: 349536
* [llvm-mca] Move llvm-mca library to llvm/lib/MCA.Clement Courbet2018-12-171-0/+326
Summary: See PR38731. Reviewers: andreadb Subscribers: mgorny, javed.absar, tschuett, gbedwell, andreadb, RKSimon, llvm-commits Differential Revision: https://reviews.llvm.org/D55557 llvm-svn: 349332
OpenPOWER on IntegriCloud