This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering][X86] TeachSimplifyDemanedBits to handle cases where only the sign bit is demanded from a SETCC and can be passed through
ClosedPublic

Authored by craig.topper on Jan 7 2020, 11:53 AM.

Details

Summary

If we're doing a compare that only tests the sign bit and only the sign bit is demanded, we can just bypass the node. This removes one of the blend dependencies in our v2i64->v2f32 uint_to_fp codegen on pre-sse4.2 targets.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 7 2020, 11:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2020, 11:53 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper retitled this revision from [TargetLowering][X86] TeachSimplifyDemanedBits to handle cases where only the sign bit is demanded and can be passed through to [TargetLowering][X86] TeachSimplifyDemanedBits to handle cases where only the sign bit is demanded from a SETCC and can be passed through.Jan 8 2020, 10:08 AM

Are you OK with the increase in register pressure? I think this is mainly due to SSE41 BLENDVPS being hard coded to using xmm0 for the selection mask.

Rebase after the uint_to_fp v4i64->v4f32 custom type legalization change D72368.

RKSimon accepted this revision.Jan 8 2020, 1:11 PM

LGTM cheers

This revision is now accepted and ready to land.Jan 8 2020, 1:11 PM
This revision was automatically updated to reflect the committed changes.