forked from OSchip/llvm-project
				
			DAGCombine should not produce ISD::OR nodes after operation legalization if they're not legal.
llvm-svn: 200503
This commit is contained in:
		
							parent
							
								
									4ece7452ba
								
							
						
					
					
						commit
						60a4678c42
					
				| 
						 | 
				
			
			@ -1544,8 +1544,10 @@ SDValue DAGCombiner::visitADD(SDNode *N) {
 | 
			
		|||
 | 
			
		||||
      // If all possibly-set bits on the LHS are clear on the RHS, return an OR.
 | 
			
		||||
      // If all possibly-set bits on the RHS are clear on the LHS, return an OR.
 | 
			
		||||
      if ((RHSZero & ~LHSZero) == ~LHSZero || (LHSZero & ~RHSZero) == ~RHSZero)
 | 
			
		||||
        return DAG.getNode(ISD::OR, SDLoc(N), VT, N0, N1);
 | 
			
		||||
      if ((RHSZero & ~LHSZero) == ~LHSZero || (LHSZero & ~RHSZero) == ~RHSZero){
 | 
			
		||||
        if (!LegalOperations || TLI.isOperationLegal(ISD::OR, VT))
 | 
			
		||||
          return DAG.getNode(ISD::OR, SDLoc(N), VT, N0, N1);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue