summaryrefslogtreecommitdiff
path: root/lib/Support/Timer.cpp
Commit message (Collapse)AuthorAge
* Kill the LLVM global lock.Zachary Turner2014-06-19
| | | | | | | | | | | | | | This patch removes the LLVM global lock, and updates all existing users of the global lock to use their own mutex. None of the existing users of the global lock were protecting code that was mutually exclusive with any of the other users of the global lock, so its purpose was not being met. Reviewed by: rnk Differential Revision: http://reviews.llvm.org/D4142 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211277 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r211066, 211067, 211068, 211069, 211070.Zachary Turner2014-06-16
| | | | | | | These were committed accidentally from the wrong branch before having a review sign-off. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211072 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill the LLVM global lock.Zachary Turner2014-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211069 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some more code out into a separate CL.Zachary Turner2014-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211067 91177308-0d34-0410-b5e6-96231b3b80d8
* Users of the llvm global mutex must now acquire it manually.Zachary Turner2014-06-16
| | | | | | This allows the mutex to be acquired in a guarded, RAII fashion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211066 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Remove support for runtime multi-threading."Zachary Turner2014-06-10
| | | | | | This reverts revision r210600. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210603 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for runtime multi-threading.Zachary Turner2014-06-10
| | | | | | | | | | | | | | | | | | | | | This patch removes the functions llvm_start_multithreaded() and llvm_stop_multithreaded(), and changes llvm_is_multithreaded() to return a constant value based on the value of the compile-time definition LLVM_ENABLE_THREADS. Previously, it was possible to have compile-time support for threads on, and runtime support for threads off, in which case certain mutexes were not allocated or ever acquired. Now, if the build is created with threads enabled, mutexes are always acquired. A test before/after patch of compiling a very large TU showed no noticeable performance impact of this change. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D4076 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210600 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-29
| | | | | | necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207593 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-15
| | | | | | instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206252 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace some comparisons with 'nullptr' with simple boolean checks ↵Craig Topper2014-04-09
| | | | | | to reduce verbosity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205829 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205697 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-06
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[C++11] Replace LLVM atomics with std::atomic."Benjamin Kramer2014-03-03
| | | | | | | Breaks the MSVC build. DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202731 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace LLVM atomics with std::atomic.Benjamin Kramer2014-03-03
| | | | | | | | | | | With C++11 we finally have a standardized way to specify atomic operations. Use them to replace the existing custom implemention. Sadly the translation is not entirely trivial as std::atomic allows more fine-grained control over the atomicity. I tried to preserve the old semantics as well as possible. Differential Revision: http://llvm-reviews.chandlerc.com/D2915 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202730 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-24
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202052 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a wrapper for open.Rafael Espindola2013-07-16
| | | | | | | This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186447 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more PRI.64 macros for MSVC and use them throughout the codebase.Benjamin Kramer2011-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143799 91177308-0d34-0410-b5e6-96231b3b80d8
* Let printf do the formatting instead aligning strings ourselves.Benjamin Kramer2011-10-16
| | | | | | While at it, merge some format strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142140 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll back my last two commits, valgrind complains.Benjamin Kramer2010-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110518 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill rarely used std::sort.Benjamin Kramer2010-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110516 91177308-0d34-0410-b5e6-96231b3b80d8
* Give NamedRegionTimer an Enabled flag, allowing all its clients toDan Gohman2010-06-18
| | | | | | | | | | | | | | | | | | | | | switch from this: if (TimePassesIsEnabled) { NamedRegionTimer T(Name, GroupName); do_something(); } else { do_something(); // duplicate the code, this time without a timer! } to this: { NamedRegionTimer T(Name, GroupName, TimePassesIsEnabled); do_something(); } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106285 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment explaining why this code uses Append mode.Dan Gohman2010-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104095 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of namespace polution.Dan Gohman2010-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101376 91177308-0d34-0410-b5e6-96231b3b80d8
* stringref'ize Timer apisChris Lattner2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99877 91177308-0d34-0410-b5e6-96231b3b80d8
* finally, maintain a global list of timer groups, allowing us to Chris Lattner2010-03-30
| | | | | | | | implement TimerGroup::printAll, which prints and resets all active timers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99876 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new TimerGroup::print method, and refactor away the bogusChris Lattner2010-03-30
| | | | | | | TimerGroup copy ctor and assignment operator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99875 91177308-0d34-0410-b5e6-96231b3b80d8
* rename GetLibSupportInfoOutputFile -> CreateInfoOutputFile andChris Lattner2010-03-30
| | | | | | | have it always return a new stream to simplify clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99874 91177308-0d34-0410-b5e6-96231b3b80d8
* if a timergroup is destroyed before its timers, print times.Chris Lattner2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99873 91177308-0d34-0410-b5e6-96231b3b80d8
* change TimerGroup to keep a linked list of active timers Chris Lattner2010-03-30
| | | | | | | | | instead of just a count of them, and refactor the guts of report printing out of removeTimer into its own method. Refactor addTimerToPrint away. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99872 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply my timer rewrite with a change for PassManager to store Chris Lattner2010-03-30
| | | | | | | timers by pointer instead of by-value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99871 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r99862 which is causing FNT failures.Chris Lattner2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99870 91177308-0d34-0410-b5e6-96231b3b80d8
* fairly major rewrite of various timing related stuff.Chris Lattner2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99862 91177308-0d34-0410-b5e6-96231b3b80d8
* move a function into a more logical place in the fileChris Lattner2010-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99842 91177308-0d34-0410-b5e6-96231b3b80d8
* remove support for per-time peak memory tracking, thisChris Lattner2010-03-29
| | | | | | | | isn't used by anyone and is better exposed as a non-per-timer thing. Also, stop including System/Mutex.h in Timer.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99841 91177308-0d34-0410-b5e6-96231b3b80d8
* various timer fixes: move operator= out of line,Chris Lattner2010-03-29
| | | | | | | | | | eliminate the per-timer lock (timers should be externally locked if needed), the info-output-stream can never be dbgs(), so drop the check. Make some stuff private. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99839 91177308-0d34-0410-b5e6-96231b3b80d8
* s/.../.Chris Lattner2010-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99834 91177308-0d34-0410-b5e6-96231b3b80d8
* move code around and improve indentation, no functionality change.Chris Lattner2010-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99831 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92645 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a race condition in the Timer class.Owen Anderson2009-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89056 91177308-0d34-0410-b5e6-96231b3b80d8
* Trailing whitespace.Mikhail Glushenkov2009-11-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86347 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some uses of llvm/Support/Streams.hChris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79842 91177308-0d34-0410-b5e6-96231b3b80d8
* Have scoped mutexes take referenes instead of pointers.Owen Anderson2009-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74931 91177308-0d34-0410-b5e6-96231b3b80d8
* Make timers threadsafe again. This isn't quite as nice as I'd hoped (it ↵Owen Anderson2009-06-23
| | | | | | | | | | | uses locking rather than atomic arithmetic), but should work on all the platforms we care about. I might revisit this if a totally awesome way to do it occurs to me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74002 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my last series of commits related to Timer and 64-bit atomics. Not ↵Owen Anderson2009-06-23
| | | | | | | | | all the targets we care about are capable of supporting it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73993 91177308-0d34-0410-b5e6-96231b3b80d8
* Switched size_t to int64_t to prevent type mismatch in call to max.Lang Hames2009-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73988 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually, these need to be signed integers, not unsigned.Owen Anderson2009-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73978 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 64-bit integer counters for tracking time, rather than doubles. This ↵Owen Anderson2009-06-23
| | | | | | will be more atomic op friendly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73974 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the lazy initialization of DefaultTimerGroup threadsafe.Owen Anderson2009-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73963 91177308-0d34-0410-b5e6-96231b3b80d8