[llvm] r290524 - Rename GVNExpression *ops_ members to *op_* to match conventions in the rest of LLVM
Daniel Berlin via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 25 14:10:37 PST 2016
Author: dannyb
Date: Sun Dec 25 16:10:37 2016
New Revision: 290524
URL: http://llvm.org/viewvc/llvm-project?rev=290524&view=rev
Log:
Rename GVNExpression *ops_ members to *op_* to match conventions in the rest of LLVM
Modified:
llvm/trunk/include/llvm/Transforms/Scalar/GVNExpression.h
llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
Modified: llvm/trunk/include/llvm/Transforms/Scalar/GVNExpression.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/GVNExpression.h?rev=290524&r1=290523&r2=290524&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Scalar/GVNExpression.h (original)
+++ llvm/trunk/include/llvm/Transforms/Scalar/GVNExpression.h Sun Dec 25 16:10:37 2016
@@ -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 << "}";
Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=290524&r1=290523&r2=290524&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Sun Dec 25 16:10:37 2016
@@ -403,9 +403,9 @@ PHIExpression *NewGVN::createPHIExpressi
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(Inst
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::createBinaryEx
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::createExpressi
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(I
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(I
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::createLoadExpres
// 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::createSto
// 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::performSymboli
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);
More information about the llvm-commits
mailing list