diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:17:04 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:17:04 +0000 |
| commit | b915e9e0fc85ba6f398b3fab0db6a81a8913af94 (patch) | |
| tree | 98b8f811c7aff2547cab8642daf372d6c59502fb /lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | |
| parent | 6421cca32f69ac849537a3cff78c352195e99f1b (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/Scalar/AlignmentFromAssumptions.cpp')
| -rw-r--r-- | lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp index 7f8b8ce91e79..c1df3173c0fc 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<ConstantData>(AAPtr)) + return false; + const SCEV *AASCEV = SE->getSCEV(AAPtr); // Apply the assumption to all other users of the specified pointer. @@ -434,6 +439,11 @@ AlignmentFromAssumptionsPass::run(Function &F, FunctionAnalysisManager &AM) { ScalarEvolution &SE = AM.getResult<ScalarEvolutionAnalysis>(F); DominatorTree &DT = AM.getResult<DominatorTreeAnalysis>(F); bool Changed = runImpl(F, AC, &SE, &DT); + + // FIXME: We need to invalidate this to avoid PR28400. Is there a better + // solution? + AM.invalidate<ScalarEvolutionAnalysis>(F); + if (!Changed) return PreservedAnalyses::all(); PreservedAnalyses PA; |
