#include <string>
#include "Assembler.h"
#include "Error.h"
#include "MCInstrDescView.h"
#include "SnippetGenerator.h"
#include "Target.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Program.h"
namespace llvm {
namespace exegesis {
std::vector<CodeTemplate> getSingleton(CodeTemplate &&CT) { … }
SnippetGeneratorFailure::SnippetGeneratorFailure(const Twine &S)
: … { … }
SnippetGenerator::SnippetGenerator(const LLVMState &State, const Options &Opts)
: … { … }
SnippetGenerator::~SnippetGenerator() = default;
Error SnippetGenerator::generateConfigurations(
const InstructionTemplate &Variant, std::vector<BenchmarkCode> &Benchmarks,
const BitVector &ExtraForbiddenRegs) const { … }
std::vector<RegisterValue> SnippetGenerator::computeRegisterInitialValues(
const std::vector<InstructionTemplate> &Instructions) const { … }
Expected<std::vector<CodeTemplate>>
generateSelfAliasingCodeTemplates(InstructionTemplate Variant,
const BitVector &ForbiddenRegisters) { … }
Expected<std::vector<CodeTemplate>>
generateUnconstrainedCodeTemplates(const InstructionTemplate &Variant,
StringRef Msg) { … }
std::mt19937 &randomGenerator() { … }
size_t randomIndex(size_t Max) { … }
template <typename C> static decltype(auto) randomElement(const C &Container) { … }
static void setRegisterOperandValue(const RegisterOperandAssignment &ROV,
InstructionTemplate &IB) { … }
size_t randomBit(const BitVector &Vector) { … }
std::optional<int> getFirstCommonBit(const BitVector &A, const BitVector &B) { … }
void setRandomAliasing(const AliasingConfigurations &AliasingConfigurations,
InstructionTemplate &DefIB, InstructionTemplate &UseIB) { … }
static Error randomizeMCOperand(const LLVMState &State,
const Instruction &Instr, const Variable &Var,
MCOperand &AssignedValue,
const BitVector &ForbiddenRegs) { … }
Error randomizeUnsetVariables(const LLVMState &State,
const BitVector &ForbiddenRegs,
InstructionTemplate &IT) { … }
Error validateGeneratedInstruction(const LLVMState &State, const MCInst &Inst) { … }
}
}