LLVM  8.0.1
MergedLoadStoreMotion.h
Go to the documentation of this file.
1 //===- MergedLoadStoreMotion.h - merge and hoist/sink load/stores ---------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 //! \file
11 //! This pass performs merges of loads and stores on both sides of a
12 // diamond (hammock). It hoists the loads and sinks the stores.
13 //
14 // The algorithm iteratively hoists two loads to the same address out of a
15 // diamond (hammock) and merges them into a single load in the header. Similar
16 // it sinks and merges two stores to the tail block (footer). The algorithm
17 // iterates over the instructions of one side of the diamond and attempts to
18 // find a matching load/store on the other side. It hoists / sinks when it
19 // thinks it safe to do so. This optimization helps with eg. hiding load
20 // latencies, triggering if-conversion, and reducing static code size.
21 //
22 //===----------------------------------------------------------------------===//
23 
24 #ifndef LLVM_TRANSFORMS_SCALAR_MERGEDLOADSTOREMOTION_H
25 #define LLVM_TRANSFORMS_SCALAR_MERGEDLOADSTOREMOTION_H
26 
27 #include "llvm/IR/Module.h"
28 #include "llvm/IR/PassManager.h"
29 
30 namespace llvm {
32  : public PassInfoMixin<MergedLoadStoreMotionPass> {
33 public:
35 };
36 
37 }
38 
39 #endif // LLVM_TRANSFORMS_SCALAR_MERGEDLOADSTOREMOTION_H
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
This class represents lattice values for constants.
Definition: AllocatorList.h:24
F(f)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:366
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:154
Module.h This file contains the declarations for the Module class.
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.