Skip to content

nir: Add optimizations for comparisons of up-casted values

Many times when we have a comparison of an up-casted value, we can drop the cast and just compare the smaller value. This is certainly true if both values in the comparison are up-casts of the same size value and the sign of the comparison matches the sign of the cast. However, there are a bunch more cases where we can get clever and shrink the comparison.

Edited by Faith Ekstrand

Merge request reports