[llvm] r282334 - Scalar: Ignore ConstantData in processAssumption
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 24 13:00:39 PDT 2016
Author: dexonsmith
Date: Sat Sep 24 15:00:38 2016
New Revision: 282334
URL: http://llvm.org/viewvc/llvm-project?rev=282334&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp?rev=282334&r1=282333&r2=282334&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp Sat Sep 24 15:00:38 2016
@@ -297,6 +297,11 @@ bool AlignmentFromAssumptionsPass::proce
if (!extractAlignmentInfo(ACall, AAPtr, AlignSCEV, OffSCEV))
return false;
+ // Skip ConstantPointerNull and UndefValue. Assumptions on these shouldn't
+ // affect other users.
+ if (isa<ConstantData>(AAPtr))
+ return false;
+
const SCEV *AASCEV = SE->getSCEV(AAPtr);
// Apply the assumption to all other users of the specified pointer.
More information about the llvm-commits
mailing list