From bed1c18a443505c2af689045e7bbb6b1ba200150 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 18 Mar 2005 23:19:47 +0000 Subject: do not bother inlining nullary functions without return values. The only effect these calls can have is due to global variables, and these passes all use the globals graph to capture their effect anyway. This speeds up the BU pass very slightly on perlbmk, reducing the number of dsnodes allocated from 98913 to 96423. llvm-svn: 20676 --- llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp') diff --git a/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp b/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp index 5a0436c0616..a70080a8c66 100644 --- a/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp +++ b/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp @@ -217,7 +217,11 @@ void CompleteBUDataStructures::processGraph(DSGraph &G) { assert(calls.insert(TheCall).second && "Call instruction occurs multiple times in graph??"); - + + // Fast path for noop calls. Note that we don't care about merging globals + // in the callee with nodes in the caller here. + if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) + continue; // Loop over all of the potentially called functions... // Inline direct calls as well as indirect calls because the direct -- cgit v1.2.3