1 //===- llvm/Analysis/ValueNumbering.h - Value #'ing Interface ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the abstract ValueNumbering interface, which is used as the
11 // common interface used by all clients of value numbering information, and
12 // implemented by all value numbering implementations.
14 // Implementations of this interface must implement the various virtual methods,
15 // which automatically provides functionality for the entire suite of client
18 //===----------------------------------------------------------------------===//
20 #ifndef LLVM_ANALYSIS_VALUE_NUMBERING_H
21 #define LLVM_ANALYSIS_VALUE_NUMBERING_H
24 #include "llvm/Pass.h"
31 struct ValueNumbering {
32 virtual ~ValueNumbering(); // We want to be subclassed
34 /// getEqualNumberNodes - Return nodes with the same value number as the
35 /// specified Value. This fills in the argument vector with any equal values.
37 virtual void getEqualNumberNodes(Value *V1,
38 std::vector<Value*> &RetVals) const = 0;
40 ///===-------------------------------------------------------------------===//
41 /// Interfaces to update value numbering analysis information as the client
42 /// changes the program
45 /// deleteInstruction - Clients should invoke this method when they delete an
46 /// instruction from the program. This allows the analysis implementations to
47 /// avoid having dangling pointers in their representation.
48 virtual void deleteInstruction(Instruction *I) {}
51 extern void BasicValueNumberingStub();
53 HDR_INCLUDE_VALUENUMBERING_CPP((void*)&BasicValueNumberingStub);
55 } // End llvm namespace