Move and-cmp-nonzero transform from TreeNodeInfoInitCmp to LowerCompare
authorMike Danes <onemihaid@hotmail.com>
Sat, 17 Dec 2016 18:26:13 +0000 (20:26 +0200)
committerMike Danes <onemihaid@hotmail.com>
Tue, 17 Jan 2017 18:25:19 +0000 (20:25 +0200)
commit20cb098528bdd950a12d9c1707211cf3a9cc9573
tree029aae4d8bee5586cefa3c5176cfb001cad8d14e
parent72e717ca2ec06a95194711f7dd144a5b38b85bec
Move and-cmp-nonzero transform from TreeNodeInfoInitCmp to LowerCompare

FX diff shows a 34 byte improvement without any regressions. In the original code this transform was unnecessarily blocked by an uncontainable GT_AND bit mask:

mov      rax, 0x80000000
and      rax, qword ptr [rsp+08H]
mov      rdx, 0x80000000
cmp      rax, rdx
sete    al

now generates

mov      rax, 0x8000000000000000
and      rax, qword ptr [rsp+08H]
setne    al

Commit migrated from https://github.com/dotnet/coreclr/commit/e74c08ecdde10a84af4fa555efbd925f2cc08547
src/coreclr/src/jit/lower.cpp
src/coreclr/src/jit/lowerxarch.cpp