Go to the documentation of this file.
9 #ifndef LLVM_SUPPORT_CHRONO_H
10 #define LLVM_SUPPORT_CHRONO_H
33 template <
typename D = std::chrono::nanoseconds>
34 using TimePoint = std::chrono::time_point<std::chrono::system_clock, D>;
38 using namespace std::chrono;
39 return system_clock::to_time_t(
40 time_point_cast<system_clock::time_point::duration>(TP));
46 using namespace std::chrono;
47 return time_point_cast<seconds>(system_clock::from_time_t(
T));
53 using namespace std::chrono;
54 return time_point_cast<nanoseconds>(system_clock::from_time_t(
T))
60 raw_ostream &
operator<<(raw_ostream &OS, sys::TimePoint<> TP);
77 template <
typename Period>
struct unit {
static const char value[]; };
80 template <>
struct unit<
std::ratio<3600>> {
static const char value[]; };
81 template <>
struct unit<
std::ratio<60>> {
static const char value[]; };
82 template <>
struct unit<
std::ratio<1>> {
static const char value[]; };
83 template <>
struct unit<
std::milli> {
static const char value[]; };
84 template <>
struct unit<
std::micro> {
static const char value[]; };
85 template <>
struct unit<
std::nano> {
static const char value[]; };
112 template <
typename Rep,
typename Period>
115 typedef std::chrono::duration<Rep, Period> Dur;
116 typedef std::conditional_t<std::chrono::treat_as_floating_point<Rep>::value,
120 template <
typename AsPeriod>
static InternalRep getAs(
const Dur &
D) {
121 using namespace std::chrono;
122 return duration_cast<duration<InternalRep, AsPeriod>>(
D).
count();
125 static std::pair<InternalRep, StringRef> consumeUnit(
StringRef &
Style,
127 using namespace std::chrono;
128 if (
Style.consume_front(
"ns"))
129 return {getAs<std::nano>(
D),
"ns"};
130 if (
Style.consume_front(
"us"))
131 return {getAs<std::micro>(
D),
"us"};
132 if (
Style.consume_front(
"ms"))
133 return {getAs<std::milli>(
D),
"ms"};
134 if (
Style.consume_front(
"s"))
135 return {getAs<std::ratio<1>>(
D),
"s"};
136 if (
Style.consume_front(
"m"))
137 return {getAs<std::ratio<60>>(
D),
"m"};
138 if (
Style.consume_front(
"h"))
139 return {getAs<std::ratio<3600>>(
D),
"h"};
146 if (
Style.consume_front(
"-"))
148 if (
Style.consume_front(
"+"))
150 assert(0 &&
"Unrecognised duration format");
159 bool show_unit = consumeShowUnit(
Style);
165 Stream <<
" " <<
unit;
172 #endif // LLVM_SUPPORT_CHRONO_H
This is an optimization pass for GlobalISel generic memory operations.
into xmm2 addss xmm2 xmm1 xmm3 addss xmm3 movaps xmm0 unpcklps xmm0 ret seems silly when it could just be one addps Expand libm rounding functions main should enable SSE DAZ mode and other fast SSE modes Think about doing i64 math in SSE regs on x86 This testcase should have no SSE instructions in and only one load from a constant double
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.
This class implements an extremely fast bulk output stream that can only output to a stream.
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
std::time_t toTimeT(TimePoint<> TP)
Convert a TimePoint to std::time_t.
TimePoint< std::chrono::seconds > toTimePoint(std::time_t T)
Convert a std::time_t to a TimePoint.
raw_ostream & operator<<(raw_ostream &OS, const Memory::ProtectionFlags &PF)
Debugging output for Memory::ProtectionFlags.