mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
bug 122:
- Minimize redundant isa<GlobalValue> usage git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -78,8 +78,7 @@ static unsigned CountCodeReductionForConstant(Value *V) {
|
||||
Instruction &Inst = cast<Instruction>(**UI);
|
||||
bool AllOperandsConstant = true;
|
||||
for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i)
|
||||
if (!isa<Constant>(Inst.getOperand(i)) &&
|
||||
!isa<GlobalValue>(Inst.getOperand(i)) && Inst.getOperand(i) != V) {
|
||||
if (!isa<Constant>(Inst.getOperand(i)) && Inst.getOperand(i) != V) {
|
||||
AllOperandsConstant = false;
|
||||
break;
|
||||
}
|
||||
@ -205,7 +204,7 @@ int SimpleInliner::getInlineCost(CallSite CS) {
|
||||
// If this is a constant being passed into the function, use the argument
|
||||
// weights calculated for the callee to determine how much will be folded
|
||||
// away with this information.
|
||||
} else if (isa<Constant>(I) || isa<GlobalVariable>(I)) {
|
||||
} else if (isa<Constant>(I)) {
|
||||
if (ArgNo < CalleeFI.ArgumentWeights.size())
|
||||
InlineCost -= CalleeFI.ArgumentWeights[ArgNo].ConstantWeight;
|
||||
}
|
||||
|
Reference in New Issue
Block a user