summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2016-02-10 22:22:41 +0000
committerPhilip Reames <listmail@philipreames.com>2016-02-10 22:22:41 +0000
commitd59638e14f61a5429eb60c7c3630e17dcc888771 (patch)
tree3ef267b15ba5d0bc99c4d0381dc0612c59adefbc /llvm/lib/Transforms/Scalar
parent69683f13d27fdfe88c850721938f6a2c2b9d92e2 (diff)
downloadbcm5719-llvm-d59638e14f61a5429eb60c7c3630e17dcc888771.tar.gz
bcm5719-llvm-d59638e14f61a5429eb60c7c3630e17dcc888771.zip
Follow up to 260439, Speculative fix to clang builders
It looks like clang has a couple of test cases which caught the fact LVI was not slightly more precise after 260439. When looking at the failures, it struck me as wasteful to be querying nullness of a constant via LVI, so instead of tweaking the clang tests, let's just stop querying constants from this source. llvm-svn: 260451
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
index 686bd407110..56b23733315 100644
--- a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
+++ b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
@@ -312,8 +312,11 @@ bool CorrelatedValuePropagation::processCallSite(CallSite CS) {
for (Value *V : CS.args()) {
PointerType *Type = dyn_cast<PointerType>(V->getType());
-
+ // Try to mark pointer typed parameters as non-null. We skip the
+ // relatively expensive analysis for constants which are obviously either
+ // null or non-null to start with.
if (Type && !CS.paramHasAttr(ArgNo + 1, Attribute::NonNull) &&
+ !isa<Constant>(V) &&
LVI->getPredicateAt(ICmpInst::ICMP_EQ, V,
ConstantPointerNull::get(Type),
CS.getInstruction()) == LazyValueInfo::False)
OpenPOWER on IntegriCloud