From 18fb862ea703bdb33ce2c8b1a7e5b5f501b95120 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Wed, 10 Feb 2016 22:22:41 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260451 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/CorrelatedValuePropagation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp index 686bd407110..56b23733315 100644 --- a/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp +++ b/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp @@ -312,8 +312,11 @@ bool CorrelatedValuePropagation::processCallSite(CallSite CS) { for (Value *V : CS.args()) { PointerType *Type = dyn_cast(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(V) && LVI->getPredicateAt(ICmpInst::ICMP_EQ, V, ConstantPointerNull::get(Type), CS.getInstruction()) == LazyValueInfo::False) -- 2.11.0