summaryrefslogtreecommitdiff
path: root/include/llvm/Value.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-04 12:08:11 +0000
committerDan Gohman <gohman@apple.com>2009-09-04 12:08:11 +0000
commit859fff476dfe8d83abdf4621b1d20062c0daa85c (patch)
tree15f6b66f5538046096a0f13f5ff878227987faef /include/llvm/Value.h
parent70327dabb4cbe7a95b65ea787716170508ac3068 (diff)
downloadllvm-859fff476dfe8d83abdf4621b1d20062c0daa85c.tar.gz
llvm-859fff476dfe8d83abdf4621b1d20062c0daa85c.tar.bz2
llvm-859fff476dfe8d83abdf4621b1d20062c0daa85c.tar.xz
Include optional subclass flags, such as inbounds, nsw, etc., in the
Constant uniquing tables. This allows distinct ConstantExpr objects with the same operation and different flags. Even though a ConstantExpr "a + b" is either always overflowing or never overflowing (due to being a ConstantExpr), it's still necessary to be able to represent it both with and without overflow flags at the same time within the IR, because the safety of the flag may depend on the context of the use. If the constant really does overflow, it wouldn't ever be safe to use with the flag set, however the use may be in code that is never actually executed. This also makes it possible to merge all the flags tests into a single test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Value.h')
-rw-r--r--include/llvm/Value.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index fdc3aeb956..415b8fbb2b 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -146,12 +146,6 @@ public:
// Only use when in type resolution situations!
void uncheckedReplaceAllUsesWith(Value *V);
- /// clearOptionalData - Clear any optional optimization data from this Value.
- /// Transformation passes must call this method whenever changing the IR
- /// in a way that would affect the values produced by this Value, unless
- /// it takes special care to ensure correctness in some other way.
- void clearOptionalData() { SubclassOptionalData = 0; }
-
//----------------------------------------------------------------------
// Methods for handling the chain of uses of this Value.
//
@@ -240,6 +234,13 @@ public:
return SubclassID;
}
+ /// getRawSubclassOptionalData - Return the raw optional flags value
+ /// contained in this value. This should only be used when testing two
+ /// Values for equivalence.
+ unsigned getRawSubclassOptionalData() const {
+ return SubclassOptionalData;
+ }
+
/// hasSameSubclassOptionalData - Test whether the optional flags contained
/// in this value are equal to the optional flags in the given value.
bool hasSameSubclassOptionalData(const Value *V) const {