This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombine] narrowInsertExtractVectorBinOp - add CONCAT_VECTORS support
ClosedPublic

Authored by RKSimon on Jun 21 2019, 8:25 AM.

Details

Summary

We already split extract_subvector(binop(insert_subvector(v,x),insert_subvector(w,y))) -> binop(x,y).

This patch adds support for extract_subvector(binop(concat_vectors(),concat_vectors())) cases as well.

In particular this means we don't have to wait for X86 lowering to convert concat_vectors to insert_subvector chains, which helps avoid some cases where demandedelts/combine calls occur too late to split large vector ops.

The fast-isel-store.ll regression is annoying but I don't think is that critical?

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Jun 21 2019, 8:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2019, 8:25 AM
spatel accepted this revision.Jul 11 2019, 7:20 AM

I don't have a good sense of how we make fast-isel speed vs. perf trade-offs, so if anyone else has thoughts about that case, feel free to comment.

The optimization for regular combining overrides that concern for me, so LGTM.

lib/CodeGen/SelectionDAG/DAGCombiner.cpp
17910 ↗(On Diff #206004)

I don't think it's possible for an extract index to be bigger than uint64_t given LLVM type limitations, so could go with the possibly more optimizable:

IndexC->getZExtValue() % VT.getVectorNumElements() == 0
This revision is now accepted and ready to land.Jul 11 2019, 7:20 AM
This revision was automatically updated to reflect the committed changes.