diff options
author | Chris Lattner <sabre@nondot.org> | 2004-05-23 21:11:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-05-23 21:11:17 +0000 |
commit | bc782255181229e4b63d33489ea1165156f10d68 (patch) | |
tree | 66a016427e2e5c3dbce639e7301edcf435d5d3da /include/llvm/Analysis/ValueNumbering.h | |
parent | c43e0ae35094266028c3900116a4dfbee5769388 (diff) | |
download | llvm-bc782255181229e4b63d33489ea1165156f10d68.tar.gz llvm-bc782255181229e4b63d33489ea1165156f10d68.tar.bz2 llvm-bc782255181229e4b63d33489ea1165156f10d68.tar.xz |
Add interfaces to update value numbering results
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ValueNumbering.h')
-rw-r--r-- | include/llvm/Analysis/ValueNumbering.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/include/llvm/Analysis/ValueNumbering.h b/include/llvm/Analysis/ValueNumbering.h index 965e87fe97..8190b3fc7a 100644 --- a/include/llvm/Analysis/ValueNumbering.h +++ b/include/llvm/Analysis/ValueNumbering.h @@ -39,13 +39,30 @@ struct ValueNumbering { ///===-------------------------------------------------------------------===// /// Interfaces to update value numbering analysis information as the client - /// changes the program + /// 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) {} + /// deleteValue - This method should be called whenever an LLVM Value is + /// deleted from the program, for example when an instruction is found to be + /// redundant and is eliminated. + /// + virtual void deleteValue(Value *V) {} + + /// copyValue - This method should be used whenever a preexisting value in the + /// program is copied or cloned, introducing a new value. Note that analysis + /// implementations should tolerate clients that use this method to introduce + /// the same value multiple times: if the analysis already knows about a + /// value, it should ignore the request. + /// + virtual void copyValue(Value *From, Value *To) {} + + /// replaceWithNewValue - This method is the obvious combination of the two + /// above, and it provided as a helper to simplify client code. + /// + void replaceWithNewValue(Value *Old, Value *New) { + copyValue(Old, New); + deleteValue(Old); + } }; extern void BasicValueNumberingStub(); |