[all-commits] [llvm/llvm-project] b6ccff: [NewPM] Provide method to run all pipeline callbac...

aeubanks via All-commits all-commits at lists.llvm.org
Wed Nov 11 15:10:52 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b6ccff3d5f3b8e26439c7471f433cb16eaf66863
      https://github.com/llvm/llvm-project/commit/b6ccff3d5f3b8e26439c7471f433cb16eaf66863
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2020-11-11 (Wed, 11 Nov 2020)

  Changed paths:
    M clang/lib/CodeGen/BackendUtil.cpp
    A clang/test/CodeGen/bpf-O0.c
    M llvm/include/llvm/IR/PassManager.h
    M llvm/include/llvm/Passes/PassBuilder.h
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/test/CodeGen/BPF/optnone-2.ll
    M llvm/test/Feature/optnone-opt.ll
    M llvm/test/Other/new-pass-manager.ll
    A llvm/test/Other/new-pm-O0-ep-callbacks.ll

  Log Message:
  -----------
  [NewPM] Provide method to run all pipeline callbacks, used for -O0

Some targets may add required passes via
TargetMachine::registerPassBuilderCallbacks(). We need to run those even
under -O0. As an example, BPFTargetMachine adds
BPFAbstractMemberAccessPass, a required pass.

This also allows us to clean up BackendUtil.cpp (and out-of-tree Rust
usage of the NPM) by allowing us to share added passes like coroutines
and sanitizers between -O0 and other optimization levels.

Since callbacks may end up not adding passes, we need to check if the
pass managers are empty before adding them, so PassManager now has an
isEmpty() function. For example, polly adds callbacks but doesn't always
add passes in those callbacks, so this is necessary to keep
-debug-pass-manager tests' output from changing depending on if polly is
enabled or not.

Tests are a continuation of those added in
https://reviews.llvm.org/D89083.

Reviewed By: asbirlea, Meinersbur

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




More information about the All-commits mailing list