From 3a296bc80d5d02a11e7bc95d8d743d3416df5790 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 24 Sep 2016 20:00:38 +0000 Subject: [PATCH] Scalar: Ignore ConstantData in processAssumption Assumptions on UndefValue and ConstantPointerNull aren't relevant to other users. Ignore them entirely to avoid wasting cycles walking through their (possibly extremely extensive (cross-module)) use-lists. It wasn't clear how to add a specific test for this, and it'll be covered anyway by an eventual patch that asserts when trying to access the use-list of an instance of ConstantData. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282334 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp index 9ecaefe85bc..c1df3173c0f 100644 --- a/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp +++ b/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp @@ -297,6 +297,11 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall) { if (!extractAlignmentInfo(ACall, AAPtr, AlignSCEV, OffSCEV)) return false; + // Skip ConstantPointerNull and UndefValue. Assumptions on these shouldn't + // affect other users. + if (isa(AAPtr)) + return false; + const SCEV *AASCEV = SE->getSCEV(AAPtr); // Apply the assumption to all other users of the specified pointer. -- 2.50.1