diff options
| author | Clement Courbet <courbet@google.com> | 2018-11-09 13:15:32 +0000 |
|---|---|---|
| committer | Clement Courbet <courbet@google.com> | 2018-11-09 13:15:32 +0000 |
| commit | eee2e06e2aa0fc13aae9db5d0149c21005c41961 (patch) | |
| tree | 87d95dcef8fc33dc000729fe1894b0f4d5e5de3f /llvm/unittests | |
| parent | 72ccf00b1743f8c81f12b36156079e16f4c09893 (diff) | |
| download | bcm5719-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.cpp | 6 | ||||
| -rw-r--r-- | llvm/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp | 6 |
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 |

