Skip to content

Commit

Permalink
[CodeGen] Replace calls to getVectorNumElements() in DAGTypeLegalizer…
Browse files Browse the repository at this point in the history
…::SetSplitVector

In DAGTypeLegalizer::SetSplitVector I have changed calls in the assert
from getVectorNumElements() to getVectorElementCount(), since this
code path works for both fixed and scalable vectors.

This fixes up one warning in the test:

  sve-sext-zext.ll

Differential Revision: https://reviews.llvm.org/D83196
  • Loading branch information
david-arm committed Jul 10, 2020
1 parent 043eaa9 commit da73189
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,9 @@ void DAGTypeLegalizer::GetSplitVector(SDValue Op, SDValue &Lo,
void DAGTypeLegalizer::SetSplitVector(SDValue Op, SDValue Lo,
SDValue Hi) {
assert(Lo.getValueType().getVectorElementType() ==
Op.getValueType().getVectorElementType() &&
2*Lo.getValueType().getVectorNumElements() ==
Op.getValueType().getVectorNumElements() &&
Op.getValueType().getVectorElementType() &&
Lo.getValueType().getVectorElementCount() * 2 ==
Op.getValueType().getVectorElementCount() &&
Hi.getValueType() == Lo.getValueType() &&
"Invalid type for split vector");
// Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.
Expand Down

0 comments on commit da73189

Please sign in to comment.