This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add a VBROADCAST_LOAD ISD opcode representing a scalar load broadcasted to a vector.
ClosedPublic

Authored by craig.topper on Sep 30 2019, 1:29 AM.

Details

Summary

This adds the ISD opcode and a DAG combine to create it. There are
probably some places where we can directly create it, but I'll
leave that for future work.

This updates all of the isel patterns to look for this new node.
I had to add a few additional isel patterns for aligned extloads
which we should probably fix with a DAG combine or something. This
does mean that the broadcast load folding for avx512 can no
longer match a broadcasted aligned extload.

There's still some work to do here for combining a broadcast of
a broadcast_load. We also need to improve extractelement or
demanded vector elements of a broadcast_load. I'll try to get
those done before I submit this patch.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Sep 30 2019, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2019, 1:30 AM
Herald added a subscriber: hiraditya. · View Herald Transcript

Rebase to remove a previous commit that crept in.

Harbormaster completed remote builds in B38726: Diff 222367.

A couple of minors but I'll wait until the AVX2 regressions have been addressed.

Also to note that Daniil assigned himself the SUBV_BROADCAST equivalent to this recently - https://bugs.llvm.org/show_bug.cgi?id=38969

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
4359 ↗(On Diff #222367)

Just cast to MemSDNode and avoid the if-else ?

llvm/lib/Target/X86/X86ISelLowering.cpp
33371 ↗(On Diff #222367)

Isn't N->getOperand(0) just Src ?

Fix AVX regressions and address review comments

Out of interest will this help us with https://bugs.llvm.org/show_bug.cgi?id=36191 ?

Out of interest will this help us with https://bugs.llvm.org/show_bug.cgi?id=36191 ?

Probably not directly. We just need to add the isel patterns. This patch would just make those patterns smaller. I think this patch already shrank the isel table by at least 5000 bytes.

RKSimon accepted this revision.Oct 1 2019, 8:47 AM

LGTM

This revision is now accepted and ready to land.Oct 1 2019, 8:47 AM
This revision was automatically updated to reflect the committed changes.