[PATCH] D132477: Improve cost model for some 128-bit vector operations that use SVE

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 01:23:11 PDT 2022


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1995-1997
+  bool OverrideNEON =
+      (supportsScalableVectors() &&
+       ((LT.second == MVT::v2i64) || (LT.second == MVT::v4i32)));
----------------
This should be checking whether we can use SVE for the specified type (Ty). That means to check we have SVE, instead of checking whether the target supports scalable vectors. The answer will be the same, but conceptually we're specifically checking if we can use the SVE div instructions explicitly.

Note that SVE also supports it for larger vectors (if the SVE min bits allows) and for vectors with FP elements.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:2049
+        InstructionCost OpCost = (IsFloat ? 2 : 1);
+        // multiply by 2 because it's calculated for both extract and insert
+        Cost += (LT.first * OpCost * 2);
----------------
I wouldn't expect there to be any extract and insert, because the division is legal.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132477/new/

https://reviews.llvm.org/D132477



More information about the llvm-commits mailing list