This is an archive of the discontinued LLVM Phabricator instance.

Bug 28444: Fix assertion when extract_vector_elt has mismatched type
ClosedPublic

Authored by arsenm on Jul 7 2016, 12:53 AM.

Details

Reviewers
hfinkel
Summary

For some reason extract_vector_elt is sometimes allowed to have
a different result type than the vector element type.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 63034.Jul 7 2016, 12:53 AM
arsenm retitled this revision from to Bug 28444: Fix assertion when extract_vector_elt has mismatched type.
arsenm updated this object.
arsenm added a subscriber: llvm-commits.
hfinkel added a subscriber: hfinkel.Jul 7 2016, 1:15 AM
hfinkel added inline comments.
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
12411

Instead of disabling the transformation, you should be able to replace:

return InVec.getOperand(1);

with:

return DAG.getAnyExtOrTrunc(InVec.getOperand(1), SDLoc(N), NVT);

(I double-checked DAGTypeLegalizer::ScalarizeVecOp_EXTRACT_VECTOR_ELT, and it uses an ANY_EXTEND for this case).

uabelho added a subscriber: uabelho.Jul 7 2016, 1:27 AM
arsenm updated this revision to Diff 63177.Jul 7 2016, 11:04 PM

Convert instead of skip

hfinkel accepted this revision.Jul 7 2016, 11:18 PM
hfinkel added a reviewer: hfinkel.

LGTM

This revision is now accepted and ready to land.Jul 7 2016, 11:18 PM
arsenm closed this revision.Jul 8 2016, 12:12 AM

r274829