diff options
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/Target.h')
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/Target.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/Target.h b/llvm/tools/llvm-exegesis/lib/Target.h index 4f1f2869b74..ba25b1a3388 100644 --- a/llvm/tools/llvm-exegesis/lib/Target.h +++ b/llvm/tools/llvm-exegesis/lib/Target.h @@ -22,6 +22,7 @@ #include "LlvmState.h" #include "llvm/ADT/Triple.h" #include "llvm/CodeGen/TargetPassConfig.h" +#include "llvm/IR/CallingConv.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCRegisterInfo.h" @@ -39,6 +40,27 @@ public: return {}; } + // Returns the register pointing to scratch memory, or 0 if this target does + // not support memory operands. The benchmark function uses the default + // calling convention. + virtual unsigned getScratchMemoryRegister(const llvm::Triple &) const { + return 0; + } + + // Fills memory operands with references to the address at [Reg] + Offset. + virtual void fillMemoryOperands(InstructionInstance &II, unsigned Reg, + unsigned Offset) const { + llvm_unreachable( + "fillMemoryOperands() requires getScratchMemoryRegister() > 0"); + } + + // Returns the maximum number of bytes a load/store instruction can access at + // once. This is typically the size of the largest register available on the + // processor. Note that this only used as a hint to generate independant + // load/stores to/from memory, so the exact returned value does not really + // matter as long as it's large enough. + virtual unsigned getMaxMemoryAccessSize() const { return 0; } + // Creates a benchmark runner for the given mode. std::unique_ptr<BenchmarkRunner> createBenchmarkRunner(InstructionBenchmark::ModeE Mode, |