aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r--lib/VMCore/Instruction.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index e19ad1c..332ecf9 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -168,6 +168,14 @@ const char *Instruction::getOpcodeName(unsigned OpCode) {
/// identical to the current one. This means that all operands match and any
/// extra information (e.g. load is volatile) agree.
bool Instruction::isIdenticalTo(const Instruction *I) const {
+ return isIdenticalTo(I) &&
+ SubclassOptionalData == I->SubclassOptionalData;
+}
+
+/// isIdenticalToWenDefined - This is like isIdenticalTo, except that it
+/// ignores the SubclassOptionalData flags, which specify conditions
+/// under which the instruction's result is undefined.
+bool Instruction::isIdenticalToWhenDefined(const Instruction *I) const {
if (getOpcode() != I->getOpcode() ||
getNumOperands() != I->getNumOperands() ||
getType() != I->getType())