[all-commits] [llvm/llvm-project] 0b774a: [SLP] Make sure instructions are ordered when comp...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Aug 11 02:18:38 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0b774acf1189f589140ad49e9146e1406be91ca1
      https://github.com/llvm/llvm-project/commit/0b774acf1189f589140ad49e9146e1406be91ca1
  Author: Florian Hahn <florian_hahn at apple.com>
  Date:   2020-08-11 (Tue, 11 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-order.ll

  Log Message:
  -----------
  [SLP] Make sure instructions are ordered when computing spill cost.

The entries in VectorizableTree are not necessarily ordered by their
position in basic blocks. Collect them and order them by dominance so
later instructions are guaranteed to be visited first. For instructions
in different basic blocks, we only scan to the beginning of the block,
so their order does not matter, as long as all instructions in a basic
block are grouped together. Using dominance ensures a deterministic order.

The modified test case contains an example where we compute a wrong
spill cost (2) without this patch, even though there is no call between
any instruction in the bundle.

This seems to have limited practical impact, .e.g on X86 with a recent
Intel Xeon CPU with -O3 -march=native -flto on MultiSource,SPEC2000,SPEC2006
there are no binary changes.

Reviewed By: ABataev

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




More information about the All-commits mailing list