Skip to content

Commit 0426e28

Browse files
committed
[NFC][StackSafety] Move out sort from the loop
1 parent bb4efab commit 0426e28

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Analysis/StackSafetyAnalysis.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -812,11 +812,11 @@ StackSafetyInfo::getParamAccesses() const {
812812
}
813813
Param.Calls.emplace_back(C.first.ParamNo, C.first.Callee->getGUID(),
814814
C.second);
815-
llvm::sort(Param.Calls, [](const FunctionSummary::ParamAccess::Call &L,
816-
const FunctionSummary::ParamAccess::Call &R) {
817-
return std::tie(L.ParamNo, L.Callee) < std::tie(R.ParamNo, R.Callee);
818-
});
819815
}
816+
sort(Param.Calls, [](const FunctionSummary::ParamAccess::Call &L,
817+
const FunctionSummary::ParamAccess::Call &R) {
818+
return std::tie(L.ParamNo, L.Callee) < std::tie(R.ParamNo, R.Callee);
819+
});
820820
}
821821
return ParamAccesses;
822822
}

llvm/test/Bitcode/thinlto-function-summary-paramaccess.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ entry:
230230
}
231231

232232
; SSI-LABEL: for function 'CallMany2'
233-
; SSI: p[]: empty-set, @Callee(arg0, [-715,125))
233+
; SSI: p[]: empty-set, @Callee(arg0, [-715,125)), @Callee2(arg1, [-33,-32))
234234
; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=2 op4=0 op5=[[CALLEE]] op6=1431 op7=250 op8=1 op9=[[CALLEE2:-?[0-9]+]] op10=67 op11=65/>
235235
; BC-NEXT: <PERMODULE
236236
; DIS-DAG: = gv: (name: "CallMany2", summaries: {{.*}} calls: ((callee: ^{{.*}}), (callee: ^{{.*}})), params: ((param: 0, offset: [0, -1], calls: ((callee: ^{{.*}}, param: 0, offset: [-715, 124]), (callee: ^{{.*}}, param: 1, offset: [-33, -33]))))))) ; guid = 16654048340802466690

0 commit comments

Comments
 (0)