This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add vector support to targetShrinkDemandedConstant for OR/XOR opcodes
ClosedPublic

Authored by RKSimon on Jun 20 2020, 6:38 AM.

Details

Summary

If we only demand the lsb of a constant build vector used in a OR/XOR op then sign extend it to an allsignbits bool pattern.

This also requires SimplifyDemandedBits XOR handling to be modified to call ShrinkDemandedConstant on any (non-NOT) XOR pattern to account for non-splat cases.

Next step towards fixing PR45808 - with this patch we now get a <-1,-1,0,0> v4i64 constant instead of <1,1,0,0>.

Diff Detail

Event Timeline

RKSimon created this revision.Jun 20 2020, 6:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2020, 6:38 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon planned changes to this revision.Jun 20 2020, 6:59 AM

Looking at ways to remove some of the poor codegen that still remains

RKSimon updated this revision to Diff 272410.Jun 22 2020, 6:59 AM
RKSimon edited the summary of this revision. (Show Details)

Add DemandedElts support to ShrinkDemandedConstant/targetShrinkDemandedConstant which fixes the poor vector codegen

This revision is now accepted and ready to land.Jun 28 2020, 5:43 PM
This revision was automatically updated to reflect the committed changes.