LLVM  15.0.0git
AMDGPUMemoryUtils.h
Go to the documentation of this file.
1 //===- AMDGPUMemoryUtils.h - Memory related helper functions -*- 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 #ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUMEMORYUTILS_H
10 #define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUMEMORYUTILS_H
11 
12 #include <vector>
13 
14 namespace llvm {
15 
16 struct Align;
17 class AAResults;
18 class ConstantExpr;
19 class DataLayout;
20 class Function;
21 class GlobalVariable;
22 class LoadInst;
23 class MemoryDef;
24 class MemorySSA;
25 class Module;
26 class Value;
27 
28 namespace AMDGPU {
29 
30 Align getAlign(DataLayout const &DL, const GlobalVariable *GV);
31 
32 std::vector<GlobalVariable *> findVariablesToLower(Module &M,
33  const Function *F);
34 
35 /// Replace all uses of constant \p C with instructions in \p F.
36 void replaceConstantUsesInFunction(ConstantExpr *C, const Function *F);
37 
38 /// Given a \p Def clobbering a load from \p Ptr according to the MSSA check
39 /// if this is actually a memory update or an artificial clobber to facilitate
40 /// ordering constraints.
41 bool isReallyAClobber(const Value *Ptr, MemoryDef *Def, AAResults *AA);
42 
43 /// Check is a \p Load is clobbered in its function.
44 bool isClobberedInFunction(const LoadInst *Load, MemorySSA *MSSA,
45  AAResults *AA);
46 
47 } // end namespace AMDGPU
48 
49 } // end namespace llvm
50 
51 #endif // LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUMEMORYUTILS_H
llvm::AMDGPU::findVariablesToLower
std::vector< GlobalVariable * > findVariablesToLower(Module &M, const Function *F)
Definition: AMDGPUMemoryUtils.cpp:108
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::tgtok::Def
@ Def
Definition: TGLexer.h:50
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::SPII::Load
@ Load
Definition: SparcInstrInfo.h:32
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
AMDGPU
Definition: AMDGPUReplaceLDSUseWithPointer.cpp:114
llvm::AMDGPU::isClobberedInFunction
bool isClobberedInFunction(const LoadInst *Load, MemorySSA *MSSA, AAResults *AA)
Check is a Load is clobbered in its function.
Definition: AMDGPUMemoryUtils.cpp:171
Align
uint64_t Align
Definition: ELFObjHandler.cpp:81
llvm::AMDGPU::replaceConstantUsesInFunction
void replaceConstantUsesInFunction(ConstantExpr *C, const Function *F)
Replace all uses of constant C with instructions in F.
Definition: AMDGPUMemoryUtils.cpp:55
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::AMDGPU::isReallyAClobber
bool isReallyAClobber(const Value *Ptr, MemoryDef *Def, AAResults *AA)
Given a Def clobbering a load from Ptr according to the MSSA check if this is actually a memory updat...
Definition: AMDGPUMemoryUtils.cpp:141
llvm::AMDGPU::getAlign
Align getAlign(DataLayout const &DL, const GlobalVariable *GV)
Definition: AMDGPUMemoryUtils.cpp:30
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
AA
MemorySSA
early cse Early CSE w MemorySSA
Definition: EarlyCSE.cpp:1775
llvm::codeview::PublicSymFlags::Function
@ Function