[llvm] [AArch64][CostModel] Lower cost of dupq (SVE2.1) (PR #144918)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 06:10:29 PDT 2025


================
@@ -29981,7 +29981,8 @@ SDValue AArch64TargetLowering::LowerFixedLengthVECTOR_SHUFFLEToSVE(
           DAG, VT, DAG.getNode(Opc, DL, ContainerVT, Op1, Op1));
     }
 
-    if (Subtarget->hasSVE2p1() || Subtarget->hasSME2p1()) {
+    if (Subtarget->hasSVE2p1() ||
+        (Subtarget->hasSME2p1() && Subtarget->isSVEorStreamingSVEAvailable())) {
----------------
sdesmalen-arm wrote:

Actually, looking at the instruction description it seems your original code (using `isSVEorStreamingSVEAvailable`) was the right code, because with `+sme2p1` the instruction is also enabled in non-streaming mode. This can be seen from the pseudo-code for DUPQ, which has `IsSVEEnabled()`. This is actually something that @paulwalker-arm is trying to fix in other places (#145322).

https://github.com/llvm/llvm-project/pull/144918


More information about the llvm-commits mailing list