From c6e5fa688a1a93f91045615beec6235704a4110e Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Sun, 25 Dec 2016 22:10:37 +0000 Subject: [PATCH] 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 --- .../llvm/Transforms/Scalar/GVNExpression.h | 48 +++++++++---------- lib/Transforms/Scalar/NewGVN.cpp | 22 ++++----- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/include/llvm/Transforms/Scalar/GVNExpression.h b/include/llvm/Transforms/Scalar/GVNExpression.h index dd8a23ca83e..cdde5106c65 100644 --- a/include/llvm/Transforms/Scalar/GVNExpression.h +++ b/include/llvm/Transforms/Scalar/GVNExpression.h @@ -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 operands() { - return iterator_range(ops_begin(), ops_end()); + return iterator_range(op_begin(), op_end()); } - iterator_range operands() const { - return iterator_range(ops_begin(), ops_end()); + iterator_range operands() const { + return iterator_range(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(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(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 << "}"; diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index 0fa7181c489..b43cb28eafa 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -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(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(I)) { Value *V = SimplifyGEPInst(E->getType(), - ArrayRef(E->ops_begin(), E->ops_end()), + ArrayRef(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(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(createPHIExpression(I)); - if (E->ops_empty()) { + if (E->op_empty()) { DEBUG(dbgs() << "Simplified PHI node " << *I << " to undef" << "\n"); E->deallocateOperands(ArgRecycler);