From 4553821815ebe3101dd7c8514a5a2b45891b29a6 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 1 Feb 2021 23:08:46 -0800 Subject: [PATCH] [SelectionDAG] Prevent scalable vector warning from ComputeNumSignBits on extract_vector_elt on a scalable vector. --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 2090762..c9bb50c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3922,6 +3922,9 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts, SDValue InVec = Op.getOperand(0); SDValue EltNo = Op.getOperand(1); EVT VecVT = InVec.getValueType(); + // ComputeNumSignBits not yet implemented for scalable vectors. + if (VecVT.isScalableVector()) + break; const unsigned BitWidth = Op.getValueSizeInBits(); const unsigned EltBitWidth = Op.getOperand(0).getScalarValueSizeInBits(); const unsigned NumSrcElts = VecVT.getVectorNumElements(); -- 2.7.4