This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombine] Fold Splat(bitcast(buildvector(x,..))) to splat(x)
ClosedPublic

Authored by dmgreen on Dec 8 2022, 1:07 AM.

Details

Summary

This adds a fold which fixes a couple of regressions found in D138872 (one for MVE, another for AArch64 NEON, both from intrinsic code). The backend could be caught not knowing how to simplify either splat(bitcast(buildvector(x,..))) or splat(bitcast(scalar_to_vector(x))). This only handles lane 0 splats, which are only valid under LE, and needs to be a little careful with the types it creates for the new buildvector.

Diff Detail

Event Timeline

dmgreen created this revision.Dec 8 2022, 1:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2022, 1:07 AM
dmgreen requested review of this revision.Dec 8 2022, 1:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2022, 1:07 AM
Herald added a subscriber: aheejin. · View Herald Transcript

Could the ARM/AArch64 tests be extended to ensure we have BE coverage?

dmgreen updated this revision to Diff 481269.Dec 8 2022, 7:03 AM

Rebased onto BE tests added to mve-vdup.ll.

RKSimon accepted this revision.Dec 8 2022, 7:10 AM

LGTM - cheers

This revision is now accepted and ready to land.Dec 8 2022, 7:10 AM
This revision was landed with ongoing or failed builds.Dec 12 2022, 12:35 AM
This revision was automatically updated to reflect the committed changes.