runtime: JIT: nullcheck is not folded for PHI
Seems like global assertprop bails out on the following snippet
bool Test(bool cond)
{
object tmp;
if (cond)
tmp = "1111";
else
tmp = "2222";
return tmp != null;
}
Current codegen:
; Assembly listing for method Proga:Test(ubyte):ubyte (FullOpts)
G_M26246_IG01: ;; offset=0x0000
G_M26246_IG02: ;; offset=0x0000
mov rax, 0x20000209798 ; '2222'
mov rdx, 0x200002097B8 ; '1111'
test cl, cl
cmovne rax, rdx
test rax, rax
setne al
movzx rax, al
G_M26246_IG03: ;; offset=0x0023
ret
Expected codegen:
; Assembly listing for method Proga:Test(ubyte):ubyte (FullOpts)
G_M26246_IG01: ;; offset=0x0000
G_M26246_IG02: ;; offset=0x0000
mov eax, 1
G_M26246_IG03: ;; offset=0x0023
ret
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (11 by maintainers)
@EgorBot -arm64 -intel -profiler -commit main
@EgorBot -arm64 -profiler -commit main
@EgorBot -intel -arm64 -profiler -commit main
@EgorBot -intel -profiler -keep -commit main --envvars “DOTNET_JitDisasm:GetType_”
@EgorBot -intel -profiler -keep -commit main --envvars “DOTNET_JitDisasm:GetType_”
@EgorBot -intel -arm64 -profiler -commit main
@EgorBot -intel -profiler -keep -commit main --envvars “DOTNET_JitDisasm:GetType_”
@EgorBot -intel -arm64 -profiler -commit main
@EgorBot -intel -arm
@EgorBot -intel --runtimes net9.0 net8.0 net7.0 --disasm --envvars DOTNET_ReadyToRun:0