Skip to content

Commit feae667

Browse files
committed
Add a comment to getNewAlignmentDiff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217350 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 5f36b46 commit feae667

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Transforms/Scalar/AlignmentFromAssumptions.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ FunctionPass *llvm::createAlignmentFromAssumptionsPass() {
9696

9797
// Given an expression for the (constant) alignment, AlignSCEV, and an
9898
// expression for the displacement between a pointer and the aligned address,
99-
// DiffSCEV, compute the alignment of the displaced pointer if it can be
100-
// reduced to a constant.
99+
// DiffSCEV, compute the alignment of the displaced pointer if it can be reduced
100+
// to a constant. Using SCEV to compute alignment handles the case where
101+
// DiffSCEV is a recurrence with constant start such that the aligned offset
102+
// is constant. e.g. {16,+,32} % 32 -> 16.
101103
static unsigned getNewAlignmentDiff(const SCEV *DiffSCEV,
102104
const SCEV *AlignSCEV,
103105
ScalarEvolution *SE) {

0 commit comments

Comments
 (0)