mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-07 16:54:48 +00:00
Ensure that we are checking only calls to the function we are interested in specializing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d1000d9927
commit
97bd9a914b
@ -165,14 +165,16 @@ void PartSpec::scanForInterest(Function& F, SmallVector<int, 6>& args) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// scanDistribution - Construct a histogram of constants for arg of F at arg
|
||||||
int PartSpec::scanDistribution(Function& F, int arg,
|
int PartSpec::scanDistribution(Function& F, int arg,
|
||||||
std::map<Constant*, int>& dist) {
|
std::map<Constant*, int>& dist) {
|
||||||
bool hasIndirect = false;
|
bool hasIndirect = false;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
for(Value::use_iterator ii = F.use_begin(), ee = F.use_end();
|
for(Value::use_iterator ii = F.use_begin(), ee = F.use_end();
|
||||||
ii != ee; ++ii)
|
ii != ee; ++ii)
|
||||||
if (CallInst* CI = dyn_cast<CallInst>(ii)) {
|
if ((isa<CallInst>(ii) || isa<InvokeInst>(ii))
|
||||||
++dist[dyn_cast<Constant>(CI->getOperand(arg + 1))];
|
&& ii->getOperand(0) == &F) {
|
||||||
|
++dist[dyn_cast<Constant>(ii->getOperand(arg + 1))];
|
||||||
++total;
|
++total;
|
||||||
} else
|
} else
|
||||||
hasIndirect = true;
|
hasIndirect = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user