//===- GVN.cpp - Eliminate redundant values and loads ---------------------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This pass performs global value numbering to eliminate fully redundant// instructions. It also performs simple dead load elimination.//// Note that this pass does the value numbering itself, it does not use the// ValueNumbering analysis passes.////===----------------------------------------------------------------------===//#define DEBUG_TYPE "gvn"#include"llvm/Transforms/Scalar.h"#include"llvm/BasicBlock.h"#include"llvm/Constants.h"#include"llvm/DerivedTypes.h"#include"llvm/Function.h"#include"llvm/Instructions.h"#include"llvm/Value.h"#include"llvm/ADT/DenseMap.h"#include"llvm/ADT/DepthFirstIterator.h"#include"llvm/ADT/SmallPtrSet.h"#include"llvm/ADT/SmallVector.h"#include"llvm/ADT/Statistic.h"#include"llvm/Analysis/Dominators.h"#include"llvm/Analysis/AliasAnalysis.h"#include"llvm/Analysis/MemoryDependenceAnalysis.h"#include"llvm/Support/CFG.h"#include"llvm/Support/CommandLine.h"#include"llvm/Support/Compiler.h"