-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 SuperPMItenet-performancePerformance related issuePerformance related issue
Milestone
Description
.assembly extern System.Runtime { }
.assembly byrefmath { }
.class private sequential ansi sealed beforefieldinit Foo
extends [System.Runtime]System.ValueType
{
.field public int32 X
.field public int32 Y
}
.method public hidebysig static int32 Main() cil managed
{
.locals init (valuetype Foo)
.entrypoint
ldloca 0
ldflda int32 Foo::Y
ldloca 0
sub
ret
}
This should be possible to evaluate to a constant because the result is known at compile time. RyuJIT currently generates:
G_M30739_IG01:
50 push rax
33C0 xor rax, rax
48890424 mov qword ptr [rsp], rax
G_M30739_IG02:
488D442404 lea rax, bword ptr [rsp+04H]
488D1424 lea rdx, bword ptr [rsp]
482BC2 sub rax, rdx
G_M30739_IG03:
4883C408 add rsp, 8
C3 retcategory:cq
theme:basic-cq
skill-level:intermediate
cost:small
Reactions are currently unavailable
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 SuperPMItenet-performancePerformance related issuePerformance related issue