Handle more scenarios for loop cloning (#67930)
authorKunal Pathak <Kunal.Pathak@microsoft.com>
Tue, 26 Apr 2022 15:58:43 +0000 (08:58 -0700)
committerGitHub <noreply@github.com>
Tue, 26 Apr 2022 15:58:43 +0000 (08:58 -0700)
commit1bc09e76f04950212a994bf9dcce1d764e803ec8
tree91e9b3110d5633b3b630780387b6f5f887697e6e
parent2ea67f1f42e8170676c9e9591a974e39513390db
Handle more scenarios for loop cloning (#67930)

* Handle following scenarios for loop cloning:

- Increasing loops that are incremented by more than 1 like "i += 2"
- Decreasing loops like "i--", "i -= 2"

* jit format

* Make the loop cloning condition tighter

* check for stride

* Add a check for stride edge scenario

* Add test case

* Review feedback
src/coreclr/jit/compiler.h
src/coreclr/jit/compiler.hpp
src/coreclr/jit/loopcloning.cpp
src/tests/JIT/Directed/Arrays/LoopCloning.cs [new file with mode: 0644]
src/tests/JIT/Directed/Arrays/LoopCloning.csproj [new file with mode: 0644]