llvm.org GIT mirror llvm / 521a69f
Add ops() method to SDNode that returns an ArrayRef<SDUse>. Use it to simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211993 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 5 years ago
4 changed file(s) with 10 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
592592 typedef SDUse* op_iterator;
593593 op_iterator op_begin() const { return OperandList; }
594594 op_iterator op_end() const { return OperandList+NumOperands; }
595 ArrayRef ops() const { return makeArrayRef(op_begin(), op_end()); }
595596
596597 SDVTList getVTList() const {
597598 SDVTList X = { ValueList, NumValues };
556556 // Add the return value info.
557557 AddNodeIDValueTypes(ID, N->getVTList());
558558 // Add the operand info.
559 AddNodeIDOperands(ID, makeArrayRef(N->op_begin(), N->op_end()));
559 AddNodeIDOperands(ID, N->ops());
560560
561561 // Handle SDNode leafs with special info.
562562 AddNodeIDCustom(ID, N);
73367336 if (!Visited.count(ChainLD->getChain().getNode()))
73377337 Queue.push_back(ChainLD->getChain().getNode());
73387338 } else if (ChainNext->getOpcode() == ISD::TokenFactor) {
7339 for (SDNode::op_iterator O = ChainNext->op_begin(),
7340 OE = ChainNext->op_end(); O != OE; ++O)
7341 if (!Visited.count(O->getNode()))
7342 Queue.push_back(O->getNode());
7339 for (const SDUse &O : ChainNext->ops())
7340 if (!Visited.count(O.getNode()))
7341 Queue.push_back(O.getNode());
73437342 } else
73447343 LoadRoots.insert(ChainNext);
73457344 }
82358234 ++UI;
82368235
82378236 SmallVector Ops;
8238 for (SDNode::op_iterator O = User->op_begin(),
8239 OE = User->op_end(); O != OE; ++O) {
8240 if (*O == Use)
8237 for (const SDUse &O : User->ops()) {
8238 if (O == Use)
82418239 Ops.push_back(To);
82428240 else
8243 Ops.push_back(*O);
8241 Ops.push_back(O);
82448242 }
82458243
82468244 DAG.UpdateNodeOperands(User, Ops);
21772177 SDValue FakeOp;
21782178
21792179 std::vector Ops;
2180 for(SDNode::op_iterator I = Node->op_begin(), E = Node->op_end();
2181 I != E; ++I)
2182 Ops.push_back(*I);
2180 for (const SDUse &I : Node->ops())
2181 Ops.push_back(I);
21832182
21842183 if (Opcode == AMDGPU::DOT_4) {
21852184 int OperandIdx[] = {