[release/6.0] JIT: don't clone loops where init or limit is a cast local (#57685)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 19 Aug 2021 14:20:23 +0000 (07:20 -0700)
committerGitHub <noreply@github.com>
Thu, 19 Aug 2021 14:20:23 +0000 (07:20 -0700)
commit5d0820af5eac70f95d1395d60cb000e4fb08a49b
tree3061ec395fc30b71aa5009ee915fd6565fcdcb65
parent9e56917546210a649262af4d1616f52553253a11
[release/6.0] JIT: don't clone loops where init or limit is a cast local (#57685)

* JIT: don't clone loops where init or limit is a cast local

The loop cloner assumes all computations it introduces are compatible
with TYP_INT, so don't allow cloning when the initial or final value
are variables with incompatible types.

Fixes #57535.

* Apply suggestions from code review

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Co-authored-by: Andy Ayers <andya@microsoft.com>
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
src/coreclr/jit/loopcloning.cpp
src/tests/JIT/Regression/JitBlue/Runtime_57535/Runtime_57535.cs [new file with mode: 0644]
src/tests/JIT/Regression/JitBlue/Runtime_57535/Runtime_57535.csproj [new file with mode: 0644]
src/tests/JIT/Regression/JitBlue/Runtime_57535/Runtime_57535_1.cs [new file with mode: 0644]
src/tests/JIT/Regression/JitBlue/Runtime_57535/Runtime_57535_1.csproj [new file with mode: 0644]