mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
transform more loops to iterator form, detabify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51436 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -66,7 +66,7 @@ static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
|
|||||||
// Otherwise, add any offset that our operands provide.
|
// Otherwise, add any offset that our operands provide.
|
||||||
gep_type_iterator GTI = gep_type_begin(CE);
|
gep_type_iterator GTI = gep_type_begin(CE);
|
||||||
for (User::const_op_iterator i = CE->op_begin() + 1, e = CE->op_end();
|
for (User::const_op_iterator i = CE->op_begin() + 1, e = CE->op_end();
|
||||||
i != e; ++i, ++GTI) {
|
i != e; ++i, ++GTI) {
|
||||||
ConstantInt *CI = dyn_cast<ConstantInt>(*i);
|
ConstantInt *CI = dyn_cast<ConstantInt>(*i);
|
||||||
if (!CI) return false; // Index isn't a simple constant?
|
if (!CI) return false; // Index isn't a simple constant?
|
||||||
if (CI->getZExtValue() == 0) continue; // Not adding anything.
|
if (CI->getZExtValue() == 0) continue; // Not adding anything.
|
||||||
|
@@ -158,10 +158,10 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI,
|
|||||||
// global. In particular, we would prefer to have an argument or instruction
|
// global. In particular, we would prefer to have an argument or instruction
|
||||||
// operand to chase the def-use chains of.
|
// operand to chase the def-use chains of.
|
||||||
Value *Op = CF;
|
Value *Op = CF;
|
||||||
for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
|
for (User::op_iterator i = CI->op_begin() + 1, e = CI->op_end(); i != e; ++i)
|
||||||
if (isa<Argument>(CI->getOperand(i)) ||
|
if (isa<Argument>(*i) ||
|
||||||
isa<Instruction>(CI->getOperand(i))) {
|
isa<Instruction>(*i)) {
|
||||||
Op = CI->getOperand(i);
|
Op = *i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,8 +176,9 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI,
|
|||||||
C->getOperand(0) == CI->getOperand(0) &&
|
C->getOperand(0) == CI->getOperand(0) &&
|
||||||
C->getParent()->getParent() == CIFunc && C != CI) {
|
C->getParent()->getParent() == CIFunc && C != CI) {
|
||||||
bool AllOperandsEqual = true;
|
bool AllOperandsEqual = true;
|
||||||
for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
|
for (User::op_iterator i = CI->op_begin() + 1, j = C->op_begin() + 1,
|
||||||
if (C->getOperand(i) != CI->getOperand(i)) {
|
e = CI->op_end(); i != e; ++i, ++j)
|
||||||
|
if (*j != *i) {
|
||||||
AllOperandsEqual = false;
|
AllOperandsEqual = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user