runtime: Fix type mismatches in VN
Value numbering can see through some forms of aliasing, but does not always account for type mismatches properly. One example of an incorrect behavior can be seen here: https://github.com/dotnet/runtime/pull/58309#issuecomment-907614688, there may be others.
Problematic places need to be investigated and fixed. A short-term solution could be to give up and give a “new, unique” VN upon seeing such casts, long-term we should consider using GT_BITCAST
as a VNFunc
for them, with support for folding (and delete assertion propagation code that expects these type mismatches), since, for better or worse, we have a strongly typed model in VN.
category:correctness theme:value-numbering skill-level:expert cost:small impact:small
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 3
- Comments: 15 (14 by maintainers)
Commits related to this issue
- Convert MemoryMarshal.GetArrayDataReference to a JIT intrinsic Converts MemoryMarshal.GetArrayDataReference to an always expand JIT intrinsic and removes the VM intrinsics. Introduces JIT tests vali... — committed to MichalPetryka/runtime by MichalPetryka 2 years ago
- Convert MemoryMarshal.GetArrayDataReference to a JIT intrinsic Converts MemoryMarshal.GetArrayDataReference to an always expand JIT intrinsic and removes the VM intrinsics. Introduces JIT tests vali... — committed to MichalPetryka/runtime by MichalPetryka 2 years ago
- Convert MemoryMarshal.GetArrayDataReference to a JIT intrinsic Converts MemoryMarshal.GetArrayDataReference to an always expand JIT intrinsic and removes the VM intrinsics. Introduces JIT tests vali... — committed to MichalPetryka/runtime by MichalPetryka 2 years ago
- Convert MemoryMarshal.GetArrayDataReference to a JIT intrinsic (#79760) * Convert MemoryMarshal.GetArrayDataReference to a JIT intrinsic Converts MemoryMarshal.GetArrayDataReference to an always ... — committed to dotnet/runtime by MichalPetryka a year ago
I couldn’t figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.