[InstSimplify] Clarify use of FixedVectorType in SimplifySelectInst
authorCullen Rhodes <cullen.rhodes@arm.com>
Tue, 24 Nov 2020 18:07:13 +0000 (18:07 +0000)
committerCullen Rhodes <cullen.rhodes@arm.com>
Fri, 27 Nov 2020 09:55:29 +0000 (09:55 +0000)
commit7b8d50b141bbf223eab33a75f468be4ee92ad052
treee4a52a2f06a631a19a6fb5ef2cf25dd6fcee3557
parentb33fbbaa34f0fe9fb16789afc72ae424c1825b69
[InstSimplify] Clarify use of FixedVectorType in SimplifySelectInst

Folding a select of vector constants that include undef elements only
applies to fixed vectors, but there's no earlier check the type is not
scalable so it crashes for scalable vectors. This adds a check so this
optimization is only attempted for fixed vectors.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D92046
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/select.ll