Skip to content
  • Timothy Arceri's avatar
    nir: add helper to return inversion op of a comparison · f219f611
    Timothy Arceri authored
    
    
    This will be used to help find the trip count of loops that look
    like the following:
    
       while (a < x && i < 8) {
          ...
          i++;
       }
    
    Where the NIR will end up looking something like this:
    
       vec1 32 ssa_1 = load_const (0x00000004 /* 0.000000 */)
       loop {
          ...
          vec1 1 ssa_12 = ilt ssa_225, ssa_11
          vec1 1 ssa_17 = ilt ssa_226, ssa_1
          vec1 1 ssa_18 = iand ssa_12, ssa_17
          vec1 1 ssa_19 = inot ssa_18
    
          if ssa_19 {
             ...
             break
          } else {
             ...
          }
       }
    
    So in order to find the trip count we need to find the inverse of
    ilt.
    
    Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
    f219f611