aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-03 15:34:35 +0000
committerDan Gohman <gohman@apple.com>2009-09-03 15:34:35 +0000
commitbccfc24c4e8092e1ee18746dd4cee01247728faa (patch)
treebf1ea31f55e271210a43862a4fe5c64749b8c796 /include
parentdd12de686cb0a3bcff879ae895fe461caa6f7842 (diff)
downloadexternal_llvm-bccfc24c4e8092e1ee18746dd4cee01247728faa.zip
external_llvm-bccfc24c4e8092e1ee18746dd4cee01247728faa.tar.gz
external_llvm-bccfc24c4e8092e1ee18746dd4cee01247728faa.tar.bz2
Change PHINode::hasConstantValue to have a DominatorTree argument
instead of a bool argument, and to do the dominator check itself. This makes it eaiser to use when DominatorTree information is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Instructions.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index e6f1c54..71f4738 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -31,6 +31,7 @@ class ConstantInt;
class ConstantRange;
class APInt;
class LLVMContext;
+class DominatorTree;
//===----------------------------------------------------------------------===//
// AllocationInst Class
@@ -1950,7 +1951,12 @@ public:
/// hasConstantValue - If the specified PHI node always merges together the
/// same value, return the value, otherwise return null.
///
- Value *hasConstantValue(bool AllowNonDominatingInstruction = false) const;
+ /// If the PHI has undef operands, but all the rest of the operands are
+ /// some unique value, return that value if it can be proved that the
+ /// value dominates the PHI. If DT is null, use a conservative check,
+ /// otherwise use DT to test for dominance.
+ ///
+ Value *hasConstantValue(DominatorTree *DT = 0) const;
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const PHINode *) { return true; }