mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
ae65e281f3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
125 lines
4.3 KiB
C++
125 lines
4.3 KiB
C++
//===- llvm/Transforms/Utils.h - Utility Transformations --------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This header file defines prototypes for accessor functions that expose passes
|
|
// in the Utils transformations library.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TRANSFORMS_UTILS_H
|
|
#define LLVM_TRANSFORMS_UTILS_H
|
|
|
|
namespace llvm {
|
|
|
|
class ModulePass;
|
|
class FunctionPass;
|
|
class Pass;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// createMetaRenamerPass - Rename everything with metasyntatic names.
|
|
//
|
|
ModulePass *createMetaRenamerPass();
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// LowerInvoke - This pass removes invoke instructions, converting them to call
|
|
// instructions.
|
|
//
|
|
FunctionPass *createLowerInvokePass();
|
|
extern char &LowerInvokePassID;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// InstructionNamer - Give any unnamed non-void instructions "tmp" names.
|
|
//
|
|
FunctionPass *createInstructionNamerPass();
|
|
extern char &InstructionNamerID;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// LowerSwitch - This pass converts SwitchInst instructions into a sequence of
|
|
// chained binary branch instructions.
|
|
//
|
|
FunctionPass *createLowerSwitchPass();
|
|
extern char &LowerSwitchID;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// EntryExitInstrumenter pass - Instrument function entry/exit with calls to
|
|
// mcount(), @__cyg_profile_func_{enter,exit} and the like. There are two
|
|
// variants, intended to run pre- and post-inlining, respectively.
|
|
//
|
|
FunctionPass *createEntryExitInstrumenterPass();
|
|
FunctionPass *createPostInlineEntryExitInstrumenterPass();
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// BreakCriticalEdges - Break all of the critical edges in the CFG by inserting
|
|
// a dummy basic block. This pass may be "required" by passes that cannot deal
|
|
// with critical edges. For this usage, a pass must call:
|
|
//
|
|
// AU.addRequiredID(BreakCriticalEdgesID);
|
|
//
|
|
// This pass obviously invalidates the CFG, but can update forward dominator
|
|
// (set, immediate dominators, tree, and frontier) information.
|
|
//
|
|
FunctionPass *createBreakCriticalEdgesPass();
|
|
extern char &BreakCriticalEdgesID;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop
|
|
// optimizations.
|
|
//
|
|
Pass *createLCSSAPass();
|
|
extern char &LCSSAID;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// AddDiscriminators - Add DWARF path discriminators to the IR.
|
|
FunctionPass *createAddDiscriminatorsPass();
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// PromoteMemoryToRegister - This pass is used to promote memory references to
|
|
// be register references. A simple example of the transformation performed by
|
|
// this pass is:
|
|
//
|
|
// FROM CODE TO CODE
|
|
// %X = alloca i32, i32 1 ret i32 42
|
|
// store i32 42, i32 *%X
|
|
// %Y = load i32* %X
|
|
// ret i32 %Y
|
|
//
|
|
FunctionPass *createPromoteMemoryToRegisterPass();
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// LoopSimplify - Insert Pre-header blocks into the CFG for every function in
|
|
// the module. This pass updates dominator information, loop information, and
|
|
// does not add critical edges to the CFG.
|
|
//
|
|
// AU.addRequiredID(LoopSimplifyID);
|
|
//
|
|
Pass *createLoopSimplifyPass();
|
|
extern char &LoopSimplifyID;
|
|
|
|
/// This function returns a new pass that downgrades the debug info in the
|
|
/// module to line tables only.
|
|
ModulePass *createStripNonLineTableDebugInfoPass();
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// ControlHeightReudction - Merges conditional blocks of code and reduces the
|
|
// number of conditional branches in the hot paths based on profiles.
|
|
//
|
|
FunctionPass *createControlHeightReductionLegacyPass();
|
|
}
|
|
|
|
#endif
|