Recognize constant splat padded with undef in isCanonicalized.
Fcanonicalize will be removed by RemoveFcanonicalize in post-legalizer
combiner. We will treat undef as value that will result in a splat
in clamp combine after regbankselect.
Details
Diff Detail
Event Timeline
This is required to match splat that was padded with undef into clamp D90052. When undef is used to pad with element that does not affect the result we interpret it in a way to clamp other elements.
This at least needs a parameter to ignore undefs. It's not really true to the name of the function otherwise
matchUnaryPredicate already has an AllowUndefs argument, so you could do the same.
Incidentally ValueTracking's isKnownNeverNaN treats undef as not-nan, but only when it appears as an element of a vector constant.
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
9723 | What if SplatReg is a signaling nan here? |
Fix cases of SNaN and QNaN constant splats padded with undef, also add test for them.
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
9723 | What about NaNs? This seems like it should be combined with the G_FCONSTANT case above. |
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
9714 | If the matcher is finding it's a constant, why does it return the register instead of the direct APFloat? |
clang-tidy: error: no member named 'FCstOrSplatFCstRegMatch' in namespace 'llvm::MIPatternMatch' [clang-diagnostic-error]
not useful