[PATCH] D92177: [NFC][InstructionCost] Refactor LoopVectorizationCostModel::selectVectorizationFactor

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 27 00:43:09 PST 2020


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5414
+
+  std::pair<float, unsigned> MinCost = {ExpectedCost, 1};
+  const float ScalarCost = ExpectedCost;
----------------
sdesmalen wrote:
> `std::pair<unsigned, unsigned>` 
This is no longer a NFC change if I use unsigned. This changes the behaviour of cases where different vectorisation factors produce fractional, and different, costs. For example, (float) 10 / 2 is less than (float) 11 / 2, whereas using integers would give the same result of 5. I don't mind making the change, but then I think I should remove NFC from the subject line.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92177



More information about the llvm-commits mailing list