Skip to content
  • Andrew Trick's avatar
    Made SCEV's UDiv expressions more canonical. When dividing a · 6d45a01b
    Andrew Trick authored
    recurrence, the initial values low bits can sometimes be ignored.
    
    To take advantage of this, added FoldIVUser to IndVarSimplify to fold
    an IV operand into a udiv/lshr if the operator doesn't affect the
    result.
    
    -indvars -disable-iv-rewrite now transforms
    
    i = phi i4
    i1 = i0 + 1
    idx = i1 >> (2 or more)
    i4 = i + 4
    
    into
    
    i = phi i4
    idx = i0 >> ...
    i4 = i + 4
    
    llvm-svn: 137013
    6d45a01b
Loading