Skip to content

JIT: Optimize simple MUL/DIV arithmetic with GT_NEG #44375

@JulieLeeMSFT

Description

@JulieLeeMSFT

This is part 2 of #13837 to optimize multiplication and division arithmetic optimizations with GT_NEG.
Addition and subtraction have been completed in PR #43921.

int M5(int a) =>  -a / 10;  // optimize to  "a / -10"
int M6(int a) => -(a / 10); // optimize to  "a / -10"
int M7(int a) =>  -a * 10;  // optimize to  "a * -10"
int M8(int a) => -(a * 10); // optimize to  "a * -10"

category:cq
theme:basic-cq
skill-level:beginner
cost:small

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributorsoptimization

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions