[PATCH] D66010: [ARM] MVE sext costs

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 06:43:27 PDT 2019


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:346
 
+  static const TypeConversionCostTblEntry MVEVectorConversionTbl[] = {
+    { ISD::SIGN_EXTEND, MVT::v8i16, MVT::v8i8, 1 },
----------------
ostannard wrote:
> I think this could do with a comment explaining where the numbers come from. If it's based on the current assembly we generate, are we already generating the optimal sequences, or would these numbers need to change as our code-gen improves?
I will add a comment, that sounds like a good idea.

These all came from the codegen tests, mostly in Codegen/Thumb2/mve-sext.ll. I believe the normal code is optimal (I'd be interested if anyone knows of a way to do a v4i8->v4i32 in one instruction. From what I understand you have to use 2).
v2i64's cost more, but "high cost" is not a bad idea for them as we don't have a lot of v2i64 instructions. I don't think that over-estimating there is such a bad thing. The sext are linearised, so cost a lot. The zeroextends are VAND with a constant, which can either come from a constant pool or a VMOV (which we don't generate yet, but soon will hopefully)


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

https://reviews.llvm.org/D66010





More information about the llvm-commits mailing list