OSDN Git Service

Irreducible loop metadata for more accurate block frequency under PGO.
authorHiroshi Yamauchi <yamauchi@google.com>
Thu, 2 Nov 2017 22:26:51 +0000 (22:26 +0000)
committerHiroshi Yamauchi <yamauchi@google.com>
Thu, 2 Nov 2017 22:26:51 +0000 (22:26 +0000)
commitdd33e177dd838793692d7a291dc5552e30642842
tree958785f8097f8e508a3cab45b1bd18111a725bd4
parentda35e5e8bec2e0110f896b4ef677445187c7ab42
Irreducible loop metadata for more accurate block frequency under PGO.

Summary:
Currently the block frequency analysis is an approximation for irreducible
loops.

The new irreducible loop metadata is used to annotate the irreducible loop
headers with their header weights based on the PGO profile (currently this is
approximated to be evenly weighted) and to help improve the accuracy of the
block frequency analysis for irreducible loops.

This patch is a basic support for this.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: mehdi_amini, llvm-commits, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317278 91177308-0d34-0410-b5e6-96231b3b80d8
21 files changed:
docs/LangRef.rst
include/llvm/Analysis/BlockFrequencyInfo.h
include/llvm/Analysis/BlockFrequencyInfoImpl.h
include/llvm/CodeGen/MachineBasicBlock.h
include/llvm/CodeGen/MachineBlockFrequencyInfo.h
include/llvm/IR/BasicBlock.h
include/llvm/IR/LLVMContext.h
include/llvm/IR/MDBuilder.h
include/llvm/Transforms/PGOInstrumentation.h
lib/Analysis/BlockFrequencyInfo.cpp
lib/Analysis/BlockFrequencyInfoImpl.cpp
lib/CodeGen/MachineBasicBlock.cpp
lib/CodeGen/MachineBlockFrequencyInfo.cpp
lib/IR/BasicBlock.cpp
lib/IR/LLVMContext.cpp
lib/IR/MDBuilder.cpp
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
test/Analysis/BlockFrequencyInfo/irreducible_pgo.ll [new file with mode: 0644]
test/ThinLTO/X86/lazyload_metadata.ll
test/Transforms/PGOProfile/Inputs/irreducible.proftext [new file with mode: 0644]
test/Transforms/PGOProfile/irreducible.ll [new file with mode: 0644]