================ @@ -7380,12 +7380,26 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexedSVE(SDNode *Root, SDValue N, return false; SDValue VScale = N.getOperand(1); - if (VScale.getOpcode() != ISD::VSCALE) + int64_t MulImm = std::numeric_limits<int64_t>::max(); + if (VScale.getOpcode() == ISD::VSCALE) { + MulImm = cast<ConstantSDNode>(VScale.getOperand(0))->getSExtValue(); + } else if (auto C = dyn_cast<ConstantSDNode>(VScale)) { + int64_t ByteOffset = C->getSExtValue(); + const auto KnownVScale = + Subtarget->getSVEVectorSizeInBits() / AArch64::SVEBitsPerBlock; + + if (!KnownVScale || ByteOffset % KnownVScale != 0) + return false; + + MulImm = ByteOffset / KnownVScale; + } else return false; + assert(MulImm != std::numeric_limits<int64_t>::max() && + "Uninitialized MulImm."); + ---------------- paulwalker-arm wrote:
This is not strictly true given you are initialising `MulImm` and whilst unlikely there's nothing stopping `ISD::VSCALE`'s operand from being `std::numeric_limits<int64_t>::max()`. Given the following code will bail if `MulImm` is not changed from its initial value, you could just remove the assert? https://github.com/llvm/llvm-project/pull/129732 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits