diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-18 23:19:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-18 23:19:47 +0000 |
commit | 5021b8c2d6fd91c973dfca2dd22c9edd7d90f6a8 (patch) | |
tree | 6c8fc553d9bfa911751c3c3f33162ef7a477e88c /lib/Analysis/DataStructure/BottomUpClosure.cpp | |
parent | db7436aae8fc1f3cd993a2a78c4f919bb21e6599 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/BottomUpClosure.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/BottomUpClosure.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp index 91cfc7c14e..7ab7d80564 100644 --- a/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -305,6 +305,13 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) { CalledFuncs.clear(); + // 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) { + TempFCs.erase(TempFCs.begin()); + continue; + } + if (CS.isDirectCall()) { Function *F = CS.getCalleeFunc(); if (isResolvableFunc(F)) |