[all-commits] [llvm/llvm-project] 39e3e3: [NewPM] Redesign of PreserveCFG Checker

Yevgeny Rouban via All-commits all-commits at lists.llvm.org
Mon Apr 5 22:37:05 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 39e3e3aa51d628722637c1bfa507f9ec2c532120
      https://github.com/llvm/llvm-project/commit/39e3e3aa51d628722637c1bfa507f9ec2c532120
  Author: Yevgeny Rouban <yrouban at azul.com>
  Date:   2021-04-06 (Tue, 06 Apr 2021)

  Changed paths:
    M clang/lib/CodeGen/BackendUtil.cpp
    M llvm/include/llvm/Passes/StandardInstrumentations.h
    M llvm/lib/LTO/LTOBackend.cpp
    M llvm/lib/Passes/StandardInstrumentations.cpp
    M llvm/test/Other/new-pass-manager.ll
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/tools/opt/NewPMDriver.cpp
    M llvm/unittests/IR/PassManagerTest.cpp

  Log Message:
  -----------
  [NewPM] Redesign of PreserveCFG Checker

The reason for the NewPM redesign is described in the commit
  cba3e783389a: [NewPM] Disable PreservedCFGChecker ...

The checker introduces an internal custom CFG analysis that tracks
current up-to date CFG snapshot. The analysis is invalidated along
any other CFG related analysis (the key is CFGAnalyses). If the CFG
analysis is not invalidated at a functional pass exit then the checker
asserts that the CFG snapshot taken from this analysis is equals to
a snapshot of the current CFG.

Along the way:
- the function CFG::printDiff() is simplified by removing function
  name calculation. The name is printed by the caller;
- fixed CFG invalidated condition (see CFG::invalidate());
- StandardInstrumentations::registerCallbacks() gets additional
  optional parameter of type FunctionAnalysisManager*, which is
  needed by the checker to get the custom CFG analysis;
- several PM related tests updated to explicitly set
  -verify-cfg-preserved=1 as they need.

This patch is safe to land as the CFGChecker is left switched off
(the options -verify-cfg-preserved is false by default). It will be
switched on by a separate patch to minimize possible reverts.

Reviewed By: skatkov, kuhar

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




More information about the All-commits mailing list