Page MenuHomePhabricator

[DAGCombiner] combine vextract (v1iX extract_subvector(vNiX, Idx)) into vextract(vNiX,Idx).
ClosedPublic

Authored by eladcohen on Aug 10 2017, 1:54 AM.

Details

Summary

Combine vextract (v1iX extract_subvector(vNiX, Idx)) into vextract(vNiX,Idx).
This case appeared in AVX512 after fixing pr33349 in r310552.

Usually we don't get these cases since v1iX are illegal in most targets and then these
(v1iX extract_subvector(vNiX, Idx)) get scalarized into (iX vextract(vNiX,Idx)).
But for targets like AVX512 where such type is legal we end up with a redundant DAG
node which can be combined.

Diff Detail

Event Timeline

eladcohen created this revision.Aug 10 2017, 1:54 AM
RKSimon added inline comments.Aug 10 2017, 3:22 AM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
13790 ↗(On Diff #110529)

Would this be better in SelectionDAG::getNode() ?

eladcohen added inline comments.Aug 13 2017, 8:07 AM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
13790 ↗(On Diff #110529)

Sounds good. I'll move it.

eladcohen updated this revision to Diff 110876.Aug 13 2017, 8:08 AM

Fixed Simon's comments.

RKSimon accepted this revision.Aug 13 2017, 2:19 PM

LGTM with a couple of minors

lib/CodeGen/SelectionDAG/SelectionDAG.cpp
4378

vector

4381

Move this up to the rest of the comment

This revision is now accepted and ready to land.Aug 13 2017, 2:19 PM
eladcohen updated this revision to Diff 110918.Aug 14 2017, 1:35 AM
eladcohen marked 2 inline comments as done.

Fixed Simon's comments. Thanks for the review!

This revision was automatically updated to reflect the committed changes.