mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
[llvm-exegesis][NFC] clang-format
llvm-svn: 335452
This commit is contained in:
parent
a32d0bc533
commit
30b11759a0
@ -91,22 +91,22 @@ BenchmarkRunner::runOne(const BenchmarkConfiguration &Configuration,
|
||||
// that the inside instructions are repeated.
|
||||
constexpr const int kMinInstructionsForSnippet = 16;
|
||||
{
|
||||
auto ObjectFilePath = writeObjectFile(
|
||||
GenerateInstructions(kMinInstructionsForSnippet));
|
||||
auto ObjectFilePath =
|
||||
writeObjectFile(GenerateInstructions(kMinInstructionsForSnippet));
|
||||
if (llvm::Error E = ObjectFilePath.takeError()) {
|
||||
InstrBenchmark.Error = llvm::toString(std::move(E));
|
||||
return InstrBenchmark;
|
||||
}
|
||||
const ExecutableFunction EF(State.createTargetMachine(),
|
||||
getObjectFromFile(*ObjectFilePath));
|
||||
getObjectFromFile(*ObjectFilePath));
|
||||
const auto FnBytes = EF.getFunctionBytes();
|
||||
InstrBenchmark.AssembledSnippet.assign(FnBytes.begin(), FnBytes.end());
|
||||
}
|
||||
|
||||
// Assemble NumRepetitions instructions repetitions of the snippet for
|
||||
// measurements.
|
||||
auto ObjectFilePath = writeObjectFile(
|
||||
GenerateInstructions(InstrBenchmark.NumRepetitions));
|
||||
auto ObjectFilePath =
|
||||
writeObjectFile(GenerateInstructions(InstrBenchmark.NumRepetitions));
|
||||
if (llvm::Error E = ObjectFilePath.takeError()) {
|
||||
InstrBenchmark.Error = llvm::toString(std::move(E));
|
||||
return InstrBenchmark;
|
||||
@ -114,7 +114,7 @@ BenchmarkRunner::runOne(const BenchmarkConfiguration &Configuration,
|
||||
llvm::outs() << "Check generated assembly with: /usr/bin/objdump -d "
|
||||
<< *ObjectFilePath << "\n";
|
||||
const ExecutableFunction EF(State.createTargetMachine(),
|
||||
getObjectFromFile(*ObjectFilePath));
|
||||
getObjectFromFile(*ObjectFilePath));
|
||||
InstrBenchmark.Measurements = runMeasurements(EF, NumRepetitions);
|
||||
|
||||
return InstrBenchmark;
|
||||
|
@ -86,8 +86,7 @@ Instruction::Instruction(const llvm::MCInstrDesc &MCInstrDesc,
|
||||
InstructionInstance::InstructionInstance(const Instruction &Instr)
|
||||
: Instr(Instr), VariableValues(Instr.Variables.size()) {}
|
||||
|
||||
InstructionInstance::InstructionInstance(InstructionInstance &&) =
|
||||
default;
|
||||
InstructionInstance::InstructionInstance(InstructionInstance &&) = default;
|
||||
|
||||
InstructionInstance &InstructionInstance::
|
||||
operator=(InstructionInstance &&) = default;
|
||||
@ -135,8 +134,7 @@ llvm::MCInst InstructionInstance::randomizeUnsetVariablesAndBuild() {
|
||||
|
||||
SnippetPrototype::SnippetPrototype(SnippetPrototype &&) = default;
|
||||
|
||||
SnippetPrototype &SnippetPrototype::
|
||||
operator=(SnippetPrototype &&) = default;
|
||||
SnippetPrototype &SnippetPrototype::operator=(SnippetPrototype &&) = default;
|
||||
|
||||
bool RegisterOperandAssignment::
|
||||
operator==(const RegisterOperandAssignment &Other) const {
|
||||
|
@ -10,19 +10,19 @@
|
||||
|
||||
namespace exegesis {
|
||||
|
||||
ExegesisTarget::~ExegesisTarget() {} // anchor.
|
||||
ExegesisTarget::~ExegesisTarget() {} // anchor.
|
||||
|
||||
static ExegesisTarget* FirstTarget = nullptr;
|
||||
static ExegesisTarget *FirstTarget = nullptr;
|
||||
|
||||
const ExegesisTarget *ExegesisTarget::lookup(llvm::Triple TT) {
|
||||
for (const ExegesisTarget* T = FirstTarget; T != nullptr; T = T->Next) {
|
||||
for (const ExegesisTarget *T = FirstTarget; T != nullptr; T = T->Next) {
|
||||
if (T->matchesArch(TT.getArch()))
|
||||
return T;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ExegesisTarget::registerTarget(ExegesisTarget *Target){
|
||||
void ExegesisTarget::registerTarget(ExegesisTarget *Target) {
|
||||
if (FirstTarget == nullptr) {
|
||||
FirstTarget = Target;
|
||||
return;
|
||||
@ -33,4 +33,4 @@ void ExegesisTarget::registerTarget(ExegesisTarget *Target){
|
||||
Target->Next = FirstTarget;
|
||||
FirstTarget = Target;
|
||||
}
|
||||
} // namespace exegesis
|
||||
} // namespace exegesis
|
||||
|
@ -38,9 +38,9 @@ public:
|
||||
|
||||
private:
|
||||
virtual bool matchesArch(llvm::Triple::ArchType Arch) const = 0;
|
||||
const ExegesisTarget* Next = nullptr;
|
||||
const ExegesisTarget *Next = nullptr;
|
||||
};
|
||||
|
||||
} // namespace exegesis
|
||||
} // namespace exegesis
|
||||
|
||||
#endif // LLVM_TOOLS_LLVM_EXEGESIS_TARGET_H
|
||||
|
@ -97,7 +97,8 @@ UopsBenchmarkRunner::isInfeasible(const llvm::MCInstrDesc &MCInstrDesc) const {
|
||||
return llvm::make_error<BenchmarkFailure>(
|
||||
"Infeasible : has unknown operands");
|
||||
if (llvm::any_of(MCInstrDesc.operands(), hasMemoryOperand))
|
||||
return llvm::make_error<BenchmarkFailure>("Infeasible : has memory operands");
|
||||
return llvm::make_error<BenchmarkFailure>(
|
||||
"Infeasible : has memory operands");
|
||||
return llvm::Error::success();
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ class ExegesisX86Target : public ExegesisTarget {
|
||||
|
||||
} // namespace
|
||||
|
||||
static ExegesisTarget* getTheExegesisX86Target() {
|
||||
static ExegesisTarget *getTheExegesisX86Target() {
|
||||
static ExegesisX86Target Target;
|
||||
return &Target;
|
||||
}
|
||||
@ -38,4 +38,4 @@ void InitializeX86ExegesisTarget() {
|
||||
ExegesisTarget::registerTarget(getTheExegesisX86Target());
|
||||
}
|
||||
|
||||
} // namespace exegesis
|
||||
} // namespace exegesis
|
||||
|
Loading…
Reference in New Issue
Block a user