Rename GVNExpression *ops_ members to *op_* to match conventions in the rest of LLVM

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290524 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Berlin 2016-12-25 22:10:37 +00:00
parent 6cc32b3b42
commit c6e5fa688a
2 changed files with 35 additions and 35 deletions

View File

@ -154,24 +154,24 @@ public:
unsigned getNumOperands() const { return NumOperands; }
typedef Value **op_iterator;
typedef Value *const *const_ops_iterator;
op_iterator ops_begin() { return Operands; }
op_iterator ops_end() { return Operands + NumOperands; }
const_ops_iterator ops_begin() const { return Operands; }
const_ops_iterator ops_end() const { return Operands + NumOperands; }
typedef Value *const *const_op_iterator;
op_iterator op_begin() { return Operands; }
op_iterator op_end() { return Operands + NumOperands; }
const_op_iterator op_begin() const { return Operands; }
const_op_iterator op_end() const { return Operands + NumOperands; }
iterator_range<op_iterator> operands() {
return iterator_range<op_iterator>(ops_begin(), ops_end());
return iterator_range<op_iterator>(op_begin(), op_end());
}
iterator_range<const_ops_iterator> operands() const {
return iterator_range<const_ops_iterator>(ops_begin(), ops_end());
iterator_range<const_op_iterator> operands() const {
return iterator_range<const_op_iterator>(op_begin(), op_end());
}
void ops_push_back(Value *Arg) {
void op_push_back(Value *Arg) {
assert(NumOperands < MaxOperands && "Tried to add too many operands");
assert(Operands && "Operandss not allocated before pushing");
Operands[NumOperands++] = Arg;
}
bool ops_empty() const { return getNumOperands() == 0; }
bool op_empty() const { return getNumOperands() == 0; }
void allocateOperands(RecyclerType &Recycler, BumpPtrAllocator &Allocator) {
assert(!Operands && "Operands already allocated");
@ -190,12 +190,12 @@ public:
const auto &OE = cast<BasicExpression>(Other);
return getType() == OE.getType() && NumOperands == OE.NumOperands &&
std::equal(ops_begin(), ops_end(), OE.ops_begin());
std::equal(op_begin(), op_end(), OE.op_begin());
}
virtual hash_code getHashValue() const override {
return hash_combine(getExpressionType(), getOpcode(), ValueType,
hash_combine_range(ops_begin(), ops_end()));
hash_combine_range(op_begin(), op_end()));
}
//
@ -291,7 +291,7 @@ public:
virtual hash_code getHashValue() const override {
return hash_combine(getOpcode(), getType(), DefiningAccess,
hash_combine_range(ops_begin(), ops_end()));
hash_combine_range(op_begin(), op_end()));
}
//
@ -331,7 +331,7 @@ public:
virtual hash_code getHashValue() const override {
return hash_combine(getOpcode(), getType(), DefiningAccess,
hash_combine_range(ops_begin(), ops_end()));
hash_combine_range(op_begin(), op_end()));
}
//
@ -370,15 +370,15 @@ public:
typedef unsigned *int_arg_iterator;
typedef const unsigned *const_int_arg_iterator;
int_arg_iterator int_ops_begin() { return IntOperands; }
int_arg_iterator int_ops_end() { return IntOperands + NumIntOperands; }
const_int_arg_iterator int_ops_begin() const { return IntOperands; }
const_int_arg_iterator int_ops_end() const {
int_arg_iterator int_op_begin() { return IntOperands; }
int_arg_iterator int_op_end() { return IntOperands + NumIntOperands; }
const_int_arg_iterator int_op_begin() const { return IntOperands; }
const_int_arg_iterator int_op_end() const {
return IntOperands + NumIntOperands;
}
unsigned int_ops_size() const { return NumIntOperands; }
bool int_ops_empty() const { return NumIntOperands == 0; }
void int_ops_push_back(unsigned IntOperand) {
unsigned int_op_size() const { return NumIntOperands; }
bool int_op_empty() const { return NumIntOperands == 0; }
void int_op_push_back(unsigned IntOperand) {
assert(NumIntOperands < MaxIntOperands &&
"Tried to add too many int operands");
assert(IntOperands && "Operands not allocated before pushing");
@ -395,12 +395,12 @@ public:
return false;
const AggregateValueExpression &OE = cast<AggregateValueExpression>(Other);
return NumIntOperands == OE.NumIntOperands &&
std::equal(int_ops_begin(), int_ops_end(), OE.int_ops_begin());
std::equal(int_op_begin(), int_op_end(), OE.int_op_begin());
}
virtual hash_code getHashValue() const override {
return hash_combine(this->BasicExpression::getHashValue(),
hash_combine_range(int_ops_begin(), int_ops_end()));
hash_combine_range(int_op_begin(), int_op_end()));
}
//
@ -411,7 +411,7 @@ public:
OS << "ExpressionTypeAggregateValue, ";
this->BasicExpression::printInternal(OS, false);
OS << ", intoperands = {";
for (unsigned i = 0, e = int_ops_size(); i != e; ++i) {
for (unsigned i = 0, e = int_op_size(); i != e; ++i) {
OS << "[" << i << "] = " << IntOperands[i] << " ";
}
OS << "}";

View File

@ -403,9 +403,9 @@ PHIExpression *NewGVN::createPHIExpression(Instruction *I) {
if (I->getOperand(i) != I) {
const BasicBlockEdge BBE(B, PhiBlock);
auto Operand = lookupOperandLeader(I->getOperand(i), I, BBE);
E->ops_push_back(Operand);
E->op_push_back(Operand);
} else {
E->ops_push_back(I->getOperand(i));
E->op_push_back(I->getOperand(i));
}
}
return E;
@ -427,7 +427,7 @@ bool NewGVN::setBasicExpressionInfo(Instruction *I, BasicExpression *E,
auto Operand = lookupOperandLeader(O, I, B);
if (!isa<Constant>(Operand))
AllConstant = false;
E->ops_push_back(Operand);
E->op_push_back(Operand);
}
return AllConstant;
}
@ -448,8 +448,8 @@ const Expression *NewGVN::createBinaryExpression(unsigned Opcode, Type *T,
if (Arg1 > Arg2)
std::swap(Arg1, Arg2);
}
E->ops_push_back(lookupOperandLeader(Arg1, nullptr, B));
E->ops_push_back(lookupOperandLeader(Arg2, nullptr, B));
E->op_push_back(lookupOperandLeader(Arg1, nullptr, B));
E->op_push_back(lookupOperandLeader(Arg2, nullptr, B));
Value *V = SimplifyBinOp(Opcode, E->getOperand(0), E->getOperand(1), *DL, TLI,
DT, AC);
@ -572,7 +572,7 @@ const Expression *NewGVN::createExpression(Instruction *I,
return SimplifiedE;
} else if (isa<GetElementPtrInst>(I)) {
Value *V = SimplifyGEPInst(E->getType(),
ArrayRef<Value *>(E->ops_begin(), E->ops_end()),
ArrayRef<Value *>(E->op_begin(), E->op_end()),
*DL, TLI, DT, AC);
if (const Expression *SimplifiedE = checkSimplificationResults(E, I, V))
return SimplifiedE;
@ -604,7 +604,7 @@ NewGVN::createAggregateValueExpression(Instruction *I, const BasicBlock *B) {
E->allocateIntOperands(ExpressionAllocator);
for (auto &Index : II->indices())
E->int_ops_push_back(Index);
E->int_op_push_back(Index);
return E;
} else if (auto *EI = dyn_cast<ExtractValueInst>(I)) {
@ -614,7 +614,7 @@ NewGVN::createAggregateValueExpression(Instruction *I, const BasicBlock *B) {
E->allocateIntOperands(ExpressionAllocator);
for (auto &Index : EI->indices())
E->int_ops_push_back(Index);
E->int_op_push_back(Index);
return E;
}
llvm_unreachable("Unhandled type of aggregate value operation");
@ -673,7 +673,7 @@ LoadExpression *NewGVN::createLoadExpression(Type *LoadType, Value *PointerOp,
// Give store and loads same opcode so they value number together.
E->setOpcode(0);
auto Operand = lookupOperandLeader(PointerOp, LI, B);
E->ops_push_back(Operand);
E->op_push_back(Operand);
if (LI)
E->setAlignment(LI->getAlignment());
@ -693,7 +693,7 @@ const StoreExpression *NewGVN::createStoreExpression(StoreInst *SI,
// Give store and loads same opcode so they value number together.
E->setOpcode(0);
E->ops_push_back(lookupOperandLeader(SI->getPointerOperand(), SI, B));
E->op_push_back(lookupOperandLeader(SI->getPointerOperand(), SI, B));
// TODO: Value number heap versions. We may be able to discover
// things alias analysis can't on it's own (IE that a store and a
@ -756,7 +756,7 @@ const Expression *NewGVN::performSymbolicCallEvaluation(Instruction *I,
const Expression *NewGVN::performSymbolicPHIEvaluation(Instruction *I,
const BasicBlock *B) {
PHIExpression *E = cast<PHIExpression>(createPHIExpression(I));
if (E->ops_empty()) {
if (E->op_empty()) {
DEBUG(dbgs() << "Simplified PHI node " << *I << " to undef"
<< "\n");
E->deallocateOperands(ArgRecycler);