Skip to content

Commit a7dc462

Browse files
committed
clang-format some long lines in ArrayPropertyOpt
1 parent 8d217f3 commit a7dc462

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

lib/SILOptimizer/LoopTransforms/ArrayPropertyOpt.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ class ArrayPropertiesAnalysis {
102102
/// Check if it is profitable to specialize a loop when you see an apply
103103
/// instruction. We consider it is not profitable to specialize the loop when:
104104
/// 1. The callee is not found in the module, or cannot be determined
105-
/// 2. The number of instructions the analysis scans has exceeded the AnalysisThreshold
105+
/// 2. The number of instructions the analysis scans has exceeded the
106+
/// AnalysisThreshold
106107
uint32_t checkProfitabilityRecursively(SILFunction *Callee) {
107108
if (!Callee)
108109
return AnalysisThreshold;
@@ -118,16 +119,19 @@ class ArrayPropertiesAnalysis {
118119
for (auto &BB : *Callee) {
119120
for (auto &I : BB) {
120121
if (InstCount++ >= AnalysisThreshold) {
121-
LLVM_DEBUG(llvm::dbgs() << "ArrayPropertyOpt: Disabled Reason - Exceeded Analysis Threshold in "
122+
LLVM_DEBUG(llvm::dbgs() << "ArrayPropertyOpt: Disabled Reason - "
123+
"Exceeded Analysis Threshold in "
122124
<< BB.getParent()->getName() << "\n");
123125
InstCountCache[Callee] = AnalysisThreshold;
124126
return AnalysisThreshold;
125127
}
126128
if (auto Apply = FullApplySite::isa(&I)) {
127129
auto Callee = Apply.getReferencedFunctionOrNull();
128130
if (!Callee) {
129-
LLVM_DEBUG(llvm::dbgs() << "ArrayPropertyOpt: Disabled Reason - Found opaque code in "
130-
<< BB.getParent()->getName() << "\n");
131+
LLVM_DEBUG(
132+
llvm::dbgs()
133+
<< "ArrayPropertyOpt: Disabled Reason - Found opaque code in "
134+
<< BB.getParent()->getName() << "\n");
131135
LLVM_DEBUG(Apply.dump());
132136
LLVM_DEBUG(I.getOperand(0)->dump());
133137
}
@@ -182,9 +186,11 @@ class ArrayPropertiesAnalysis {
182186
if (!FoundHoistable)
183187
return false;
184188

185-
// If the LoopInstCount exceeds the threshold, we will disable the optimization on this loop
186-
// For loops of deeper nesting we increase the threshold by an additional 10%
187-
if (LoopInstCount > LoopInstCountThreshold * (1 + (Loop->getLoopDepth() - 1) / 10)) {
189+
// If the LoopInstCount exceeds the threshold, we will disable the
190+
// optimization on this loop For loops of deeper nesting we increase the
191+
// threshold by an additional 10%
192+
if (LoopInstCount >
193+
LoopInstCountThreshold * (1 + (Loop->getLoopDepth() - 1) / 10)) {
188194
LLVM_DEBUG(llvm::dbgs() << "Exceeded LoopInstCountThreshold\n");
189195
return false;
190196
}
@@ -205,8 +211,9 @@ class ArrayPropertiesAnalysis {
205211
}
206212
}
207213

208-
LLVM_DEBUG(llvm::dbgs() << "Profitable ArrayPropertyOpt in "
209-
<< Loop->getLoopPreheader()->getParent()->getName() << "\n");
214+
LLVM_DEBUG(llvm::dbgs()
215+
<< "Profitable ArrayPropertyOpt in "
216+
<< Loop->getLoopPreheader()->getParent()->getName() << "\n");
210217
LLVM_DEBUG(Loop->dump());
211218
return true;
212219
}

0 commit comments

Comments
 (0)