This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add BLSI to isUseDefConvertible.
ClosedPublic

Authored by craig.topper on Jun 19 2019, 11:58 PM.

Details

Summary

BLSI sets the C flag is the input is not zero. So if its followed
by a TEST of the input where only the Z flag is consumed, we can
replace it with the opposite check of the C flag.

We should be able to do the same for BLSMSK and BLSR, but the
naive test case for those is being optimized to a subo by
CodeGenPrepare.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jun 19 2019, 11:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2019, 11:58 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.Jun 20 2019, 6:01 AM

LGTM

llvm/lib/Target/X86/X86InstrInfo.cpp
3374 ↗(On Diff #205742)

Add TODO for BLSMSK and BLSR

This revision is now accepted and ready to land.Jun 20 2019, 6:01 AM
This revision was automatically updated to reflect the committed changes.