[PATCH] D151023: [llvm-exegesis] Add Target Memory Utility Functions

Aiden Grossman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 03:20:27 PDT 2023


aidengrossman added a comment.

Just added in register saving to `configurePerfCounter()` and noted that the functions may clobber registers in `Target.h`. Probably should've just done it to begin with. New changes should be ready for review.



================
Comment at: llvm/tools/llvm-exegesis/lib/X86/Target.cpp:994-1001
+  GeneratedCode.push_back(MCInstBuilder(X86::SHR64ri)
+                              .addReg(Register)
+                              .addReg(Register)
+                              .addImm(PageSizeBits));
+  GeneratedCode.push_back(MCInstBuilder(X86::SHL64ri)
+                              .addReg(Register)
+                              .addReg(Register)
----------------
courbet wrote:
> Another, maybe simpler option is: `AND64ri register, -page_size`
I find the shift left/right pattern to be a little bit more intuitive since using an `AND` instruction involves understanding a bitwise "trick" when reading, but it definitely is shorter. I don't have any particularly strong feelings on this though, so if you want me to change it, just let me know.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151023/new/

https://reviews.llvm.org/D151023



More information about the llvm-commits mailing list