Skip to content

Commit 48cbe62

Browse files
committed
format
1 parent ef31305 commit 48cbe62

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

llvm/lib/Analysis/InlineCost.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,8 @@ bool CallAnalyzer::simplifyCmpInst(Function *F, CmpInst &Cmp) {
16861686
if (!isa<Constant>(Cmp.getOperand(1)))
16871687
return false;
16881688
auto *CmpOp = Cmp.getOperand(0);
1689-
// Iterate over the users of the function to check if it's a recursive function:
1689+
// Iterate over the users of the function to check if it's a recursive
1690+
// function:
16901691
for (auto *U : F->users()) {
16911692
CallInst *Call = dyn_cast<CallInst>(U);
16921693
if (!Call || Call->getFunction() != F)
@@ -1704,14 +1705,15 @@ bool CallAnalyzer::simplifyCmpInst(Function *F, CmpInst &Cmp) {
17041705
auto *CmpInstr = dyn_cast<CmpInst>(Br->getCondition());
17051706
if (!CmpInstr || CmpInstr != &Cmp)
17061707
continue;
1707-
// Check if there are any arg of the recursive callsite is affecting the cmp instr:
1708+
// Check if there are any arg of the recursive callsite is affecting the cmp
1709+
// instr:
17081710
bool ArgFound = false;
17091711
Value *FuncArg = nullptr, *CallArg = nullptr;
1710-
for (unsigned ArgNum = 0; ArgNum < F->arg_size() && ArgNum < Call->arg_size(); ArgNum ++) {
1712+
for (unsigned ArgNum = 0;
1713+
ArgNum < F->arg_size() && ArgNum < Call->arg_size(); ArgNum++) {
17111714
FuncArg = F->getArg(ArgNum);
17121715
CallArg = Call->getArgOperand(ArgNum);
1713-
if ((FuncArg == CmpOp) &&
1714-
(CallArg != CmpOp)) {
1716+
if ((FuncArg == CmpOp) && (CallArg != CmpOp)) {
17151717
ArgFound = true;
17161718
break;
17171719
}
@@ -1726,7 +1728,8 @@ bool CallAnalyzer::simplifyCmpInst(Function *F, CmpInst &Cmp) {
17261728
SQ.DC = &DC;
17271729
DominatorTree DT(*F);
17281730
SQ.DT = &DT;
1729-
Value *simplifiedInstruction = llvm::simplifyInstructionWithOperands(CmpInstr, {CallArg, Cmp.getOperand(1)}, SQ);
1731+
Value *simplifiedInstruction = llvm::simplifyInstructionWithOperands(
1732+
CmpInstr, {CallArg, Cmp.getOperand(1)}, SQ);
17301733
if (!simplifiedInstruction)
17311734
continue;
17321735
if (auto *ConstVal = dyn_cast<llvm::ConstantInt>(simplifiedInstruction)) {

0 commit comments

Comments
 (0)