Move and-cmp-test transform from TreeNodeInfoInitCmp to LowerCompare
authorMike Danes <onemihaid@hotmail.com>
Sat, 17 Dec 2016 19:51:59 +0000 (21:51 +0200)
committerMike Danes <onemihaid@hotmail.com>
Tue, 17 Jan 2017 18:25:20 +0000 (20:25 +0200)
commite6586410f29659ad57a95a98f6daa4a5f49ef070
tree811eb99f0beab3a77c4882cfb314d8c9eee83e0c
parentdfbd3a933ed0ec2897d7a64bf4e1ea63f5a05bfa
Move and-cmp-test transform from TreeNodeInfoInitCmp to LowerCompare

FX diff shows a 32 bytes improvement without any regressions. Previously the first GT_AND operand wasn't marked reg optional and sometimes it ended up being loaded into a register:

mov      eax, dword ptr [rsp+B0H]
test     eax, 1

Not anymore:

test     dword ptr [rsp+B0H], 1

Also, we now generate TEST instead of AND even in cases where the second AND operand isn't a containable constant.

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