[llvm] [DAG][AArch64] Handle vscale addressing modes in reassociationCanBreakAddressingModePattern (PR #89908)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 06:43:25 PDT 2024
================
@@ -1085,6 +1085,37 @@ bool DAGCombiner::reassociationCanBreakAddressingModePattern(unsigned Opc,
if (Opc != ISD::ADD || N0.getOpcode() != ISD::ADD)
return false;
+ // Check for vscale addressing modes.
+ // (load/store (add (add x, y), vscale))
+ // (load/store (add (add x, y), (lsl vscale, C)))
+ // (load/store (add (add x, y), (mul vscale, C)))
+ if ((N1.getOpcode() == ISD::VSCALE ||
+ ((N1.getOpcode() == ISD::SHL || N1.getOpcode() == ISD::MUL) &&
+ N1.getOperand(0).getOpcode() == ISD::VSCALE &&
+ isa<ConstantSDNode>(N1.getOperand(1)))) &&
+ N1.getValueSizeInBits() <= 64) {
----------------
david-arm wrote:
Can you use `getScalarValueSizeInBits` here instead to avoid the implicit TypeSize->uint64_t conversion?
https://github.com/llvm/llvm-project/pull/89908
More information about the llvm-commits
mailing list