summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-11-09 13:15:32 +0000
committerClement Courbet <courbet@google.com>2018-11-09 13:15:32 +0000
commiteee2e06e2aa0fc13aae9db5d0149c21005c41961 (patch)
tree87d95dcef8fc33dc000729fe1894b0f4d5e5de3f /llvm/unittests
parent72ccf00b1743f8c81f12b36156079e16f4c09893 (diff)
downloadbcm5719-llvm-eee2e06e2aa0fc13aae9db5d0149c21005c41961.tar.gz
bcm5719-llvm-eee2e06e2aa0fc13aae9db5d0149c21005c41961.zip
[llvm-exegesis][NFC] Add a way to declare the default counter binding for unbound CPUs for a target.
Summary: This simplifies the code and moves everything to tablegen for consistency. This also prepares the ground for adding issue counters. Reviewers: gchatelet, john.brawn, jsji Subscribers: nemanjai, mgorny, javed.absar, kbarton, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D54297 llvm-svn: 346489
Diffstat (limited to 'llvm/unittests')
-rw-r--r--llvm/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp6
-rw-r--r--llvm/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp b/llvm/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
index 8a519bb2e7b..a938db04a48 100644
--- a/llvm/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
@@ -59,6 +59,12 @@ TEST_F(AArch64TargetTest, SetRegToConstant) {
EXPECT_THAT(Insts, Not(IsEmpty()));
}
+TEST_F(AArch64TargetTest, DefaultPfmCounters) {
+ EXPECT_EQ(ExegesisTarget_->getPfmCounters("").CycleCounter, "CPU_CYCLES");
+ EXPECT_EQ(ExegesisTarget_->getPfmCounters("unknown_cpu").CycleCounter,
+ "CPU_CYCLES");
+}
+
} // namespace
} // namespace exegesis
} // namespace llvm
diff --git a/llvm/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp b/llvm/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp
index e9f6a55af57..f78c141f871 100644
--- a/llvm/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp
@@ -59,6 +59,12 @@ TEST_F(PowerPCTargetTest, SetRegToConstant) {
EXPECT_THAT(Insts, Not(IsEmpty()));
}
+TEST_F(PowerPCTargetTest, DefaultPfmCounters) {
+ EXPECT_EQ(ExegesisTarget_->getPfmCounters("").CycleCounter, "CYCLES");
+ EXPECT_EQ(ExegesisTarget_->getPfmCounters("unknown_cpu").CycleCounter,
+ "CYCLES");
+}
+
} // namespace
} // namespace exegesis
} // namespace llvm
OpenPOWER on IntegriCloud