diff options
author | Aiden Grossman <agrossman154@yahoo.com> | 2023-11-29 02:06:13 -0800 |
---|---|---|
committer | Aiden Grossman <agrossman154@yahoo.com> | 2023-11-29 02:06:13 -0800 |
commit | 52b4b357268ac114f7972e37da1e5954f322df09 (patch) | |
tree | f37df18e7200f58bf828526aaea5cfe362703b8f | |
parent | 85c9c16895082dfaee3e8440440c83ba9b436da0 (diff) | |
download | llvm-52b4b357268ac114f7972e37da1e5954f322df09.zip llvm-52b4b357268ac114f7972e37da1e5954f322df09.tar.gz llvm-52b4b357268ac114f7972e37da1e5954f322df09.tar.bz2 |
Revert "[llvm-exegesis] Set stack pointer register after starting perf counter (#72489)"
This reverts commit 9eb80ab3787e1851be8c686651688e870b93506b.
This is causing failures on multiple builders. Pulling it out until I
have time to fix it.
-rw-r--r-- | llvm/test/tools/llvm-exegesis/X86/latency/subprocess-rsp.s | 18 | ||||
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/Assembler.cpp | 23 |
2 files changed, 0 insertions, 41 deletions
diff --git a/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-rsp.s b/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-rsp.s deleted file mode 100644 index 63274c4..0000000 --- a/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-rsp.s +++ /dev/null @@ -1,18 +0,0 @@ -# REQUIRES: exegesis-can-execute-x86_64 - -# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=%s -execution-mode=subprocess | FileCheck %s - -# Check that we can set the value of RSP in subprocess mode without -# segfaulting as we need to restore it after the rest of the setup is -# complete to prevent loading from the stack where we set it instead -# of where the stack actuall is. - -# LLVM-EXEGESIS-MEM-DEF test1 4096 2147483647 -# LLVM-EXEGESIS-MEM-MAP test1 1048576 -# LLVM-EXEGESIS-DEFREG RAX 100000 -# LLVM-EXEGESIS-DEFREG R14 100000 -# LLVM-EXEGESIS-DEFREG RSP 100000 - -movq %r14, (%rax) - -# CHECK-NOT: error: 'The benchmarking subprocess sent unexpected signal: Segmentation fault' diff --git a/llvm/tools/llvm-exegesis/lib/Assembler.cpp b/llvm/tools/llvm-exegesis/lib/Assembler.cpp index e17d239..e64f4e6 100644 --- a/llvm/tools/llvm-exegesis/lib/Assembler.cpp +++ b/llvm/tools/llvm-exegesis/lib/Assembler.cpp @@ -19,7 +19,6 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/TargetInstrInfo.h" -#include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/ExecutionEngine/Orc/LLJIT.h" @@ -61,17 +60,7 @@ static bool generateSnippetSetupCode( } BBF.addInstructions(ET.setStackRegisterToAuxMem()); } - Register StackPointerRegister = BBF.MF.getSubtarget() - .getTargetLowering() - ->getStackPointerRegisterToSaveRestore(); for (const RegisterValue &RV : RegisterInitialValues) { - if (GenerateMemoryInstructions) { - // If we're generating memory instructions, don't load in the value for - // the register with the stack pointer as it will be used later to finish - // the setup. - if (RV.Register == StackPointerRegister) - continue; - } // Load a constant in the register. const auto SetRegisterCode = ET.setRegTo(*MSI, RV.Register, RV.Value); if (SetRegisterCode.empty()) @@ -82,18 +71,6 @@ static bool generateSnippetSetupCode( #ifdef HAVE_LIBPFM BBF.addInstructions(ET.configurePerfCounter(PERF_EVENT_IOC_RESET, true)); #endif // HAVE_LIBPFM - for (const RegisterValue &RV : RegisterInitialValues) { - // Load in the stack register now as we're done using it elsewhere - // and need to set the value in preparation for executing the - // snippet. - if (RV.Register == StackPointerRegister) - continue; - const auto SetRegisterCode = ET.setRegTo(*MSI, RV.Register, RV.Value); - if (SetRegisterCode.empty()) - IsSnippetSetupComplete = false; - BBF.addInstructions(SetRegisterCode); - break; - } } return IsSnippetSetupComplete; } |