[PATCH] D126885: [SLP]Cost for a constant buildvector.

Valeriy Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 08:49:12 PDT 2022


vdmitrie added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5779
+        return 0;
+      // Usually, constant buildvector results in a vector load from a
+      // constant/data pool.
----------------
This estimate should be bit more complicated.
Here are the things that can additionally be considered:
- for scalar floating point ops a constant operand is normally loaded from memory too.
- if it is an operand of instruction that becomes immediate (like shift value) and is splat  - cost is zero.
- for a scalar integer op a constant operand is typically an  immediate, so this estimate works in most cases but there is an exception: 64 bits operations on a 32bits target. That should be taken into account too.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126885



More information about the llvm-commits mailing list