forked from OSchip/llvm-project
				
			More heuristics for Combiner-AA. Still catches all important cases, but
compile time penalty on gnugo, the worst case in MultiSource, is down to about 2.5% from 30% llvm-svn: 83824
This commit is contained in:
		
							parent
							
								
									8227b0512f
								
							
						
					
					
						commit
						a3ed9edd40
					
				| 
						 | 
				
			
			@ -6230,6 +6230,7 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain,
 | 
			
		|||
 | 
			
		||||
  // Starting off.
 | 
			
		||||
  Chains.push_back(OriginalChain);
 | 
			
		||||
  unsigned Depth = 0;
 | 
			
		||||
  
 | 
			
		||||
  // Look at each chain and determine if it is an alias.  If so, add it to the
 | 
			
		||||
  // aliases list.  If not, then continue up the chain looking for the next
 | 
			
		||||
| 
						 | 
				
			
			@ -6238,6 +6239,20 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain,
 | 
			
		|||
    SDValue Chain = Chains.back();
 | 
			
		||||
    Chains.pop_back();
 | 
			
		||||
    
 | 
			
		||||
    // For TokenFactor nodes, look at each operand and only continue up the 
 | 
			
		||||
    // chain until we find two aliases.  If we've seen two aliases, assume we'll 
 | 
			
		||||
    // find more and revert to original chain since the xform is unlikely to be
 | 
			
		||||
    // profitable.
 | 
			
		||||
    // 
 | 
			
		||||
    // FIXME: The depth check could be made to return the last non-aliasing 
 | 
			
		||||
    // chain we found before we hit a tokenfactor rather than the original
 | 
			
		||||
    // chain.
 | 
			
		||||
    if (Depth > 6 || Aliases.size() == 2) {
 | 
			
		||||
      Aliases.clear();
 | 
			
		||||
      Aliases.push_back(OriginalChain);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Don't bother if we've been before.
 | 
			
		||||
    if (!Visited.insert(Chain.getNode()))
 | 
			
		||||
      continue;
 | 
			
		||||
| 
						 | 
				
			
			@ -6268,8 +6283,7 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain,
 | 
			
		|||
      } else {
 | 
			
		||||
        // Look further up the chain.
 | 
			
		||||
        Chains.push_back(Chain.getOperand(0));
 | 
			
		||||
        // Clean up old chain.
 | 
			
		||||
        AddToWorkList(Chain.getNode());
 | 
			
		||||
        ++Depth;
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -6285,8 +6299,7 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain,
 | 
			
		|||
      }
 | 
			
		||||
      for (unsigned n = Chain.getNumOperands(); n;)
 | 
			
		||||
        Chains.push_back(Chain.getOperand(--n));
 | 
			
		||||
      // Eliminate the token factor if we can.
 | 
			
		||||
      AddToWorkList(Chain.getNode());
 | 
			
		||||
      ++Depth;
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    default:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue