We can already calculate nowrap flags based on range information in proveNoWrapViaConstantRanges(). However, because this happens separately from the range calculation, we lose some information and produce less precise results. Moving the nowrap flag calculation into getRangeRef() allows us to retain full precision.
This is semantically ugly in that quality of nowrap flags depends on whether the range was calculated or not. Of course, this is nothing new, e.g. the code this replaces was adding nowrap flags only when an addrec was zexted/sexted.
I understand why the union will retain nsw in this case, but what about nuw? See example in my comment below.