Any of the `zext` bits in a `zext nneg` can be converted to `sext` but when checking if casts are compatible `BasicAA` fails to take into account `nneg`. This change adds tracking of `nneg` to the `CastedValue` struct and ensures that `sext` and `zext` bits are treated as interchangeable when either `CastedValue` has a `nneg`. When distributing casted values in `GetLinearExpression` we conservatively discard the `nneg` from the `CastedValue`, except in the case of `shl nsw`, where we know the sign has not changed to negative.
76 KiB
76 KiB