This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Move SSE/AVX vector blend folding to instcombiner
ClosedPublic

Authored by RKSimon on Aug 11 2015, 3:37 AM.

Details

Summary

As discussed in D11886, this patch moves the SSE/AVX vector blend folding to instcombiner from PerformINTRINSIC_WO_CHAINCombine (which allowed us to remove this completely).

InstCombiner already had partial support for this, I just had to add support for zero (ConstantAggregateZero) masks and also the case where both selection inputs were the same (allowing us to ignore the mask).

I also moved all the relevant combine tests into InstCombine/blend_x86.ll

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 31783.Aug 11 2015, 3:37 AM
RKSimon retitled this revision from to [InstCombine] Move SSE/AVX vector blend folding to instcombiner.
RKSimon updated this object.
RKSimon added reviewers: andreadb, mkuper, majnemer.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
andreadb accepted this revision.Aug 11 2015, 3:54 AM
andreadb edited edge metadata.

Hi Simon,

The patch LGTM.
Happy to see that we can now get rid of the target combine on INTRINSIC_WO_CHAIN.

lib/Transforms/InstCombine/InstCombineCalls.cpp
968 ↗(On Diff #31783)

You mean:

// fold (blend A, A, Mask) -> A
This revision is now accepted and ready to land.Aug 11 2015, 3:54 AM
This revision was automatically updated to reflect the committed changes.