Add a fast path for x - x.
llvm-svn: 108855
This commit is contained in:
parent
1804d30cf1
commit
46f00a25f9
@ -2442,6 +2442,10 @@ const SCEV *ScalarEvolution::getNotSCEV(const SCEV *V) {
|
||||
///
|
||||
const SCEV *ScalarEvolution::getMinusSCEV(const SCEV *LHS,
|
||||
const SCEV *RHS) {
|
||||
// Fast path: X - X --> 0.
|
||||
if (LHS == RHS)
|
||||
return getConstant(LHS->getType(), 0);
|
||||
|
||||
// X - Y --> X + -Y
|
||||
return getAddExpr(LHS, getNegativeSCEV(RHS));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user