[all-commits] [llvm/llvm-project] 2d1c6e: [LAA] Remove block order sensitivity in LAA algori...

Max Kazantsev via All-commits all-commits at lists.llvm.org
Wed Jul 27 23:37:37 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d1c6e0b4418e92df286cba428a3e4cf56d7aa2f
  Author: Max Kazantsev <mkazantsev at azul.com>
  Date:   2022-07-28 (Thu, 28 Jul 2022)

  Changed paths:
    M llvm/lib/Analysis/LoopAccessAnalysis.cpp
    A llvm/test/Analysis/LoopAccessAnalysis/pr56672.ll

  Log Message:
  [LAA] Remove block order sensitivity in LAA algorithm. PR56672

As test in PR56672 shows, LAA produces different results which lead to either
positive or negative vectorization decisions depending on the order of blocks
in loop. The exact reason of this is not clear to me, however this makes investigation
of related bugs extremely complex.

Current order of blocks in the loop is arbitrary. It may change, for example, if loop
info analysis is dropped and recomputed. Seems that it interferes with LAA's logic.
This patch chooses fixed traversal order of blocks in loops, making it RPOT.

Note: this is *not* a fix for bug with incorrect analysis result. It just makes
the answer more robust to make the investigation easier.

Differential Revision: https://reviews.llvm.org/D130482
Reviewed By: aeubanks, fhahn

More information about the All-commits mailing list