[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)
Paul Walker via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 5 03:12:01 PST 2025
================
@@ -7380,17 +7380,31 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexedSVE(SDNode *Root, SDValue N,
return false;
SDValue VScale = N.getOperand(1);
- if (VScale.getOpcode() != ISD::VSCALE)
+ std::optional<int64_t> MulImm;
+ 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();
+ constexpr auto SVEBitsPerBlock = AArch64::SVEBitsPerBlock;
+ auto MinVScale = Subtarget->getMinSVEVectorSizeInBits() / SVEBitsPerBlock;
+ auto MaxVScale = Subtarget->getMaxSVEVectorSizeInBits() / SVEBitsPerBlock;
+
+ if (!MaxVScale || MinVScale != MaxVScale || ByteOffset % MaxVScale != 0)
----------------
paulwalker-arm wrote:
I'm happy either way. Feel free to choose the option (pun intended :) ) you prefer.
https://github.com/llvm/llvm-project/pull/129732
More information about the cfe-commits
mailing list