[llvm-branch-commits] [llvm] [AArch64] Improve cost model for legal subvec insert/extract (PR #81135)

Sander de Smalen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 15 06:55:44 PST 2024


================
@@ -568,6 +568,48 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     }
     return Cost;
   }
+  case Intrinsic::vector_extract: {
+    // If both the vector argument and the return type are legal types and the
+    // index is 0, then this should be a no-op or simple operation; return a
+    // relatively low cost.
+
+    // If arguments aren't actually supplied, then we cannot determine the
+    // value of the index.
+    if (ICA.getArgs().size() < 2)
----------------
sdesmalen-arm wrote:

nit:
```suggestion
    if (ICA.getArgs().size() != 2)
```

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


More information about the llvm-branch-commits mailing list