mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	Do not create ridiculously huge DSNodes, as described in the comments.
This speeds up the BU pass on 172.mgrid from 62.3 -> 0.1242s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20648 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -382,13 +382,23 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
 | 
				
			|||||||
    // question....
 | 
					    // question....
 | 
				
			||||||
    assert(Offset == 0 && !isArray() &&
 | 
					    assert(Offset == 0 && !isArray() &&
 | 
				
			||||||
           "Cannot have an offset into a void node!");
 | 
					           "Cannot have an offset into a void node!");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // If this node would have to have an unreasonable number of fields, just
 | 
				
			||||||
 | 
					    // collapse it.  This can occur for fortran common blocks, which have stupid
 | 
				
			||||||
 | 
					    // things like { [100000000 x double], [1000000 x double] }.
 | 
				
			||||||
 | 
					    unsigned NumFields = (NewTySize+DS::PointerSize-1) >> DS::PointerShift;
 | 
				
			||||||
 | 
					    if (NumFields > 64) {
 | 
				
			||||||
 | 
					      foldNodeCompletely();
 | 
				
			||||||
 | 
					      return true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Ty = NewTy;
 | 
					    Ty = NewTy;
 | 
				
			||||||
    NodeType &= ~Array;
 | 
					    NodeType &= ~Array;
 | 
				
			||||||
    if (WillBeArray) NodeType |= Array;
 | 
					    if (WillBeArray) NodeType |= Array;
 | 
				
			||||||
    Size = NewTySize;
 | 
					    Size = NewTySize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Calculate the number of outgoing links from this node.
 | 
					    // Calculate the number of outgoing links from this node.
 | 
				
			||||||
    Links.resize((Size+DS::PointerSize-1) >> DS::PointerShift);
 | 
					    Links.resize(NumFields);
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -418,6 +428,16 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
 | 
				
			|||||||
    Ty = NewTy;
 | 
					    Ty = NewTy;
 | 
				
			||||||
    NodeType &= ~Array;
 | 
					    NodeType &= ~Array;
 | 
				
			||||||
    if (WillBeArray) NodeType |= Array;
 | 
					    if (WillBeArray) NodeType |= Array;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // If this node would have to have an unreasonable number of fields, just
 | 
				
			||||||
 | 
					    // collapse it.  This can occur for fortran common blocks, which have stupid
 | 
				
			||||||
 | 
					    // things like { [100000000 x double], [1000000 x double] }.
 | 
				
			||||||
 | 
					    unsigned NumFields = (NewTySize+DS::PointerSize-1) >> DS::PointerShift;
 | 
				
			||||||
 | 
					    if (NumFields > 64) {
 | 
				
			||||||
 | 
					      foldNodeCompletely();
 | 
				
			||||||
 | 
					      return true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Size = NewTySize;
 | 
					    Size = NewTySize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Must grow links to be the appropriate size...
 | 
					    // Must grow links to be the appropriate size...
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user