summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/ValueNumbering.h
blob: 965e87fe97ccf7b12082147dd86c19439a58c7dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//===- llvm/Analysis/ValueNumbering.h - Value #'ing Interface ---*- C++ -*-===//
// 
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
// 
//===----------------------------------------------------------------------===//
//
// This file defines the abstract ValueNumbering interface, which is used as the
// common interface used by all clients of value numbering information, and
// implemented by all value numbering implementations.
//
// Implementations of this interface must implement the various virtual methods,
// which automatically provides functionality for the entire suite of client
// APIs.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_ANALYSIS_VALUE_NUMBERING_H
#define LLVM_ANALYSIS_VALUE_NUMBERING_H

#include <vector>
#include "llvm/Pass.h"

namespace llvm {

class Value;
class Instruction;

struct ValueNumbering {
  virtual ~ValueNumbering();    // We want to be subclassed

  /// getEqualNumberNodes - Return nodes with the same value number as the
  /// specified Value.  This fills in the argument vector with any equal values.
  ///
  virtual void getEqualNumberNodes(Value *V1,
                                   std::vector<Value*> &RetVals) const = 0;

  ///===-------------------------------------------------------------------===//
  /// Interfaces to update value numbering analysis information as the client
  /// changes the program
  ///

  /// deleteInstruction - Clients should invoke this method when they delete an
  /// instruction from the program.  This allows the analysis implementations to
  /// avoid having dangling pointers in their representation.
  virtual void deleteInstruction(Instruction *I) {}
};

extern void BasicValueNumberingStub();
static IncludeFile
HDR_INCLUDE_VALUENUMBERING_CPP((void*)&BasicValueNumberingStub);

} // End llvm namespace

#endif