This is an archive of the discontinued LLVM Phabricator instance.

[X86] Improve demanded bits for X86ISD::BEXTR.
ClosedPublic

Authored by craig.topper on Sep 22 2020, 12:04 AM.

Details

Summary

If the control is constant we can figure out exactly which bits
of the input are demanded.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 22 2020, 12:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2020, 12:04 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper requested review of this revision.Sep 22 2020, 12:04 AM
RKSimon added inline comments.Sep 22 2020, 7:19 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
38352

Maybe just call computeKnownBits to avoid code duplication?

craig.topper added inline comments.Sep 22 2020, 9:03 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
38352

Won’t that be more costly for compile time?

RKSimon added inline comments.Sep 22 2020, 10:32 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
38341

Return a new zero constant if we manage to get here?

38352

Yeah - probably not worth it

craig.topper added inline comments.Sep 22 2020, 10:38 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
38341

Doesn't the caller already do that when all demanded bits are known?

RKSimon accepted this revision.Sep 23 2020, 4:18 AM

LGTM

This revision is now accepted and ready to land.Sep 23 2020, 4:18 AM
This revision was automatically updated to reflect the committed changes.