diff options
author | Craig Topper <craig.topper@intel.com> | 2017-06-09 16:16:20 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-06-09 16:16:20 +0000 |
commit | 31ce4ec2fd1114f816110d47ca0fb9fad395adfb (patch) | |
tree | ee76b2d38fbfcd6c8f427181ce8a84f02053a0d4 /llvm/lib/Analysis/LazyValueInfo.cpp | |
parent | 7aca2fd830080643b483023cbe84fd82bd2e5957 (diff) | |
download | bcm5719-llvm-31ce4ec2fd1114f816110d47ca0fb9fad395adfb.tar.gz bcm5719-llvm-31ce4ec2fd1114f816110d47ca0fb9fad395adfb.zip |
[LazyValueInfo] Don't run the more complex predicate handling code for EQ and NE in getPredicateResult
Summary:
Unless I'm mistaken, the special handling for EQ/NE should cover everything and there is no reason to fallthrough to the more complex code. For that matter I'm not sure there's any reason to special case EQ/NE other than avoiding creating temporary ConstantRanges.
This patch moves the complex code into an else so we only do it when we are handling a predicate other than EQ/NE.
Reviewers: anna, reames, resistor, Farhana
Reviewed By: anna
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34000
llvm-svn: 305086
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 87e7f9bf0af..de5d80b2dd5 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -1692,15 +1692,15 @@ static LazyValueInfo::Tristate getPredicateResult(unsigned Pred, Constant *C, if (CR.isSingleElement()) return LazyValueInfo::False; + } else { + // Handle more complex predicates. + ConstantRange TrueValues = ConstantRange::makeExactICmpRegion( + (ICmpInst::Predicate)Pred, CI->getValue()); + if (TrueValues.contains(CR)) + return LazyValueInfo::True; + if (TrueValues.inverse().contains(CR)) + return LazyValueInfo::False; } - - // Handle more complex predicates. - ConstantRange TrueValues = ConstantRange::makeExactICmpRegion( - (ICmpInst::Predicate)Pred, CI->getValue()); - if (TrueValues.contains(CR)) - return LazyValueInfo::True; - if (TrueValues.inverse().contains(CR)) - return LazyValueInfo::False; return LazyValueInfo::Unknown; } |