mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
This was originally a pointer to support pass managers which didn't use AnalysisManagers. However, that doesn't realistically come up much and the complexity of supporting it doesn't really make sense. In fact, *many* parts of the pass manager were just assuming the pointer was never null already. This at least makes it much more explicit and clear. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263219 91177308-0d34-0410-b5e6-96231b3b80d8
43 lines
1.7 KiB
C++
43 lines
1.7 KiB
C++
//===-- FunctionAttrs.h - Compute function attrs --------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
/// \file
|
|
/// Provides passes for computing function attributes based on interprocedural
|
|
/// analyses.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TRANSFORMS_IPO_FUNCTIONATTRS_H
|
|
#define LLVM_TRANSFORMS_IPO_FUNCTIONATTRS_H
|
|
|
|
#include "llvm/Analysis/LazyCallGraph.h"
|
|
#include "llvm/Analysis/CGSCCPassManager.h"
|
|
#include "llvm/IR/PassManager.h"
|
|
|
|
namespace llvm {
|
|
|
|
/// Computes function attributes in post-order over the call graph.
|
|
///
|
|
/// By operating in post-order, this pass computes precise attributes for
|
|
/// called functions prior to processsing their callers. This "bottom-up"
|
|
/// approach allows powerful interprocedural inference of function attributes
|
|
/// like memory access patterns, etc. It can discover functions that do not
|
|
/// access memory, or only read memory, and give them the readnone/readonly
|
|
/// attribute. It also discovers function arguments that are not captured by
|
|
/// the function and marks them with the nocapture attribute.
|
|
struct PostOrderFunctionAttrsPass : PassInfoMixin<PostOrderFunctionAttrsPass> {
|
|
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM);
|
|
};
|
|
|
|
/// Create a legacy pass manager instance of a pass to compute function attrs
|
|
/// in post-order.
|
|
Pass *createPostOrderFunctionAttrsLegacyPass();
|
|
|
|
}
|
|
|
|
#endif // LLVM_TRANSFORMS_IPO_FUNCTIONATTRS_H
|