[llvm] r217350 - Add a comment to getNewAlignmentDiff.

Andrew Trick atrick at apple.com
Sun Sep 7 16:16:24 PDT 2014


Author: atrick
Date: Sun Sep  7 18:16:24 2014
New Revision: 217350

URL: http://llvm.org/viewvc/llvm-project?rev=217350&view=rev
Log:
Add a comment to getNewAlignmentDiff.

Modified:
    llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp?rev=217350&r1=217349&r2=217350&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp Sun Sep  7 18:16:24 2014
@@ -96,8 +96,10 @@ FunctionPass *llvm::createAlignmentFromA
 
 // 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) {





More information about the llvm-commits mailing list