[llvm] [AArch64][ISel] Subvector extracts can use undef for second EXT input (PR #151729)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 4 06:17:32 PDT 2025
================
@@ -15544,7 +15544,9 @@ SDValue AArch64TargetLowering::LowerEXTRACT_SUBVECTOR(SDValue Op,
assert(InVT.isScalableVector() && "Unexpected vector type!");
// Move requested subvector to the start of the vector and try again.
- SDValue Splice = DAG.getNode(ISD::VECTOR_SPLICE, DL, InVT, Vec, Vec, Idx);
+ // There's no need for a second input to vector_splice, so use undef there.
+ SDValue Splice =
+ DAG.getNode(ISD::VECTOR_SPLICE, DL, InVT, Vec, DAG.getUNDEF(InVT), Idx);
----------------
paulwalker-arm wrote:
The problem with using `undef` operands is that you loose control over dataflow. Whilst it frees the register allocator it can lead to situations where the chosen register is the result of an independent long latency instruction (e.g. fsqrt) at which point you end up worse off.
https://github.com/llvm/llvm-project/pull/151729
More information about the llvm-commits
mailing list