HomePhabricator

[X86] Match (cmp (and (shr X, C), mask), 0) to BEXTR+TEST.

Authored by craig.topper on Oct 16 2018, 3:29 PM.

Description

[X86] Match (cmp (and (shr X, C), mask), 0) to BEXTR+TEST.

Without this we match the CMP+AND to a TEST and then match the SHR separately. I'm trusting analyzeCompare to remove the TEST during the peephole pass. Otherwise we need to check the flag users to see if they only use the Z flag.

This recovers a case lost by r344270.

Differential Revision: https://reviews.llvm.org/D53310

llvm-svn: 344649

Details

Committed
craig.topperOct 16 2018, 3:29 PM
Differential Revision
D53310: [X86] Match (cmp (and (shr X, C), mask), 0) to BEXTR+TEST.
Parents
rGaf67fe6aef3b: Delete commented-out code.
Branches
Unknown
Tags
Unknown