@@ -1863,7 +1863,6 @@ void AttributeInferer::run(const SCCNodeSet &SCCNodes,
1863
1863
1864
1864
struct SCCNodesResult {
1865
1865
SCCNodeSet SCCNodes;
1866
- bool HasUnknownCall;
1867
1866
};
1868
1867
1869
1868
} // end anonymous namespace
@@ -2227,29 +2226,13 @@ static void addWillReturn(const SCCNodeSet &SCCNodes,
2227
2226
2228
2227
static SCCNodesResult createSCCNodeSet (ArrayRef<Function *> Functions) {
2229
2228
SCCNodesResult Res;
2230
- Res.HasUnknownCall = false ;
2231
2229
for (Function *F : Functions) {
2232
2230
if (!F || F->hasOptNone () || F->hasFnAttribute (Attribute::Naked) ||
2233
2231
F->isPresplitCoroutine ()) {
2234
- // Treat any function we're trying not to optimize as if it were an
2235
- // indirect call and omit it from the node set used below.
2236
- Res.HasUnknownCall = true ;
2232
+ // Omit any functions we're trying not to optimize from the set.
2237
2233
continue ;
2238
2234
}
2239
- // Track whether any functions in this SCC have an unknown call edge.
2240
- // Note: if this is ever a performance hit, we can common it with
2241
- // subsequent routines which also do scans over the instructions of the
2242
- // function.
2243
- if (!Res.HasUnknownCall ) {
2244
- for (Instruction &I : instructions (*F)) {
2245
- if (auto *CB = dyn_cast<CallBase>(&I)) {
2246
- if (!CB->getCalledFunction ()) {
2247
- Res.HasUnknownCall = true ;
2248
- break ;
2249
- }
2250
- }
2251
- }
2252
- }
2235
+
2253
2236
Res.SCCNodes .insert (F);
2254
2237
}
2255
2238
return Res;
@@ -2282,15 +2265,10 @@ deriveAttrsInPostOrder(ArrayRef<Function *> Functions, AARGetterT &&AARGetter,
2282
2265
addColdAttrs (Nodes.SCCNodes , Changed);
2283
2266
addWillReturn (Nodes.SCCNodes , Changed);
2284
2267
addNoUndefAttrs (Nodes.SCCNodes , Changed);
2285
-
2286
- // If we have no external nodes participating in the SCC, we can deduce some
2287
- // more precise attributes as well.
2288
- if (!Nodes.HasUnknownCall ) {
2289
- addNoAliasAttrs (Nodes.SCCNodes , Changed);
2290
- addNonNullAttrs (Nodes.SCCNodes , Changed);
2291
- inferAttrsFromFunctionBodies (Nodes.SCCNodes , Changed);
2292
- addNoRecurseAttrs (Nodes.SCCNodes , Changed);
2293
- }
2268
+ addNoAliasAttrs (Nodes.SCCNodes , Changed);
2269
+ addNonNullAttrs (Nodes.SCCNodes , Changed);
2270
+ inferAttrsFromFunctionBodies (Nodes.SCCNodes , Changed);
2271
+ addNoRecurseAttrs (Nodes.SCCNodes , Changed);
2294
2272
2295
2273
// Finally, infer the maximal set of attributes from the ones we've inferred
2296
2274
// above. This is handling the cases where one attribute on a signature
0 commit comments