[PGO] Add PGO support at -O0 in the experimental new pass manager
authorRong Xu <xur@google.com>
Thu, 1 Aug 2019 22:36:34 +0000 (22:36 +0000)
committerRong Xu <xur@google.com>
Thu, 1 Aug 2019 22:36:34 +0000 (22:36 +0000)
commitca161fa008862a721eb0d190460867f217ad6105
treebb6f14f6112313f19c0720db7c361822c8b597bd
parentc69c46ff7ae0435d4c956cf87675dbb853ae6bbb
[PGO] Add PGO support at -O0 in the experimental new pass manager

Add PGO support at -O0 in the experimental new pass manager to sync the
behavior of the legacy pass manager.

Also change the test of gcc-flag-compatibility.c for more complete test:
(1) change the match string to "profc" and "profd" to ensure the
    instrumentation is happening.
(2) add IR format proftext so that PGO use compilation is tested.

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

llvm-svn: 367628
clang/lib/CodeGen/BackendUtil.cpp
clang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext [new file with mode: 0644]
clang/test/Profile/gcc-flag-compatibility.c
llvm/include/llvm/Passes/PassBuilder.h
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/new-pm-pgo-O0.ll [new file with mode: 0644]