This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Teach isConstOrConstSplat about SPLAT_VECTORs
ClosedPublic

Authored by dmgreen on Jun 30 2022, 8:20 AM.

Details

Summary

This teaches the DemandedElts version of isConstOrConstSplat about SPLAT_VECTORS, in the same way as the non-DemandedElts version by calling the demanded-bits version from the non-demanded-bits version.

Diff Detail

Event Timeline

dmgreen created this revision.Jun 30 2022, 8:20 AM
dmgreen requested review of this revision.Jun 30 2022, 8:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2022, 8:20 AM
dmgreen updated this revision to Diff 441408.Jun 30 2022, 8:27 AM
dmgreen edited the summary of this revision. (Show Details)

Update to just call the demanded-bits version of the function from the demanded-bits version, and do the same for isConstOrConstSplatFP.

I've no objections, but the experts on SVE targets need to have final say.

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
10672

Please can you add a TODO - about whether we should allow UndefElements in non-DemandedElts?

10712

Please can you add a TODO - about whether we should allow UndefElements in non-DemandedElts?

RISCV changes LGTM

RKSimon accepted this revision.Jul 9 2022, 5:12 AM

LGTM (with the addition of the TODO comments I mentioned before)

This revision is now accepted and ready to land.Jul 9 2022, 5:12 AM
Matt added a subscriber: Matt.Jul 9 2022, 10:51 PM

Thanks for the review. I think there is enough in now that this can go ahead. Hopefully it won't hit the same issues seen on Hexagon in the other patches. Let me know if anything does look off.

paulwalker-arm added inline comments.
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
10616

Based on @reames's demanded elts patches I think this should be isFixedLengthVector()? because we now use a 1bit APInt to represent demanding all elements of a scalable vector.

10700

As above.

dmgreen added inline comments.Dec 8 2022, 3:17 AM
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
10616

Yes. Those are already in the version I am about to commit. I was just running ninja check-all first and it was taking a long time for some reason.

This revision was landed with ongoing or failed builds.Dec 8 2022, 3:53 AM
This revision was automatically updated to reflect the committed changes.