Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: src/IceDefs.h

Issue 610813002: Subzero: Rewrite the pass timing infrastructure. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Make the optimized overlaps() implementation actually correct Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/IceDefs.h
diff --git a/src/IceDefs.h b/src/IceDefs.h
index 4aa99e2c9fc6032a1e73274b556bcafaaa545d13..68f30c7309365507d040133055193e23317abf69 100644
--- a/src/IceDefs.h
+++ b/src/IceDefs.h
@@ -78,6 +78,8 @@ typedef uint32_t SizeT;
// numbers are used for representing Variable live ranges.
typedef int32_t InstNumberT;
+typedef uint32_t TimerIdT;
+
enum LivenessMode {
// Basic version of live-range-end calculation. Marks the last uses
// of variables based on dataflow analysis. Records the set of
@@ -103,34 +105,14 @@ enum VerboseItem {
IceV_RegOrigins = 1 << 7,
IceV_LinearScan = 1 << 8,
IceV_Frame = 1 << 9,
- IceV_Timing = 1 << 10,
- IceV_AddrOpt = 1 << 11,
+ IceV_AddrOpt = 1 << 10,
IceV_All = ~IceV_None,
- IceV_Most = IceV_All & ~(IceV_Timing | IceV_LinearScan)
+ IceV_Most = IceV_All & ~IceV_LinearScan
};
typedef uint32_t VerboseMask;
typedef llvm::raw_ostream Ostream;
-// TODO: Implement in terms of std::chrono after switching to C++11.
-class Timer {
-public:
- Timer() : Start(llvm::TimeRecord::getCurrentTime(false)) {}
- uint64_t getElapsedNs() const { return getElapsedSec() * 1000 * 1000 * 1000; }
- uint64_t getElapsedUs() const { return getElapsedSec() * 1000 * 1000; }
- uint64_t getElapsedMs() const { return getElapsedSec() * 1000; }
- double getElapsedSec() const {
- llvm::TimeRecord End = llvm::TimeRecord::getCurrentTime(false);
- return End.getWallTime() - Start.getWallTime();
- }
- void printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const;
-
-private:
- const llvm::TimeRecord Start;
- Timer(const Timer &) LLVM_DELETED_FUNCTION;
- Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION;
-};
-
} // end of namespace Ice
#endif // SUBZERO_SRC_ICEDEFS_H
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceGlobalContext.h » ('j') | src/IceOperand.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698