This is an archive of the discontinued LLVM Phabricator instance.

[X86] Prevent LowerSELECT from causing suboptimal codegen for __builtn_ffs(X) - 1.
ClosedPublic

Authored by craig.topper on Jun 5 2020, 3:31 PM.

Details

Summary

LowerSELECT sees the CMP with 0 and wants to use a trick with SUB
and SBB. But we can use the flags from the BSF/TZCNT.

Fixes PR46203.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 5 2020, 3:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2020, 3:31 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.Jun 8 2020, 1:24 AM

LGTM

This revision is now accepted and ready to land.Jun 8 2020, 1:24 AM
This revision was automatically updated to reflect the committed changes.