summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 5aef4592501..9af98e8a9b3 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -167,6 +167,8 @@ Value *PHINode::hasConstantValue() const {
// The case where the first value is this PHI.
ConstantValue = getIncomingValue(i);
}
+ if (ConstantValue == this)
+ return UndefValue::get(getType());
return ConstantValue;
}
OpenPOWER on IntegriCloud