diff options
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/SnippetGenerator.h')
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/SnippetGenerator.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/SnippetGenerator.h b/llvm/tools/llvm-exegesis/lib/SnippetGenerator.h index 8e8cd6fcb99..70f81f942be 100644 --- a/llvm/tools/llvm-exegesis/lib/SnippetGenerator.h +++ b/llvm/tools/llvm-exegesis/lib/SnippetGenerator.h @@ -33,19 +33,18 @@ namespace exegesis { std::vector<CodeTemplate> getSingleton(CodeTemplate &&CT); // Generates code templates that has a self-dependency. -llvm::Expected<std::vector<CodeTemplate>> +Expected<std::vector<CodeTemplate>> generateSelfAliasingCodeTemplates(const Instruction &Instr); // Generates code templates without assignment constraints. -llvm::Expected<std::vector<CodeTemplate>> -generateUnconstrainedCodeTemplates(const Instruction &Instr, - llvm::StringRef Msg); +Expected<std::vector<CodeTemplate>> +generateUnconstrainedCodeTemplates(const Instruction &Instr, StringRef Msg); // A class representing failures that happened during Benchmark, they are used // to report informations to the user. -class SnippetGeneratorFailure : public llvm::StringError { +class SnippetGeneratorFailure : public StringError { public: - SnippetGeneratorFailure(const llvm::Twine &S); + SnippetGeneratorFailure(const Twine &S); }; // Common code for all benchmark modes. @@ -60,9 +59,9 @@ public: virtual ~SnippetGenerator(); // Calls generateCodeTemplate and expands it into one or more BenchmarkCode. - llvm::Expected<std::vector<BenchmarkCode>> + Expected<std::vector<BenchmarkCode>> generateConfigurations(const Instruction &Instr, - const llvm::BitVector &ExtraForbiddenRegs) const; + const BitVector &ExtraForbiddenRegs) const; // Given a snippet, computes which registers the setup code needs to define. std::vector<RegisterValue> computeRegisterInitialValues( @@ -74,7 +73,7 @@ protected: private: // API to be implemented by subclasses. - virtual llvm::Expected<std::vector<CodeTemplate>> + virtual Expected<std::vector<CodeTemplate>> generateCodeTemplates(const Instruction &Instr, const BitVector &ForbiddenRegisters) const = 0; }; @@ -89,7 +88,7 @@ size_t randomIndex(size_t Max); // Picks a random bit among the bits set in Vector and returns its index. // Precondition: Vector must have at least one bit set. -size_t randomBit(const llvm::BitVector &Vector); +size_t randomBit(const BitVector &Vector); // Picks a random configuration, then selects a random def and a random use from // it and finally set the selected values in the provided InstructionInstances. @@ -99,7 +98,7 @@ void setRandomAliasing(const AliasingConfigurations &AliasingConfigurations, // Assigns a Random Value to all Variables in IT that are still Invalid. // Do not use any of the registers in `ForbiddenRegs`. void randomizeUnsetVariables(const ExegesisTarget &Target, - const llvm::BitVector &ForbiddenRegs, + const BitVector &ForbiddenRegs, InstructionTemplate &IT); } // namespace exegesis |