Ensure that we are correctly typing simd comparison nodes#105883
Ensure that we are correctly typing simd comparison nodes#105883tannergooding merged 1 commit intodotnet:mainfrom
Conversation
|
cc @dotnet/jit-contrib this is ready for review and resolves #105623 |
| if (lookupType != retType) | ||
| { | ||
| assert(varTypeIsMask(lookupType)); | ||
| tree->gtType = lookupType; |
There was a problem hiding this comment.
Why is it ok to retype tree to a mask type here if it didn't start out as a mask type? Won't the parent node be expecting a non-mask type?
There was a problem hiding this comment.
Because we're inserting and returning the CvtMaskToVector below if the final tree produced by morph ends up mismatching.
We don't insert it here because we still want to try and fold and finish morphing the new comparison node in case other optimizations are available.
There's many morph paths that return new nodes, so this should be no different.
There was a problem hiding this comment.
We make this transform, we try to fold, we try to optimize, and then we insert the CvtMaskToVector in the case the expected and actual return types mismatch (with assert that they mismatch because the actual is mask and expected is simd).
This fixes #105623