LLVM 24.0.0git
PromoteMemToReg.h
Go to the documentation of this file.
1//===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file exposes an interface to promote alloca instructions to SSA
10// registers, by using the SSA construction algorithm.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
15#define LLVM_TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
16
18
19namespace llvm {
20
21template <typename T> class ArrayRef;
22class AllocaInst;
23class DominatorTree;
24class AssumptionCache;
25
26/// Return true if this alloca is legal for promotion.
27///
28/// This is true if there are only loads, stores, and lifetime markers
29/// using this alloca.
31
32/// Promote the specified list of alloca instructions into scalar
33/// registers, inserting PHI nodes as appropriate.
34///
35/// This function makes use of DominanceFrontier information. This function
36/// does not modify the CFG of the function at all. All allocas must be from
37/// the same function.
38///
40 AssumptionCache *AC = nullptr);
41
42} // End llvm namespace
43
44#endif
#define LLVM_ABI
Definition Compiler.h:211
an instruction to allocate memory on the stack
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
A cache of @llvm.assume calls within a function.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:122
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void PromoteMemToReg(ArrayRef< AllocaInst * > Allocas, DominatorTree &DT, AssumptionCache *AC=nullptr)
Promote the specified list of alloca instructions into scalar registers, inserting PHI nodes as appro...
LLVM_ABI bool isAllocaPromotable(const AllocaInst *AI)
Return true if this alloca is legal for promotion.