LLVM 20.0.0git
TGTimer.cpp
Go to the documentation of this file.
1//===- TGTimer.cpp - TableGen Timer implementation --------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Implement the tablegen timer class.
10//
11//===----------------------------------------------------------------------===//
12
14using namespace llvm;
15
16// These functions implement the phase timing facility. Starting a timer
17// when one is already running stops the running one.
19 if (!TimingGroup)
20 return;
21 if (LastTimer && LastTimer->isRunning()) {
22 LastTimer->stopTimer();
23 if (BackendTimer) {
24 LastTimer->clear();
25 BackendTimer = false;
26 }
27 }
28
29 LastTimer = std::make_unique<Timer>("", Name, *TimingGroup);
30 LastTimer->startTimer();
31}
32
34 if (!TimingGroup)
35 return;
36
37 assert(LastTimer && "No phase timer was started");
38 LastTimer->stopTimer();
39}
40
42 if (!TimingGroup)
43 return;
44
46 BackendTimer = true;
47}
48
50 if (!TimingGroup || !BackendTimer)
51 return;
52 stopTimer();
53 BackendTimer = false;
54}
std::string Name
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
void stopTimer()
Stop timing a phase.
Definition: TGTimer.cpp:33
void startTimer(StringRef Name)
Start timing a phase. Automatically stops any previous phase timer.
Definition: TGTimer.cpp:18
void stopBackendTimer()
Stop timing the overall backend.
Definition: TGTimer.cpp:49
void startBackendTimer(StringRef Name)
Start timing the overall backend.
Definition: TGTimer.cpp:41
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18