area-CodeGen-coreclrhelp wanted
倉庫指標
- Star
- (17,886 star)
- PR 合併指標
- (平均合併 12天 11小時) (30 天內合併 661 個 PR)
描述
public static void TestBoolAsg(int a, int b, int c, ref bool z)
{
z = a == 0 && b == 0 && c == 0;
}
When comparing the JIT output to this:
public static bool TestBoolReturn(int a, int b, int c)
{
return a == 0 && b == 0 && c == 0;
}
TestBoolAsg is as not as optimized as TestBoolReturn:
// TestBoolAsg
G_M56616_IG02: ;; offset=0000H
0BD1 or edx, ecx
750A jne SHORT G_M56616_IG04
;; size=4 bbWeight=1 PerfScore 1.25
G_M56616_IG03: ;; offset=0004H
33C0 xor eax, eax
4585C0 test r8d, r8d
0F94C0 sete al
EB02 jmp SHORT G_M56616_IG05
;; size=10 bbWeight=0.50 PerfScore 1.75
G_M56616_IG04: ;; offset=000EH
33C0 xor eax, eax
;; size=2 bbWeight=0.50 PerfScore 0.12
G_M56616_IG05: ;; offset=0010H
418801 mov byte ptr [r9], al
;; size=3 bbWeight=1 PerfScore 1.00
G_M56616_IG06: ;; offset=0013H
C3 ret
vs.
// TestBoolReturn
G_M58330_IG02: ;; offset=0000H
0BD1 or edx, ecx
410BD0 or edx, r8d
0F94C0 sete al
0FB6C0 movzx rax, al
;; size=11 bbWeight=1 PerfScore 1.75
G_M58330_IG03: ;; offset=000BH
C3 ret