aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-mca/llvm-mca.cpp
diff options
context:
space:
mode:
authorPatrick Holland <patrickeholland@gmail.com>2022-01-02 16:37:14 -0800
committerPatrick Holland <patrickeholland@gmail.com>2022-01-11 13:50:14 -0800
commit85e6e748d426f8992016914b07bc67c4da22e278 (patch)
tree34736b61f2368ef6af9e0a7b7972d9b149151fb7 /llvm/tools/llvm-mca/llvm-mca.cpp
parente7cb716ef95551000d9de2d0334ab1bf84a120a3 (diff)
downloadllvm-85e6e748d426f8992016914b07bc67c4da22e278.zip
llvm-85e6e748d426f8992016914b07bc67c4da22e278.tar.gz
llvm-85e6e748d426f8992016914b07bc67c4da22e278.tar.bz2
[MCA] Switching from conservatively guessing which instructions are
memory-barrier instructions to providing targets and developers a convenient way to explicitly declare which instructions are memory-barriers. Differential Revision: https://reviews.llvm.org/D116779
Diffstat (limited to 'llvm/tools/llvm-mca/llvm-mca.cpp')
-rw-r--r--llvm/tools/llvm-mca/llvm-mca.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index 0501336..1826491 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -219,6 +219,11 @@ static cl::opt<bool> ShowEncoding(
cl::desc("Print encoding information in the instruction info view"),
cl::cat(ViewOptions), cl::init(false));
+static cl::opt<bool> ShowBarriers(
+ "show-barriers",
+ cl::desc("Print memory barrier information in the instruction info view"),
+ cl::cat(ViewOptions), cl::init(false));
+
static cl::opt<bool> DisableCustomBehaviour(
"disable-cb",
cl::desc(
@@ -504,7 +509,7 @@ int main(int argc, char **argv) {
// (which does nothing).
IPP = std::make_unique<mca::InstrPostProcess>(*STI, *MCII);
- std::vector<std::unique_ptr<mca::Instruction>> LoweredSequence;
+ SmallVector<std::unique_ptr<mca::Instruction>> LoweredSequence;
for (const MCInst &MCI : Insts) {
Expected<std::unique_ptr<mca::Instruction>> Inst =
IB.createInstruction(MCI);
@@ -548,7 +553,8 @@ int main(int argc, char **argv) {
// Create the views for this pipeline, execute, and emit a report.
if (PrintInstructionInfoView) {
Printer.addView(std::make_unique<mca::InstructionInfoView>(
- *STI, *MCII, CE, ShowEncoding, Insts, *IP));
+ *STI, *MCII, CE, ShowEncoding, Insts, *IP, LoweredSequence,
+ ShowBarriers));
}
Printer.addView(
std::make_unique<mca::ResourcePressureView>(*STI, *IP, Insts));
@@ -624,7 +630,8 @@ int main(int argc, char **argv) {
if (PrintInstructionInfoView)
Printer.addView(std::make_unique<mca::InstructionInfoView>(
- *STI, *MCII, CE, ShowEncoding, Insts, *IP));
+ *STI, *MCII, CE, ShowEncoding, Insts, *IP, LoweredSequence,
+ ShowBarriers));
// Fetch custom Views that are to be placed after the InstructionInfoView.
// Refer to the comment paired with the CB->getStartViews(*IP, Insts); line