diff --git a/llvm-12.0.0rc3.src/utils/benchmark/src/cycleclock.h.orig b/llvm-12.0.0rc3.src/utils/benchmark/src/cycleclock.h --- a/llvm-12.0.0rc3.src/utils/benchmark/src/cycleclock.h.orig +++ b/llvm-12.0.0rc3.src/utils/benchmark/src/cycleclock.h @@ -161,12 +161,6 @@ struct timeval tv; gettimeofday(&tv, nullptr); return static_cast(tv.tv_sec) * 1000000 + tv.tv_usec; -#elif defined(__mips__) || defined(__m68k__) - // mips apparently only allows rdtsc for superusers, so we fall - // back to gettimeofday. It's possible clock_gettime would be better. - struct timeval tv; - gettimeofday(&tv, nullptr); - return static_cast(tv.tv_sec) * 1000000 + tv.tv_usec; #elif defined(__s390__) // Covers both s390 and s390x. // Return the CPU clock. uint64_t tsc; @@ -194,10 +188,14 @@ return cycles; #endif #else -// The soft failover to a generic implementation is automatic only for ARM. -// For other platforms the developer is expected to make an attempt to create -// a fast implementation and use generic version if nothing better is available. -#error You need to define CycleTimer for your OS and CPU + // The soft failover to a generic implementation is automatic only for ARM. + // For other platforms the developer is expected to make an attempt to create + // a fast implementation and use generic version if nothing better is available. + // MIPS apparently only allows rdtsc for superusers, so for it and other + // fall back to gettimeofday. It's possible clock_gettime would be better. + struct timeval tv; + gettimeofday(&tv, nullptr); + return static_cast(tv.tv_sec) * 1000000 + tv.tv_usec; #endif } } // end namespace cycleclock