-
Couldn't load subscription status.
- Fork 5.2k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization
Milestone
Description
static uint i4(uint i) {
return i + i + i + i;
}Above code should obviously be return 4 * i, but today if we see something like this, we don't optimize it that way and perform add operations. We could optimize it to lsl if adds are performed in power of 2.
Today we generate:
G_M48040_IG02:
0B000001 add w1, w0, w0
0B000021 add w1, w1, w0
0B000020 add w0, w1, w0We should generate:
531E7400 lsl w0, w0, #2We never optimize even for 8 or 16 operations and thus emitting series of add operations.
category:cq
theme:basic-cq
skill-level:intermediate
cost:medium
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization