Gtneg mul divoptimizations (#45604)
authorAlex Covington <68252706+alexcovington@users.noreply.github.com>
Tue, 12 Jan 2021 02:30:28 +0000 (18:30 -0800)
committerGitHub <noreply@github.com>
Tue, 12 Jan 2021 02:30:28 +0000 (18:30 -0800)
commitf9cf60113cf8734235ed42cd6a15218cdcc625d3
tree339a93ed6919601821465eb2ed6766acc98d8028
parent0fd7a3ff00d0421bf3cbb31edbac005b95e49ffc
Gtneg mul divoptimizations (#45604)

* GT_NEG optimization for multiplication and division

* Distribute negation over parenthetical multiplication or division.

* Removing duplicate logic that I had put in accidently.

* Check overflow and other conditions before performing morph

* Resolved merge conflict and cleanup morph.cpp

* Formatting morph.cpp

* Returning tree after performing smpop again to fix flags

* Formatting

* Added check for optimizations, formatting.

* Using gtIsActiveCSE_Candidate instead of fgGlobalMorph

* Update src/coreclr/jit/morph.cpp

Co-authored-by: Sergey Andreenko <seandree@microsoft.com>
* Formatting

* delete formatting changes.

* Add a test.

* Change the conditions a bit.

* Better names for the tests.

Co-authored-by: Sergey Andreenko <seandree@microsoft.com>
src/coreclr/jit/morph.cpp
src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.cs [new file with mode: 0644]
src/tests/JIT/opt/InstructionCombining/NegMulOrDivToConst.csproj [new file with mode: 0644]