summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-09-24 20:00:38 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-09-24 20:00:38 +0000
commit4fd9b7e16f98173d730ac1a347f7eae96a9fd2db (patch)
treee411457c6869826721caaaf6c8e94534acea1463 /llvm/lib/Transforms
parentb4798739127cd7748177ac506e6d45cc8cf5e4f8 (diff)
downloadbcm5719-llvm-4fd9b7e16f98173d730ac1a347f7eae96a9fd2db.tar.gz
bcm5719-llvm-4fd9b7e16f98173d730ac1a347f7eae96a9fd2db.zip
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. llvm-svn: 282334
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
index 9ecaefe85bc..c1df3173c0f 100644
--- a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
+++ b/llvm/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<ConstantData>(AAPtr))
+ return false;
+
const SCEV *AASCEV = SE->getSCEV(AAPtr);
// Apply the assumption to all other users of the specified pointer.
OpenPOWER on IntegriCloud