[all-commits] [llvm/llvm-project] ecb417: [LV] Handle zero cost loops in selectInterleaveCount.

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Mar 29 14:53:06 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ecb4171dcbf1b433c9963fd605a74898303e850d
      https://github.com/llvm/llvm-project/commit/ecb4171dcbf1b433c9963fd605a74898303e850d
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-03-29 (Tue, 29 Mar 2022)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/X86/pr54413-select-interleave-count-loop-with-cost-zero.ll

  Log Message:
  -----------
  [LV] Handle zero cost loops in selectInterleaveCount.

In some case, like in the added test case, we can reach
selectInterleaveCount with loops that actually have a cost of 0.

Unfortunately a loop cost of 0 is also used to communicate that the cost
has not been computed yet. To resolve the crash, bail out if the cost
remains zero after computing it.

This seems like the best option, as there are multiple code paths that
return a cost of 0 to force a computation in selectInterleaveCount.
Computing the cost at multiple places up front there would unnecessarily
complicate the logic.

Fixes #54413.




More information about the All-commits mailing list