[llvm] [AArch64] Use SVE for load-extend-broadcast (PR #221689)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 06:44:32 PDT 2026
================
@@ -30233,6 +30142,18 @@ static SDValue performDUPCombine(SDNode *N,
// v4i32 = SCALAR_TO_VECTOR (i32 (zextloadi8 addr)) ; Matches to ldr b0
// v4i32 = DUPLANE32 (v4i32), 0
if (auto *LD = dyn_cast<LoadSDNode>(Op)) {
+ if (Subtarget->preferSVEVectors() &&
+ Subtarget->isSVEorStreamingSVEAvailable() && Op->hasOneUse() &&
+ VT.getScalarType().isInteger()) {
+ EVT ScalableVT = getContainerForFixedLengthVector(DCI.DAG, VT);
+ // Using SVE Vectors with the same scalar type is not profitable
+ if (!(ScalableVT.getScalarType() ==
+ LD->getMemoryVT().getScalarType())) {
----------------
MacDue wrote:
`getContainerForFixedLengthVector` does not change the element type of `VT`. So `VT.getScalarType() != LD->getMemoryVT().getScalarType())` can be added to the outer condition and the container type does not need to be created until we're going to do the combine.
https://github.com/llvm/llvm-project/pull/221689
More information about the llvm-commits
mailing list