[PATCH] D128302: [AArch64][CostModel] Detects that ExtractElement at index is not free in AArch64 when result is used as integer.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 01:31:58 PDT 2022


fhahn added a comment.

Just a general comment: please try to include the full context when uploading a diff: https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface



================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1993
+    //
+    // The cost of extracting a scalar element from a vector register depends
+    // on how scalar will be used:
----------------
I might be missing something here, but the comment here doesn't seem to match the code, which just checks if the result is used. I'd expect that in all interesting cases the result will be used. And if it is not used the cost is not really that interesting, as it is effectively a no-op that should be removed.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1981
+                                                   Type *Val, unsigned Index) {
+  InstructionCost cost = this->getVectorInstrCost(I.getOpcode(), Val, Index);
+
----------------
nit: LLVM coding style uses `UpperCase` for variables.


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

https://reviews.llvm.org/D128302



More information about the llvm-commits mailing list