This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering] Add DemandedElts mask to SimplifyDemandedBits (PR40000)
ClosedPublic

Authored by RKSimon on Dec 17 2018, 7:58 AM.

Details

Summary

This is an initial patch to add the necessary support for a DemandedElts argument to SimplifyDemandedBits, more closely matching computeKnownBits and to help improve vector codegen.

I've added only a small amount of additions necessary to get at least one test to update - a lot more can be done but I'd like to add these methodically with proper test coverage, at the same time the hope is to slowly move some/all of SimplifyDemandedVectorElts into SimplifyDemandedBits as well.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Dec 17 2018, 7:58 AM
andreadb accepted this revision.Dec 17 2018, 10:00 AM

LGTM. Thanks!

test/CodeGen/X86/combine-sdiv.ll
3052–3057

Unrelated to your patch.

This could be simplified to:

vpsrlw $8, %xmm1, %xmm1
vpxor %xmm2, %xmm2, %xmm2
vpunpcklbw %xmm2, %xmm0, %xmm2
vpackuswb %xmm1, %xmm2, %xmm0
This revision is now accepted and ready to land.Dec 17 2018, 10:00 AM
This revision was automatically updated to reflect the committed changes.
jfb added a subscriber: jfb.Dec 17 2018, 11:07 AM
jfb added inline comments.
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
1901 ↗(On Diff #178492)

This leaves VT unused. I've removed it in r349377.

RKSimon marked an inline comment as done.Dec 17 2018, 11:16 AM
RKSimon added inline comments.
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
1901 ↗(On Diff #178492)

Thanks @jfb