[llvm-commits] [llvm] r58615 - /llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Mon Nov 3 08:05:35 PST 2008
Author: alenhar2
Date: Mon Nov 3 10:05:35 2008
New Revision: 58615
URL: http://llvm.org/viewvc/llvm-project?rev=58615&view=rev
Log:
Ensure that we are checking only calls to the function we are interested in specializing
Modified:
llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp
Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=58615&r1=58614&r2=58615&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Mon Nov 3 10:05:35 2008
@@ -165,14 +165,16 @@
}
}
+/// scanDistribution - Construct a histogram of constants for arg of F at arg
int PartSpec::scanDistribution(Function& F, int arg,
std::map<Constant*, int>& dist) {
bool hasIndirect = false;
int total = 0;
for(Value::use_iterator ii = F.use_begin(), ee = F.use_end();
ii != ee; ++ii)
- if (CallInst* CI = dyn_cast<CallInst>(ii)) {
- ++dist[dyn_cast<Constant>(CI->getOperand(arg + 1))];
+ if ((isa<CallInst>(ii) || isa<InvokeInst>(ii))
+ && ii->getOperand(0) == &F) {
+ ++dist[dyn_cast<Constant>(ii->getOperand(arg + 1))];
++total;
} else
hasIndirect = true;
More information about the llvm-commits
mailing list