If the immediate doen't fit int32 but fits uint32, which means the sign bit is 1. If we use LI/LIS to load the high bits, LIS/LI will sign-extend the value, where an extra clrldi is necessary. However if its low bits fits int16, we can use LI to load the low bits then handle the high bits.
For example, currently we need 3 instructions for i32 -394967296
lis 3, 232 ori 3, 3, 30023 sldi 3, 3, 8
After this patch we get,
li 3, 18176 oris 3, 3, 59509
s/doen't/doesn't
s/fits/fits in
s/which means/this means