This is an archive of the discontinued LLVM Phabricator instance.

[X86][AVX] Peek through bitcasts to find the source of broadcasts
ClosedPublic

Authored by RKSimon on Jun 23 2016, 1:54 PM.

Details

Summary

AVX1 can only broadcast vectors as floats/doubles, so for 256-bit vectors we insert bitcasts if we are shuffling v8i32/v4i64 types. Unfortunately the presence of these bitcasts prevents the current broadcast lowering code from peeking through cases where we have concatenated / extracted vectors to create the 256-bit vectors.

This patch allows us to peek through bitcasts as long as the number of elements doesn't change (i.e. element bitwidth is the same) so the broadcast index is not affected.

Note this bitcast peek is different from the stage later on which doesn't care about the type and is just trying to find a load node.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 61719.Jun 23 2016, 1:54 PM
RKSimon retitled this revision from to [X86][AVX] Peek through bitcasts to find the source of broadcasts.
RKSimon updated this object.
RKSimon added reviewers: mkuper, ab, spatel, andreadb.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
ab accepted this revision.Jun 24 2016, 1:27 PM
ab edited edge metadata.

LGTM

lib/Target/X86/X86ISelLowering.cpp
8533 ↗(On Diff #61719)

V = VSrc;

This revision is now accepted and ready to land.Jun 24 2016, 1:27 PM
This revision was automatically updated to reflect the committed changes.