LLVM  16.0.0git
IncrementalSourceMgr.cpp
Go to the documentation of this file.
1 //===-------------------- IncrementalSourceMgr.cpp ------------------------===//
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 /// \file
10 /// This file defines some implementations for IncrementalSourceMgr.
11 ///
12 //===----------------------------------------------------------------------===//
13 
15 #ifndef NDEBUG
16 #include "llvm/Support/Format.h"
17 #endif
18 
19 using namespace llvm;
20 using namespace llvm::mca;
21 
23  Staging.clear();
24  InstStorage.clear();
25  TotalCounter = 0U;
26  EOS = false;
27 }
28 
30  ++TotalCounter;
31  Instruction *I = Staging.front();
32  Staging.pop_front();
33  I->reset();
34 
35  if (InstFreedCB)
36  InstFreedCB(I);
37 }
38 
39 #ifndef NDEBUG
41  unsigned MaxInstStorageSize = InstStorage.size();
42  if (MaxInstStorageSize <= TotalCounter) {
43  auto Ratio = double(MaxInstStorageSize) / double(TotalCounter);
44  OS << "Cache ratio = " << MaxInstStorageSize << " / " << TotalCounter
45  << llvm::format(" (%.2f%%)", (1.0 - Ratio) * 100.0) << "\n";
46  } else {
47  OS << "Error: Number of created instructions "
48  << "are larger than the number of issued instructions\n";
49  }
50 }
51 #endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::mca
Definition: TargetRegistry.h:60
llvm::mca::IncrementalSourceMgr::updateNext
void updateNext() override
Advance to the next SourceRef.
Definition: IncrementalSourceMgr.cpp:29
IncrementalSourceMgr.h
double
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
Definition: README-SSE.txt:85
llvm::mca::Instruction
An instruction propagated through the simulated instruction pipeline.
Definition: Instruction.h:600
Format.h
llvm::mca::IncrementalSourceMgr::clear
void clear()
Definition: IncrementalSourceMgr.cpp:22
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::format
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:124
llvm::mca::IncrementalSourceMgr::printStatistic
void printStatistic(raw_ostream &OS)
Print statistic about instruction recycling stats.
Definition: IncrementalSourceMgr.cpp:40