diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index cd4f0ae42bcd..6205e74837c0 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -654,6 +654,14 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, const APInt &DemandedBits, SDValue TargetLowering::SimplifyMultipleUseDemandedBits( SDValue Op, const APInt &DemandedBits, const APInt &DemandedElts, SelectionDAG &DAG, unsigned Depth) const { + EVT VT = Op.getValueType(); + + // Pretend we don't know anything about scalable vectors for now. + // TODO: We can probably do more work on simplifying the operations for + // scalable vectors, but for now we just bail out. + if (VT.isScalableVector()) + return SDValue(); + // Limit search depth. if (Depth >= SelectionDAG::MaxRecursionDepth) return SDValue(); @@ -664,7 +672,7 @@ SDValue TargetLowering::SimplifyMultipleUseDemandedBits( // Not demanding any bits/elts from Op. if (DemandedBits == 0 || DemandedElts == 0) - return DAG.getUNDEF(Op.getValueType()); + return DAG.getUNDEF(VT); bool IsLE = DAG.getDataLayout().isLittleEndian(); unsigned NumElts = DemandedElts.getBitWidth(); @@ -894,6 +902,13 @@ SDValue TargetLowering::SimplifyMultipleUseDemandedBits( SDValue Op, const APInt &DemandedBits, SelectionDAG &DAG, unsigned Depth) const { EVT VT = Op.getValueType(); + + // Pretend we don't know anything about scalable vectors for now. + // TODO: We can probably do more work on simplifying the operations for + // scalable vectors, but for now we just bail out. + if (VT.isScalableVector()) + return SDValue(); + APInt DemandedElts = VT.isVector() ? APInt::getAllOnes(VT.getVectorNumElements()) : APInt(1, 1); |