-
Notifications
You must be signed in to change notification settings - Fork 0
Merge preview/rvv-exegesis with main (dirty change history) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: merge/rvv-exegesis
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conflicts that are obvious for the first review iteration
// MERGEME: useful operator? | ||
//bool operator==(const BenchmarkKey &RHS) const { | ||
// return Config == RHS.Config && | ||
// Instructions[0].getOpcode() == RHS.Instructions[0].getOpcode(); | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MERGEME
bool DryRun = DryRunMeasurement; | ||
auto PS = ET.withSavedState(); | ||
CrashRecoveryContext CRC; | ||
CrashRecoveryContext::Enable(); | ||
const bool Crashed = !CRC.RunSafely([this, Counter, ScratchPtr]() { | ||
Counter->start(); | ||
this->Function(ScratchPtr); | ||
Counter->stop(); | ||
}); | ||
const bool Crashed = | ||
!CRC.RunSafely([this, Counter, ScratchPtr, DryRun]() { | ||
Counter->start(); | ||
if (!DryRun) | ||
this->Function(ScratchPtr); | ||
Counter->stop(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does DryRunMeasurement supported?
Benchmark BenchmarkResult; | ||
object::OwningBinary<object::ObjectFile> ObjectFile; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert. It should remain private
#else | ||
void ConfiguredEvent::initRealEvent(pid_t ProcessID, const int GroupFD) {} | ||
|
||
Expected<SmallVector<int64_t>> | ||
ConfiguredEvent::readOrError(StringRef /*unused*/) const { | ||
return make_error<StringError>("Not implemented", | ||
errc::function_not_supported); | ||
} | ||
|
||
ConfiguredEvent::~ConfiguredEvent() = default; | ||
#endif // HAVE_LIBPFM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really require LIBPFM?
#else | ||
|
||
void CounterGroup::initRealEvent(pid_t ProcessID) {} | ||
|
||
void CounterGroup::start() {} | ||
|
||
void CounterGroup::stop() {} | ||
|
||
Expected<SmallVector<int64_t, 4>> | ||
CounterGroup::readOrError(StringRef /*unused*/) const { | ||
if (IsDummyEvent) { | ||
SmallVector<int64_t, 4> Result; | ||
Result.push_back(42); | ||
return Result; | ||
} | ||
return make_error<StringError>("Not implemented", errc::io_error); | ||
} | ||
|
||
Expected<SmallVector<int64_t>> | ||
CounterGroup::readValidationCountersOrError() const { | ||
return SmallVector<int64_t>(0); | ||
} | ||
|
||
int CounterGroup::numValues() const { return 1; } | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really require LIBPFM?
static cl::opt<int> OpcodeIndex( | ||
"opcode-index", | ||
cl::desc("opcode to measure, by index, or -1 to measure all opcodes"), | ||
cl::cat(BenchmarkOptions), cl::init(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert. Use modern option instead same OpcodeIndices
static cl::opt<std::string> | ||
InputFile(cl::Positional, | ||
cl::desc("Input benchmarks file to resume or snippet file"), | ||
cl::init("-"), cl::cat(Options)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert as there is modern benchmarks-file
option
static cl::opt<BenchmarkPhaseSelectorE> BenchmarkPhaseSelector( | ||
"benchmark-phase", | ||
cl::desc( | ||
"it is possible to stop the benchmarking process after some phase"), | ||
cl::cat(BenchmarkOptions), | ||
cl::values( | ||
clEnumValN(BenchmarkPhaseSelectorE::PrepareSnippet, "prepare-snippet", | ||
"Only generate the minimal instruction sequence"), | ||
clEnumValN(BenchmarkPhaseSelectorE::PrepareAndAssembleSnippet, | ||
"prepare-and-assemble-snippet", | ||
"Same as prepare-snippet, but also dumps an excerpt of the " | ||
"sequence (hex encoded)"), | ||
clEnumValN(BenchmarkPhaseSelectorE::AssembleMeasuredCode, | ||
"assemble-measured-code", | ||
"Same as prepare-and-assemble-snippet, but also creates the " | ||
"full sequence " | ||
"that can be dumped to a file using --dump-object-to-disk"), | ||
clEnumValN( | ||
BenchmarkPhaseSelectorE::Measure, "measure", | ||
"Same as prepare-measured-code, but also runs the measurement " | ||
"(default)")), | ||
cl::init(BenchmarkPhaseSelectorE::Measure)); | ||
static const auto BenchmarkPhasesOptValues = cl::values( | ||
clEnumValN(BenchmarkPhaseSelectorE::PrepareSnippet, "prepare-snippet", | ||
"Only generate the minimal instruction sequence"), | ||
clEnumValN(BenchmarkPhaseSelectorE::PrepareAndAssembleSnippet, | ||
"prepare-and-assemble-snippet", | ||
"Same as prepare-snippet, but also dumps an excerpt of the " | ||
"sequence (hex encoded)"), | ||
clEnumValN(BenchmarkPhaseSelectorE::AssembleMeasuredCode, | ||
"assemble-measured-code", | ||
"Same as prepare-and-assemble-snippet, but also creates the " | ||
"full sequence " | ||
"that can be dumped to a file using --dump-object-to-disk"), | ||
clEnumValN(BenchmarkPhaseSelectorE::Measure, "measure", | ||
"Same as prepare-measured-code, but also runs the measurement " | ||
"(default)")); | ||
|
||
static cl::opt<BenchmarkPhaseSelectorE> | ||
StopAfter("stop-after-phase", | ||
cl::desc("Stop the benchmarking process after some phase"), | ||
cl::cat(BenchmarkOptions), BenchmarkPhasesOptValues, | ||
cl::init(BenchmarkPhaseSelectorE::Measure)); | ||
|
||
static cl::alias BenchmarkPhaseSelector("benchmark-phase", | ||
cl::desc("Alias of -stop-after-phase"), | ||
cl::aliasopt(StopAfter)); | ||
|
||
static cl::opt<BenchmarkPhaseSelectorE> StartBefore( | ||
"start-before-phase", | ||
cl::desc("Resume the benchmarking process before a certain phase"), | ||
cl::cat(BenchmarkOptions), BenchmarkPhasesOptValues, | ||
cl::init(BenchmarkPhaseSelectorE::PrepareSnippet)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carefully resolve diff: refactored options structure in modern version
// MERGEME: eliminated code in main. | ||
//std::vector<BenchmarkRunner::RunnableConfiguration> RunnableConfigs; | ||
//SmallVector<unsigned> Repetitions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MERGEME: does exegesis support repetitions? RunnableConfigs looks like a legacy
if (BenchmarkPhaseSelector == BenchmarkPhaseSelectorE::Measure && | ||
!UseDummyPerfCounters) { | ||
#ifndef HAVE_LIBPFM | ||
ExitWithError( | ||
"benchmarking unavailable, LLVM was built without libpfm. You can " | ||
"pass --benchmark-phase=... to skip the actual benchmarking or " | ||
"--use-dummy-perf-counters to not query the kernel for real event " | ||
"counts."); | ||
#else | ||
if (StopAfter == BenchmarkPhaseSelectorE::Measure && !UseDummyPerfCounters) { | ||
#ifdef HAVE_LIBPFM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
40aa183
to
147aba3
Compare
b648ecd
to
16168af
Compare
Nasty process of merging 2 commits (llvm#114149) onto main (dirty branch yet). With a purpose to control made changes, there are
merge.diff
in the root and log of changed files instatus_merge.txt
.// MERGEME:
comments when it should recheck changes.llvm/lib/RISCV/Target.cpp
contains tidy merge conflicts to be solved in future commits.Implementation details