[llvm] [llvm-exegesis] Add loop-register snippet annotation (PR #82873)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 01:17:41 PST 2024


================
@@ -509,22 +509,42 @@ void benchmarkMain() {
   }
 
   const auto Opcodes = getOpcodesOrDie(State);
+  std::vector<BenchmarkCode> Configurations;
+
+  unsigned LoopRegister =
+      State.getExegesisTarget().getDefaultLoopCounterRegister(
+          State.getTargetMachine().getTargetTriple());
+
+  if (Opcodes.empty()) {
----------------
boomanaiden154 wrote:

With the new setup, each call to `SnippetRepetitor::Create` needs to have the loop register, but `generateSnippets` relies on `SnippetRepetitor::getReservedRegs`, so I've moved the snippet setup code above so we can get the loop register to initialize the loop register for creating the repetitor and left the snippet generation code below so that everything is defined before it is used.

https://github.com/llvm/llvm-project/pull/82873


More information about the llvm-commits mailing list