[all-commits] [llvm/llvm-project] 8ae83a: [NFC][LV] Autogenerate check lines in a test for e...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Oct 22 04:09:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8ae83a1bafdfd726a657db43653195d35bda1179
      https://github.com/llvm/llvm-project/commit/8ae83a1bafdfd726a657db43653195d35bda1179
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-10-22 (Fri, 22 Oct 2021)

  Changed paths:
    M llvm/test/Transforms/LoopVectorize/X86/pr48340.ll

  Log Message:
  -----------
  [NFC][LV] Autogenerate check lines in a test for ease of future update


  Commit: 2eaef530232e1fbf12dec087487346dcaaf97b1c
      https://github.com/llvm/llvm-project/commit/2eaef530232e1fbf12dec087487346dcaaf97b1c
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-10-22 (Fri, 22 Oct 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/test/Transforms/LoopVectorize/AArch64/interleaved_cost.ll

  Log Message:
  -----------
  [TTI] `BasicTTIImplBase::getInterleavedMemoryOpCost()`: fix load discounting

The math here is:
Cost of 1 load = cost of n loads / n
Cost of live loads = num live loads * Cost of 1 load
Cost of live loads = num live loads * (cost of n loads / n)
Cost of live loads = cost of n loads * (num live loads / n)

But, all the variables here are integers,
and integer division rounds down,
but this calculation clearly expects float semantics.

Instead multiply upfront, and then perform round-up-division.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D112302


Compare: https://github.com/llvm/llvm-project/compare/8b8070e23442...2eaef530232e


More information about the All-commits mailing list