-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 SuperPMIin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Filed for #96773
JIT doesn't see real type of the arr field and doesn't fold the condition.
public class MyList<T>
{
public T[] arr;
}
bool Test(MyList<string> list) => list.arr.GetType() == typeof(string[]);Current codegen for Test:
; Method Program:Foo(MyList`1[System.String]):ubyte:this (FullOpts)
G_M55733_IG01:
G_M55733_IG02:
mov rax, gword ptr [rdx+0x08]
mov rcx, 0xD1FFAB1E ; System.String[]
cmp qword ptr [rax], rcx
sete al
movzx rax, al
G_M55733_IG03:
ret
; Total bytes of code: 24Expected codegen:
nullchecks
return true;
MineCake147E
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 SuperPMIin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged