-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OpenMP][NFC] Extract timescope profile support into its own header (#…
- Loading branch information
Showing
7 changed files
with
44 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//===-- Shared/Profile.h - Target independent OpenMP target RTL -*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Macros to provide profile support via LLVM's time profiler. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "llvm/Support/TimeProfiler.h" | ||
|
||
/// Time spend in the current scope, assigned to the function name. | ||
#define TIMESCOPE() llvm::TimeTraceScope TimeScope(__FUNCTION__) | ||
|
||
/// Time spend in the current scope, assigned to the function name and source | ||
/// info. | ||
#define TIMESCOPE_WITH_IDENT(IDENT) \ | ||
SourceInfo SI(IDENT); \ | ||
llvm::TimeTraceScope TimeScope(__FUNCTION__, SI.getProfileLocation()) | ||
|
||
/// Time spend in the current scope, assigned to the given name and source | ||
/// info. | ||
#define TIMESCOPE_WITH_NAME_AND_IDENT(NAME, IDENT) \ | ||
SourceInfo SI(IDENT); \ | ||
llvm::TimeTraceScope TimeScope(NAME, SI.getProfileLocation()) | ||
|
||
/// Time spend in the current scope, assigned to the function name and source | ||
/// info and RegionTypeMsg. | ||
#define TIMESCOPE_WITH_RTM_AND_IDENT(RegionTypeMsg, IDENT) \ | ||
SourceInfo SI(IDENT); \ | ||
std::string ProfileLocation = SI.getProfileLocation(); \ | ||
std::string RTM = RegionTypeMsg; \ | ||
llvm::TimeTraceScope TimeScope(__FUNCTION__, ProfileLocation + RTM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters