This patch extends the various "isXXX" functions of the Constant class
to include scalable-vector splats.
In several "isXXX" functions, code that was separately inspecting
ConstantVector and ConstantDataVector was unified to use
getSplatValue, which already includes support for said splats.
In the varous "isNotXXX" functions, code was added to check whether the
scalar splat value -- if any -- satisfies the predicate.
An extra fix for isNotMinSignedValue was included, as it previously
crashed when passed a scalable-vector type because it unconditionally
cast to FixedVectorType
These changes address numerous missed optimizations, a compiler crash
mentioned above and -- perhaps most egregiously -- an infinite loop in
InstCombine due to the compiler breaking canonical form when it failed
to pick up on a splat in a select instruction.
Test cases have been added to cover as many of these functions as
possible, though existing coverage is slim; it doesn't appear that there
are any in-tree uses of Constant::isNegativeZeroValue, for example.
I'm not really convinced it'd make a difference but we're not consistent at checking for splats before/after the FixedVectorType only tests - do you think we should be?