This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add initial SimplifyDemandedVectorEltsForTargetNode support
ClosedPublic

Authored by RKSimon on Sep 15 2018, 1:49 PM.

Details

Summary

This patch adds an initial x86 SimplifyDemandedVectorEltsForTargetNode implementation to handle target shuffles.

Currently the patch only decodes a target shuffle, calls SimplifyDemandedVectorElts on its input operands and removes any shuffle that reduces to undef/zero/identity.

Future work will need to integrate this with combineX86ShufflesRecursively, add support for other x86 ops, etc.

A change had to be made to a test in extractelement-load.ll to prevent complete reduction due to improved undef propagation.

NOTE: There is a minor regression that appears to be affecting further (extractelement?) combines which I haven't been able to solve yet - possibly something to do with how nodes are added to the worklist after simplification.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Sep 15 2018, 1:49 PM

Looks google fine modulo the noted issues with load.

lib/Target/X86/X86ISelLowering.cpp
31800

Use OpMask[i]-Lo for M and merge the nested if conditions.

RKSimon updated this revision to Diff 166002.Sep 18 2018, 11:00 AM

Removed duplication in nested if()s

niravd accepted this revision.Sep 19 2018, 9:17 AM

LGTM.

This revision is now accepted and ready to land.Sep 19 2018, 9:17 AM
This revision was automatically updated to reflect the committed changes.