Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 3a296bc

Browse files
committed
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
1 parent e31ddb4 commit 3a296bc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Transforms/Scalar/AlignmentFromAssumptions.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall) {
297297
if (!extractAlignmentInfo(ACall, AAPtr, AlignSCEV, OffSCEV))
298298
return false;
299299

300+
// Skip ConstantPointerNull and UndefValue. Assumptions on these shouldn't
301+
// affect other users.
302+
if (isa<ConstantData>(AAPtr))
303+
return false;
304+
300305
const SCEV *AASCEV = SE->getSCEV(AAPtr);
301306

302307
// Apply the assumption to all other users of the specified pointer.

0 commit comments

Comments
 (0)