[all-commits] [llvm/llvm-project] 58e4e7: [Polly] Introduce caching for the isErrorBlock fun...

Michael Kruse via All-commits all-commits at lists.llvm.org
Wed Aug 18 12:06:11 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58e4e71fc8aca712b5662d0654d86ef2ce7fc160
      https://github.com/llvm/llvm-project/commit/58e4e71fc8aca712b5662d0654d86ef2ce7fc160
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2021-08-18 (Wed, 18 Aug 2021)

  Changed paths:
    M polly/include/polly/ScopDetection.h
    M polly/include/polly/Support/SCEVValidator.h
    M polly/include/polly/Support/ScopHelper.h
    M polly/lib/Analysis/ScopBuilder.cpp
    M polly/lib/Analysis/ScopDetection.cpp
    M polly/lib/Analysis/ScopGraphPrinter.cpp
    M polly/lib/Support/SCEVValidator.cpp
    M polly/lib/Support/ScopHelper.cpp

  Log Message:
  -----------
  [Polly] Introduce caching for the isErrorBlock function. NFC.

Compilation of the file insn-attrtab.c of the SPEC CPU 2017 502.gcc_r
benchmark takes excessive time (> 30min) with Polly enabled. Most time
is spent in the isErrorBlock function querying the DominatorTree.
The isErrorBlock is invoked redundantly over the course of ScopDetection
and ScopBuilder. This patch introduces a caching mechanism for its
result.

Instead of a free function, isErrorBlock is moved to ScopDetection where
its cache map resides. This also means that many functions directly or
indirectly calling isErrorBlock are not "const" anymore. The
DetectionContextMap was marked as "mutable", but IMHO it never should
have been since it stores the detection result.

502.gcc_r only takes excessive time with the new pass manager. The
reason seeams to be that it invalidates the ScopDetection analysis more
often than the legacy pass manager, for unknown reasons.




More information about the All-commits mailing list