Skip to content

Commit eef799b

Browse files
committed
clang-format.
1 parent 988fab7 commit eef799b

File tree

4 files changed

+31
-26
lines changed

4 files changed

+31
-26
lines changed

llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ class BasicBlockSectionsProfileReader {
102102
SmallVector<PrefetchHint>
103103
getPrefetchHintsForFunction(StringRef FuncName) const;
104104

105-
SmallVector<BBPosition> getPrefetchTargetsForFunction(StringRef FuncName) const;
105+
SmallVector<BBPosition>
106+
getPrefetchTargetsForFunction(StringRef FuncName) const;
106107

107108
private:
108109
StringRef getAliasName(StringRef FuncName) const {
@@ -215,7 +216,8 @@ class BasicBlockSectionsProfileReaderWrapperPass : public ImmutablePass {
215216
SmallVector<PrefetchHint>
216217
getPrefetchHintsForFunction(StringRef FuncName) const;
217218

218-
SmallVector<BBPosition> getPrefetchTargetsForFunction(StringRef FuncName) const;
219+
SmallVector<BBPosition>
220+
getPrefetchTargetsForFunction(StringRef FuncName) const;
219221

220222
// Initializes the FunctionNameToDIFilename map for the current module and
221223
// then reads the profile for the matching functions.

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "WasmException.h"
1919
#include "WinCFGuard.h"
2020
#include "WinException.h"
21-
#include "llvm/Support/SMLoc.h"
2221
#include "llvm/ADT/APFloat.h"
2322
#include "llvm/ADT/APInt.h"
2423
#include "llvm/ADT/BitmaskEnum.h"
@@ -120,6 +119,7 @@
120119
#include "llvm/Support/Format.h"
121120
#include "llvm/Support/MathExtras.h"
122121
#include "llvm/Support/Path.h"
122+
#include "llvm/Support/SMLoc.h"
123123
#include "llvm/Support/VCSRevision.h"
124124
#include "llvm/Support/VirtualFileSystem.h"
125125
#include "llvm/Support/raw_ostream.h"
@@ -1983,7 +1983,7 @@ void AsmPrinter::emitFunctionBody() {
19831983
FunctionCallGraphInfo FuncCGInfo;
19841984
const auto &CallSitesInfoMap = MF->getCallSitesInfo();
19851985

1986-
for (auto &MBB : *MF) {
1986+
for (auto &MBB : *MF) {
19871987
// Print a label for the basic block.
19881988
emitBasicBlockStart(MBB);
19891989
DenseMap<StringRef, unsigned> MnemonicCounts;
@@ -1992,15 +1992,18 @@ void AsmPrinter::emitFunctionBody() {
19921992
auto PrefetchTargetIt = PrefetchTargets.begin();
19931993
unsigned NumCalls = 0;
19941994
auto EmitPrefetchTargetSymbolIfNeeded = [&]() {
1995-
if (PrefetchTargetIt == PrefetchTargets.end() || NumCalls < *PrefetchTargetIt)
1995+
if (PrefetchTargetIt == PrefetchTargets.end() ||
1996+
NumCalls < *PrefetchTargetIt)
19961997
return;
19971998
MCSymbol *PrefetchTargetSymbol = OutContext.getOrCreateSymbol(
1998-
Twine("__llvm_prefetch_target_") + MF->getName() + Twine("_") + utostr(MBB.getBBID()->BaseID) +
1999-
Twine("_") +
2000-
utostr(*PrefetchTargetIt));
2001-
OutStreamer->emitSymbolAttribute(PrefetchTargetSymbol, MF->getFunction().isWeakForLinker() ? MCSA_Weak : MCSA_Global);
2002-
OutStreamer->emitLabel(PrefetchTargetSymbol);
2003-
++PrefetchTargetIt;
1999+
Twine("__llvm_prefetch_target_") + MF->getName() + Twine("_") +
2000+
utostr(MBB.getBBID()->BaseID) + Twine("_") +
2001+
utostr(*PrefetchTargetIt));
2002+
OutStreamer->emitSymbolAttribute(
2003+
PrefetchTargetSymbol,
2004+
MF->getFunction().isWeakForLinker() ? MCSA_Weak : MCSA_Global);
2005+
OutStreamer->emitLabel(PrefetchTargetSymbol);
2006+
++PrefetchTargetIt;
20042007
};
20052008

20062009
for (auto &MI : MBB) {
@@ -2118,7 +2121,7 @@ void AsmPrinter::emitFunctionBody() {
21182121
break;
21192122
}
21202123
default:
2121-
emitInstruction(&MI);
2124+
emitInstruction(&MI);
21222125

21232126
auto CountInstruction = [&](const MachineInstr &MI) {
21242127
// Skip Meta instructions inside bundles.
@@ -2144,7 +2147,7 @@ void AsmPrinter::emitFunctionBody() {
21442147

21452148
if (MI.isCall()) {
21462149
if (MF->getTarget().Options.BBAddrMap)
2147-
OutStreamer->emitLabel(createCallsiteEndSymbol(MBB));
2150+
OutStreamer->emitLabel(createCallsiteEndSymbol(MBB));
21482151
++NumCalls;
21492152
}
21502153

llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ Error BasicBlockSectionsProfileReader::ReadV1Profile() {
337337
if (getAsUnsignedInteger(PrefetchTargetStr[1], 10, TargetCallsiteIndex))
338338
return createProfileParseError(Twine("unsigned integer expected: '") +
339339
PrefetchTargetStr[1]);
340-
FI->second.PrefetchTargets.push_back(BBPosition{*TargetBBID, static_cast<unsigned>(TargetCallsiteIndex)});
340+
FI->second.PrefetchTargets.push_back(
341+
BBPosition{*TargetBBID, static_cast<unsigned>(TargetCallsiteIndex)});
341342
continue;
342343
}
343344
default:

llvm/lib/CodeGen/InsertCodePrefetch.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ class InsertCodePrefetch : public MachineFunctionPass {
3939
initializeInsertCodePrefetchPass(*PassRegistry::getPassRegistry());
4040
}
4141

42-
StringRef getPassName() const override { return "X86 Cide Prefetch Inserter Pass"; }
42+
StringRef getPassName() const override {
43+
return "X86 Cide Prefetch Inserter Pass";
44+
}
4345

4446
void getAnalysisUsage(AnalysisUsage &AU) const override;
4547

@@ -55,15 +57,11 @@ class InsertCodePrefetch : public MachineFunctionPass {
5557
//===----------------------------------------------------------------------===//
5658

5759
char InsertCodePrefetch::ID = 0;
58-
INITIALIZE_PASS_BEGIN(
59-
InsertCodePrefetch, DEBUG_TYPE,
60-
"Reads prefetch", true,
61-
false)
60+
INITIALIZE_PASS_BEGIN(InsertCodePrefetch, DEBUG_TYPE, "Reads prefetch", true,
61+
false)
6262
INITIALIZE_PASS_DEPENDENCY(BasicBlockSectionsProfileReaderWrapperPass)
63-
INITIALIZE_PASS_END(
64-
InsertCodePrefetch, DEBUG_TYPE,
65-
"Reads prefetch", true,
66-
false)
63+
INITIALIZE_PASS_END(InsertCodePrefetch, DEBUG_TYPE, "Reads prefetch", true,
64+
false)
6765

6866
bool InsertCodePrefetch::runOnMachineFunction(MachineFunction &MF) {
6967
assert(MF.getTarget().getBBSectionsType() == BasicBlockSection::List &&
@@ -74,11 +72,12 @@ bool InsertCodePrefetch::runOnMachineFunction(MachineFunction &MF) {
7472
getAnalysis<BasicBlockSectionsProfileReaderWrapperPass>()
7573
.getPrefetchTargetsForFunction(MF.getName());
7674
DenseMap<UniqueBBID, SmallVector<unsigned>> PrefetchTargetsByBBID;
77-
for (const auto &Target: PrefetchTargets)
75+
for (const auto &Target : PrefetchTargets)
7876
PrefetchTargetsByBBID[Target.BBID].push_back(Target.CallsiteIndex);
79-
for (auto &MBB: MF) {
77+
for (auto &MBB : MF) {
8078
auto R = PrefetchTargetsByBBID.find(*MBB.getBBID());
81-
if (R == PrefetchTargetsByBBID.end()) continue;
79+
if (R == PrefetchTargetsByBBID.end())
80+
continue;
8281
MBB.setPrefetchTargetIndexes(R->second);
8382
}
8483

0 commit comments

Comments
 (0)