summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/Support.h
diff options
context:
space:
mode:
authorMatt Davis <Matthew.Davis@sony.com>2018-08-27 17:16:32 +0000
committerMatt Davis <Matthew.Davis@sony.com>2018-08-27 17:16:32 +0000
commit271ce76352fdef802e6ecea7d1a9bb595963b609 (patch)
tree6e1615bba5451f7e3be62f6b88cf339c0294a18d /llvm/tools/llvm-mca/Support.h
parentb09ecf93060d982c26fa036c9beb1140b7e5f627 (diff)
downloadbcm5719-llvm-271ce76352fdef802e6ecea7d1a9bb595963b609.tar.gz
bcm5719-llvm-271ce76352fdef802e6ecea7d1a9bb595963b609.zip
[llvm-mca] Introduce the llvm-mca library and organize the directory accordingly. NFC.
Summary: This patch introduces llvm-mca as a library. The driver (llvm-mca.cpp), views, and stats, are not part of the library. Those are separate components that are not required for the functioning of llvm-mca. The directory has been organized as follows: All library source files now reside in: - `lib/HardwareUnits/` - All subclasses of HardwareUnit (these represent the simulated hardware components of a backend). (LSUnit does not inherit from HardwareUnit, but Scheduler does which uses LSUnit). - `lib/Stages/` - All subclasses of the pipeline stages. - `lib/` - This is the root of the library and contains library code that does not fit into the Stages or HardwareUnit subdirs. All library header files now reside in the `include` directory and mimic the same layout as the `lib` directory mentioned above. In the (near) future we would like to move the library (include and lib) contents from tools and into the core of llvm somewhere. That change would allow various analysis and optimization passes to make use of MCA functionality for things like cost modeling. I left all of the non-library code just where it has always been, in the root of the llvm-mca directory. The include directives for the non-library source file have been updated to refer to the llvm-mca library headers. I updated the llvm-mca/CMakeLists.txt file to include the library headers, but I made the non-library code explicitly reference the library's 'include' directory. Once we eventually (hopefully) migrate the MCA library components into llvm the include directives used by the non-library source files will be updated to point to the proper location in llvm. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb Subscribers: mgorny, javed.absar, tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D50929 llvm-svn: 340755
Diffstat (limited to 'llvm/tools/llvm-mca/Support.h')
-rw-r--r--llvm/tools/llvm-mca/Support.h58
1 files changed, 0 insertions, 58 deletions
diff --git a/llvm/tools/llvm-mca/Support.h b/llvm/tools/llvm-mca/Support.h
deleted file mode 100644
index fd8d8b5a23b..00000000000
--- a/llvm/tools/llvm-mca/Support.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//===--------------------- Support.h ----------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-/// \file
-///
-/// Helper functions used by various pipeline components.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVM_MCA_SUPPORT_H
-#define LLVM_TOOLS_LLVM_MCA_SUPPORT_H
-
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/MC/MCSchedule.h"
-
-namespace mca {
-
-/// Populates vector Masks with processor resource masks.
-///
-/// The number of bits set in a mask depends on the processor resource type.
-/// Each processor resource mask has at least one bit set. For groups, the
-/// number of bits set in the mask is equal to the cardinality of the group plus
-/// one. Excluding the most significant bit, the remaining bits in the mask
-/// identify processor resources that are part of the group.
-///
-/// Example:
-///
-/// ResourceA -- Mask: 0b001
-/// ResourceB -- Mask: 0b010
-/// ResourceAB -- Mask: 0b100 U (ResourceA::Mask | ResourceB::Mask) == 0b111
-///
-/// ResourceAB is a processor resource group containing ResourceA and ResourceB.
-/// Each resource mask uniquely identifies a resource; both ResourceA and
-/// ResourceB only have one bit set.
-/// ResourceAB is a group; excluding the most significant bit in the mask, the
-/// remaining bits identify the composition of the group.
-///
-/// Resource masks are used by the ResourceManager to solve set membership
-/// problems with simple bit manipulation operations.
-void computeProcResourceMasks(const llvm::MCSchedModel &SM,
- llvm::SmallVectorImpl<uint64_t> &Masks);
-
-/// Compute the reciprocal block throughput from a set of processor resource
-/// cycles. The reciprocal block throughput is computed as the MAX between:
-/// - NumMicroOps / DispatchWidth
-/// - ProcResourceCycles / #ProcResourceUnits (for every consumed resource).
-double computeBlockRThroughput(const llvm::MCSchedModel &SM,
- unsigned DispatchWidth, unsigned NumMicroOps,
- llvm::ArrayRef<unsigned> ProcResourceUsage);
-} // namespace mca
-
-#endif
OpenPOWER on IntegriCloud