From feae6677424f5d25e084b0525707c033e5ecea5e Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Sun, 7 Sep 2014 23:16:24 +0000 Subject: [PATCH] Add a comment to getNewAlignmentDiff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217350 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp index 8b1b0ab0633..a662accf69f 100644 --- a/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp +++ b/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp @@ -96,8 +96,10 @@ FunctionPass *llvm::createAlignmentFromAssumptionsPass() { // Given an expression for the (constant) alignment, AlignSCEV, and an // expression for the displacement between a pointer and the aligned address, -// DiffSCEV, compute the alignment of the displaced pointer if it can be -// reduced to a constant. +// DiffSCEV, compute the alignment of the displaced pointer if it can be reduced +// to a constant. Using SCEV to compute alignment handles the case where +// DiffSCEV is a recurrence with constant start such that the aligned offset +// is constant. e.g. {16,+,32} % 32 -> 16. static unsigned getNewAlignmentDiff(const SCEV *DiffSCEV, const SCEV *AlignSCEV, ScalarEvolution *SE) { -- 2.34.1