HomePhabricator

[CodeGen] Fix a scalable-vector crash in VSELECT legalization

Authored by frasercrmck on Jun 2 2021, 9:58 AM.

Description

[CodeGen] Fix a scalable-vector crash in VSELECT legalization

The DAGTypeLegalizer::WidenVSELECTMask function is not (yet) ready for
scalable vector types, and has numerous places in which it tries to grab
either the fixed size or number of elements of its types.

I believe that it should be possible to update this method to properly
account for scalable-vector types, but we don't have test cases for
that; RISC-V bails out early on as it has legal i1 vector masks. As
such, this patch just prevents it from crashing.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103536