[llvm-commits] [llvm] r123243 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolution.h lib/Analysis/ScalarEvolution.cpp
Chris Lattner
sabre at nondot.org
Tue Jan 11 09:12:00 PST 2011
Author: lattner
Date: Tue Jan 11 11:11:59 2011
New Revision: 123243
URL: http://llvm.org/viewvc/llvm-project?rev=123243&view=rev
Log:
some comment improvements.
Modified:
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=123243&r1=123242&r2=123243&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Tue Jan 11 11:11:59 2011
@@ -537,8 +537,9 @@
///
const SCEV *getNotSCEV(const SCEV *V);
- /// getMinusSCEV - Return LHS-RHS.
- ///
+ /// getMinusSCEV - Return LHS-RHS. Minus is represented in SCEV as A+B*-1,
+ /// and thus the HasNUW and HasNSW bits apply to the resultant add, not
+ /// whether the sub would have overflowed.
const SCEV *getMinusSCEV(const SCEV *LHS, const SCEV *RHS,
bool HasNUW = false, bool HasNSW = false);
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=123243&r1=123242&r2=123243&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jan 11 11:11:59 2011
@@ -2446,8 +2446,9 @@
return getMinusSCEV(AllOnes, V);
}
-/// getMinusSCEV - Return a SCEV corresponding to LHS - RHS.
-///
+/// getMinusSCEV - Return LHS-RHS. Minus is represented in SCEV as A+B*-1,
+/// and thus the HasNUW and HasNSW bits apply to the resultant add, not
+/// whether the sub would have overflowed.
const SCEV *ScalarEvolution::getMinusSCEV(const SCEV *LHS, const SCEV *RHS,
bool HasNUW, bool HasNSW) {
// Fast path: X - X --> 0.
@@ -4021,7 +4022,7 @@
cast<SCEVConstant>(RHSA->getOperand(1))->getValue();
// If the strides are equal, then this is just a (complex) loop invariant
- // comparison of a/b.
+ // comparison of a and b.
if (LHSStride == RHSStride)
return SE.getMinusSCEV(LHSA->getStart(), RHSA->getStart());
More information about the llvm-commits
mailing list