Description
With recent jump threading opt improvements, the JIT is able to remove most branches for the following code, but there's still some leftover can be cleanup:
class Program
{
void Test(int x)
{
if (x > 1)
{
if (x > 2)
{
if (x > 3)
{
if (x > 4)
{
Console.WriteLine(1);
}
}
}
}
}
}
Codegen:
Program:Test(int):this (FullOpts):
push rbp
mov rbp, rsp
cmp esi, 2 ; <-- redundant branch
jle SHORT G_M52364_IG03
cmp esi, 4
jg SHORT G_M52364_IG04
G_M52364_IG03: ;; offset=0x000E
pop rbp
ret
G_M52364_IG04: ;; offset=0x0010
mov edi, 1
pop rbp
tail.jmp [System.Console:WriteLine(int)]
Configuration
5b456ee1a58f672611dcf4a645f4c4ec5da4c996
Regression?
No
cc: @AndyAyersMS
Description
With recent jump threading opt improvements, the JIT is able to remove most branches for the following code, but there's still some leftover can be cleanup:
Codegen:
Configuration
5b456ee1a58f672611dcf4a645f4c4ec5da4c996
Regression?
No
cc: @AndyAyersMS