This is an archive of the discontinued LLVM Phabricator instance.

Fix util/benchmark build or less mainstream architectures, like Alpha, HPPA, IA64, ...
Needs ReviewPublic

Authored by rener on Mar 11 2021, 7:28 AM.
This revision needs review, but all reviewers have resigned.

Details

Reviewers
lebedev.ri
Summary

Currently utils/benchmark/src/cycleclock.h timing defines error out for unsupported architectures. However, some Linux distributions like T2 (https://t2sde.org) still somewhat support, and even cross compile Alpha, HPPA, IA64, Motorola 68k, and llvm is needed for Mesa 3d, BPF, etc.

Simply fix the build by moving the MIPS gettimeofday fallback to the last else case to fix building for most non mainstream architecture where the C++ codebase otherwise just compiles fine, too ;-)

Diff Detail

Event Timeline

rener created this revision.Mar 11 2021, 7:28 AM
rener requested review of this revision.Mar 11 2021, 7:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2021, 7:28 AM

Wouldn't clock_gettime(CLOCK_MONOTONIC) make more sense here?

Or of course __builtin_readcyclecounter() for supported architectures, but it appears to be a no-op for MIPS that always returns zero.

lebedev.ri requested changes to this revision.Mar 11 2021, 8:21 AM

Why not just disable building of benchmarks then?
I'm not sure silently producing guesstimates are a good choice here.
If disabling benchmark building is not an option for some reason,
i'd suggest to provide patches to add support for each of the arches in question.

This revision now requires changes to proceed.Mar 11 2021, 8:21 AM
rener added a comment.Mar 11 2021, 8:34 AM

Why not just disable building of benchmarks then?
I'm not sure silently producing guesstimates are a good choice here.
If disabling benchmark building is not an option for some reason,
i'd suggest to provide patches to add support for each of the arches in question.

Well the fallback is already there, and silently used for older 32-bit ARM as well as MIPS. I'm just moving it to avoid build errors, so using that for the time being sounds good enough to me for the time being on this non primary support architectures, ...

lebedev.ri resigned from this revision.Jan 12 2023, 4:50 PM

This review seems to be stuck/dead, consider abandoning if no longer relevant.

This revision now requires review to proceed.Jan 12 2023, 4:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 4:50 PM
Herald added a subscriber: StephenFan. · View Herald Transcript