This is an archive of the discontinued LLVM Phabricator instance.

[X86] Call SimplifyDemandedBits on conditions of X86ISD::SHRUNKBLEND
ClosedPublic

Authored by craig.topper on Jan 7 2019, 5:00 PM.

Details

Summary

There can be additional simplifications after VSELECT is converted to SHRUNKBLEND. So we should call SimplifyDemandedBits

This should help some of the regressions from D56387

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon added inline comments.Jan 8 2019, 2:48 AM
lib/Target/X86/X86ISelLowering.cpp
34318 ↗(On Diff #180588)

Would it be any better to add X86ISD::SHRUNKBLEND handling to X86TargetLowering::SimplifyDemandedBitsForTargetNode directly?

Also, should we remove the similar SimplifyDemandedBits call in combineVSelectToShrunkBlend?

Also, should we remove the similar SimplifyDemandedBits call in combineVSelectToShrunkBlend?

The one that decides when to turn VSELECT into SHRUNKBLEND? I don't think we can remove that. We might be able to merge this with it and turn SHRUNKBLEND into SHRUNKBLEND again if another simplification is made. That would probably help with cases where the condition is used multiple times.

Reuse combineVSelectToShrunkBlend. This reduces the code and should allow better optimization when the select condition is used by multiple selects.

RKSimon accepted this revision.Jan 10 2019, 1:20 AM

LGTM - thanks

This revision is now accepted and ready to land.Jan 10 2019, 1:20 AM
This revision was automatically updated to reflect the committed changes.