aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2019-12-18 07:56:47 -0800
committerMircea Trofin <mtrofin@google.com>2019-12-18 08:10:44 -0800
commit5a956c85df9f5fd598c5292af9c2478d51566205 (patch)
treea8957814274d91f6abf4b71d45273997cc5ec763 /llvm/lib/Analysis/InlineCost.cpp
parente67462a719368ae83d8c84986b7028649833eb5c (diff)
downloadllvm-5a956c85df9f5fd598c5292af9c2478d51566205.zip
llvm-5a956c85df9f5fd598c5292af9c2478d51566205.tar.gz
llvm-5a956c85df9f5fd598c5292af9c2478d51566205.tar.bz2
[NFC][InlineCost] Run clang-format on InlineCost.cpp
Reviewers: davidxl Reviewed By: davidxl Subscribers: Jim, eraman, hiraditya, haicheng, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71646
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 24af43a..635c7eb 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -450,8 +450,8 @@ bool CallAnalyzer::visitAlloca(AllocaInst &I) {
// Accumulate the allocated size.
if (I.isStaticAlloca()) {
Type *Ty = I.getAllocatedType();
- AllocatedSize = SaturatingAdd(DL.getTypeAllocSize(Ty).getFixedSize(),
- AllocatedSize);
+ AllocatedSize =
+ SaturatingAdd(DL.getTypeAllocSize(Ty).getFixedSize(), AllocatedSize);
}
// We will happily inline static alloca instructions.
@@ -1077,8 +1077,8 @@ bool CallAnalyzer::visitBinaryOperator(BinaryOperator &I) {
Value *SimpleV = nullptr;
if (auto FI = dyn_cast<FPMathOperator>(&I))
- SimpleV = SimplifyBinOp(I.getOpcode(), CLHS ? CLHS : LHS,
- CRHS ? CRHS : RHS, FI->getFastMathFlags(), DL);
+ SimpleV = SimplifyBinOp(I.getOpcode(), CLHS ? CLHS : LHS, CRHS ? CRHS : RHS,
+ FI->getFastMathFlags(), DL);
else
SimpleV =
SimplifyBinOp(I.getOpcode(), CLHS ? CLHS : LHS, CRHS ? CRHS : RHS, DL);
@@ -1111,9 +1111,8 @@ bool CallAnalyzer::visitFNeg(UnaryOperator &I) {
if (!COp)
COp = SimplifiedValues.lookup(Op);
- Value *SimpleV = SimplifyFNegInst(COp ? COp : Op,
- cast<FPMathOperator>(I).getFastMathFlags(),
- DL);
+ Value *SimpleV = SimplifyFNegInst(
+ COp ? COp : Op, cast<FPMathOperator>(I).getFastMathFlags(), DL);
if (Constant *C = dyn_cast_or_null<Constant>(SimpleV))
SimplifiedValues[&I] = C;
@@ -1493,8 +1492,7 @@ bool CallAnalyzer::visitSwitchInst(SwitchInst &SI) {
}
int64_t ExpectedNumberOfCompare = 3 * (int64_t)NumCaseCluster / 2 - 1;
- int64_t SwitchCost =
- ExpectedNumberOfCompare * 2 * InlineConstants::InstrCost;
+ int64_t SwitchCost = ExpectedNumberOfCompare * 2 * InlineConstants::InstrCost;
addCost(SwitchCost, (int64_t)CostUpperBound);
return false;
@@ -1934,7 +1932,7 @@ InlineResult CallAnalyzer::analyzeCall(CallBase &Call) {
if (NumVectorInstructions <= NumInstructions / 10)
Threshold -= VectorBonus;
else if (NumVectorInstructions <= NumInstructions / 2)
- Threshold -= VectorBonus/2;
+ Threshold -= VectorBonus / 2;
return Cost < std::max(1, Threshold);
}
@@ -2175,7 +2173,8 @@ InlineParams llvm::getInlineParams(int Threshold) {
if (LocallyHotCallSiteThreshold.getNumOccurrences() > 0)
Params.LocallyHotCallSiteThreshold = LocallyHotCallSiteThreshold;
- // Set the ColdCallSiteThreshold knob from the -inline-cold-callsite-threshold.
+ // Set the ColdCallSiteThreshold knob from the
+ // -inline-cold-callsite-threshold.
Params.ColdCallSiteThreshold = ColdCallSiteThreshold;
// Set the OptMinSizeThreshold and OptSizeThreshold params only if the