HomePhabricator

[X86] Use parity flag from byte test/cmp instruction for __builtin_parity when…

Authored by craig.topper on Aug 2 2020, 9:58 AM.

Description

[X86] Use parity flag from byte test/cmp instruction for __builtin_parity when input fits in 8 bits.

If the upper bits of the __builtin_parity idiom are known to be
0 we were previously emitting an xor with 0 to get the parity flag.
But we can use cmp/test instead which may expose opportunities for
load folding or combining an AND.

Details

Committed
craig.topperAug 2 2020, 10:45 AM
Parents
rGa258338d6271: [X86] Add test cases for missed opportunity to use a byte test instruction…
Branches
Unknown
Tags
Unknown