File tree Expand file tree Collapse file tree 5 files changed +2
-55
lines changed
test/tools/llvm-exegesis/X86 Expand file tree Collapse file tree 5 files changed +2
-55
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -71,10 +71,10 @@ class FunctionExecutorImpl : public BenchmarkRunner::FunctionExecutor {
71
71
SmallVector<StringRef, 2 > CounterNames;
72
72
StringRef (Counters).split (CounterNames, ' +' );
73
73
char *const ScratchPtr = Scratch->ptr ();
74
- const ExegesisTarget &ET = State.getExegesisTarget ();
75
74
for (auto &CounterName : CounterNames) {
76
75
CounterName = CounterName.trim ();
77
- auto CounterOrError = ET.createCounter (CounterName, State);
76
+ auto CounterOrError =
77
+ State.getExegesisTarget ().createCounter (CounterName, State);
78
78
79
79
if (!CounterOrError)
80
80
return CounterOrError.takeError ();
@@ -93,7 +93,6 @@ class FunctionExecutorImpl : public BenchmarkRunner::FunctionExecutor {
93
93
.concat (std::to_string (Reserved)));
94
94
Scratch->clear ();
95
95
{
96
- auto PS = ET.withSavedState ();
97
96
CrashRecoveryContext CRC;
98
97
CrashRecoveryContext::Enable ();
99
98
const bool Crashed = !CRC.RunSafely ([this , Counter, ScratchPtr]() {
@@ -102,7 +101,6 @@ class FunctionExecutorImpl : public BenchmarkRunner::FunctionExecutor {
102
101
Counter->stop ();
103
102
});
104
103
CrashRecoveryContext::Disable ();
105
- PS.reset ();
106
104
if (Crashed) {
107
105
std::string Msg = " snippet crashed while running" ;
108
106
#ifdef LLVM_ON_UNIX
Original file line number Diff line number Diff line change @@ -147,8 +147,6 @@ const PfmCountersInfo &ExegesisTarget::getPfmCounters(StringRef CpuName) const {
147
147
return *Found->PCI ;
148
148
}
149
149
150
- ExegesisTarget::SavedState::~SavedState () {} // anchor.
151
-
152
150
namespace {
153
151
154
152
// Default implementation.
Original file line number Diff line number Diff line change @@ -172,16 +172,6 @@ class ExegesisTarget {
172
172
// counters are defined for this CPU).
173
173
const PfmCountersInfo &getPfmCounters (StringRef CpuName) const ;
174
174
175
- // Saves the CPU state that needs to be preserved when running a benchmark,
176
- // and returns and RAII object that restores the state on destruction.
177
- // By default no state is preserved.
178
- struct SavedState {
179
- virtual ~SavedState ();
180
- };
181
- virtual std::unique_ptr<SavedState> withSavedState () const {
182
- return std::make_unique<SavedState>();
183
- }
184
-
185
175
private:
186
176
virtual bool matchesArch (Triple::ArchType Arch) const = 0;
187
177
Original file line number Diff line number Diff line change 26
26
#include < memory>
27
27
#include < string>
28
28
#include < vector>
29
- #if defined(_MSC_VER)
30
- #include < immintrin.h>
31
- #endif
32
29
33
30
namespace llvm {
34
31
namespace exegesis {
@@ -597,32 +594,6 @@ void ConstantInliner::initStack(unsigned Bytes) {
597
594
598
595
namespace {
599
596
600
- class X86SavedState : public ExegesisTarget ::SavedState {
601
- public:
602
- X86SavedState () {
603
- #if defined(_MSC_VER)
604
- _fxsave64 (FPState);
605
- #elif defined(__GNUC__)
606
- __builtin_ia32_fxsave64 (FPState);
607
- #endif
608
- }
609
-
610
- ~X86SavedState () {
611
- // Restoring the X87 state does not flush pending exceptions, make sure
612
- // these exceptions are flushed now.
613
- #if defined(_MSC_VER)
614
- _clearfp ();
615
- _fxrstor64 (FPState);
616
- #elif defined(__GNUC__)
617
- asm volatile (" fwait" );
618
- __builtin_ia32_fxrstor64 (FPState);
619
- #endif
620
- }
621
-
622
- private:
623
- alignas (16 ) char FPState[512 ];
624
- };
625
-
626
597
class ExegesisX86Target : public ExegesisTarget {
627
598
public:
628
599
ExegesisX86Target () : ExegesisTarget(X86CpuPfmCounters) {}
@@ -720,10 +691,6 @@ class ExegesisX86Target : public ExegesisTarget {
720
691
#endif
721
692
}
722
693
723
- std::unique_ptr<SavedState> withSavedState () const override {
724
- return std::make_unique<X86SavedState>();
725
- }
726
-
727
694
static const unsigned kUnavailableRegisters [4 ];
728
695
};
729
696
You can’t perform that action at this time.
0 commit comments