@@ -1863,7 +1863,6 @@ void AttributeInferer::run(const SCCNodeSet &SCCNodes,
18631863
18641864struct SCCNodesResult {
18651865 SCCNodeSet SCCNodes;
1866- bool HasUnknownCall;
18671866};
18681867
18691868} // end anonymous namespace
@@ -2227,29 +2226,13 @@ static void addWillReturn(const SCCNodeSet &SCCNodes,
22272226
22282227static SCCNodesResult createSCCNodeSet (ArrayRef<Function *> Functions) {
22292228 SCCNodesResult Res;
2230- Res.HasUnknownCall = false ;
22312229 for (Function *F : Functions) {
22322230 if (!F || F->hasOptNone () || F->hasFnAttribute (Attribute::Naked) ||
22332231 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.
22372233 continue ;
22382234 }
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+
22532236 Res.SCCNodes .insert (F);
22542237 }
22552238 return Res;
@@ -2282,15 +2265,10 @@ deriveAttrsInPostOrder(ArrayRef<Function *> Functions, AARGetterT &&AARGetter,
22822265 addColdAttrs (Nodes.SCCNodes , Changed);
22832266 addWillReturn (Nodes.SCCNodes , Changed);
22842267 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);
22942272
22952273 // Finally, infer the maximal set of attributes from the ones we've inferred
22962274 // above. This is handling the cases where one attribute on a signature
0 commit comments