//===- MemorySSAUpdater.h - Memory SSA Updater-------------------*- 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 // //===----------------------------------------------------------------------===// // // \file // An automatic updater for MemorySSA that handles arbitrary insertion, // deletion, and moves. It performs phi insertion where necessary, and // automatically updates the MemorySSA IR to be correct. // While updating loads or removing instructions is often easy enough to not // need this, updating stores should generally not be attemped outside this // API. // // Basic API usage: // Create the memory access you want for the instruction (this is mainly so // we know where it is, without having to duplicate the entire set of create // functions MemorySSA supports). // Call insertDef or insertUse depending on whether it's a MemoryUse or a // MemoryDef. // That's it. // // For moving, first, move the instruction itself using the normal SSA // instruction moving API, then just call moveBefore, moveAfter,or moveTo with // the right arguments. // //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_MEMORYSSAUPDATER_H #define LLVM_ANALYSIS_MEMORYSSAUPDATER_H #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/MemorySSA.h" #include "llvm/IR/ValueHandle.h" #include "llvm/IR/ValueMap.h" #include "llvm/Support/CFGDiff.h" namespace llvm { class BasicBlock; class DominatorTree; class Instruction; class LoopBlocksRPO; template <typename T, unsigned int N> class SmallSetVector; ValueToValueMapTy; PhiToDefMap; CFGUpdate; class MemorySSAUpdater { … }; } // end namespace llvm #endif // LLVM_ANALYSIS_MEMORYSSAUPDATER_H