mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
[c++11] Range'ify use list loops in DAGCombiner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206014 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a117c712c7
commit
84f004436a
@ -120,9 +120,8 @@ namespace {
|
||||
/// now.
|
||||
///
|
||||
void AddUsersToWorkList(SDNode *N) {
|
||||
for (SDNode::use_iterator UI = N->use_begin(), UE = N->use_end();
|
||||
UI != UE; ++UI)
|
||||
AddToWorkList(*UI);
|
||||
for (SDNode *Node : N->uses())
|
||||
AddToWorkList(Node);
|
||||
}
|
||||
|
||||
/// visit - call the node-specific routine that knows how to fold each
|
||||
@ -7622,9 +7621,7 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
|
||||
// a copy of the original base pointer.
|
||||
SmallVector<SDNode *, 16> OtherUses;
|
||||
if (isa<ConstantSDNode>(Offset))
|
||||
for (SDNode::use_iterator I = BasePtr.getNode()->use_begin(),
|
||||
E = BasePtr.getNode()->use_end(); I != E; ++I) {
|
||||
SDNode *Use = *I;
|
||||
for (SDNode *Use : BasePtr.getNode()->uses()) {
|
||||
if (Use == Ptr.getNode())
|
||||
continue;
|
||||
|
||||
@ -7666,9 +7663,7 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
|
||||
SmallPtrSet<const SDNode *, 32> Visited;
|
||||
SmallVector<const SDNode *, 16> Worklist;
|
||||
|
||||
for (SDNode::use_iterator I = Ptr.getNode()->use_begin(),
|
||||
E = Ptr.getNode()->use_end(); I != E; ++I) {
|
||||
SDNode *Use = *I;
|
||||
for (SDNode *Use : Ptr.getNode()->uses()) {
|
||||
if (Use == N)
|
||||
continue;
|
||||
if (N->hasPredecessorHelper(Use, Visited, Worklist))
|
||||
@ -7804,9 +7799,7 @@ bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
|
||||
if (Ptr.getNode()->hasOneUse())
|
||||
return false;
|
||||
|
||||
for (SDNode::use_iterator I = Ptr.getNode()->use_begin(),
|
||||
E = Ptr.getNode()->use_end(); I != E; ++I) {
|
||||
SDNode *Op = *I;
|
||||
for (SDNode *Op : Ptr.getNode()->uses()) {
|
||||
if (Op == N ||
|
||||
(Op->getOpcode() != ISD::ADD && Op->getOpcode() != ISD::SUB))
|
||||
continue;
|
||||
@ -7832,9 +7825,7 @@ bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
|
||||
|
||||
// Check for #1.
|
||||
bool TryNext = false;
|
||||
for (SDNode::use_iterator II = BasePtr.getNode()->use_begin(),
|
||||
EE = BasePtr.getNode()->use_end(); II != EE; ++II) {
|
||||
SDNode *Use = *II;
|
||||
for (SDNode *Use : BasePtr.getNode()->uses()) {
|
||||
if (Use == Ptr.getNode())
|
||||
continue;
|
||||
|
||||
@ -7842,9 +7833,7 @@ bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
|
||||
// transformation.
|
||||
if (Use->getOpcode() == ISD::ADD || Use->getOpcode() == ISD::SUB){
|
||||
bool RealUse = false;
|
||||
for (SDNode::use_iterator III = Use->use_begin(),
|
||||
EEE = Use->use_end(); III != EEE; ++III) {
|
||||
SDNode *UseUse = *III;
|
||||
for (SDNode *UseUse : Use->uses()) {
|
||||
if (!canFoldInAddressingMode(Use, UseUse, DAG, TLI))
|
||||
RealUse = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user